/*
    TeamMap.css - everything View.MapOverlay draws over the map: the team list ("Show Whole Team")
    with its pins' name labels and details pop-up, and the day replay ("Track user") with its
    stops list and time bar.

    Chrome comes from tokens: the --th-* ones a theme sets (Themes.css), falling back to the
    --totm-* ones Classic defines (Modern.css), so the panel follows whichever theme is picked
    with nothing added to Themes.css.

    The four age colours and the day replay's four segment colours are NOT tokens. They carry
    meaning (how old a position is; stop, travel or gap), so they are the same in every theme - and
    Scripts/Utils/Util.MapHelper.js repeats them for the pins and route lines. Change both together.

    The pin label and the pop-up are drawn inside Google's own map, which is always light, so
    those two use fixed light-surface colours rather than theme tokens.
*/

.TeamMapPanel {
    position: absolute;
    /* Below Google's Map/Satellite switch, which sits in the map's top-left corner. */
    top: 60px;
    left: 10px;
    z-index: 150;
    width: 280px;
    box-sizing: border-box;
    background: var(--th-panel, #FFFFFF);
    color: var(--th-text, var(--totm-text));
    border: 1px solid var(--th-line-strong, var(--totm-border-strong));
    border-radius: var(--th-radius-dialog, 4px);
    box-shadow: var(--totm-shadow-hover);
    font-family: var(--totm-font);
    font-size: var(--totm-fs-sm);
    line-height: 1.35;
    text-align: left;
}

.TeamMapPanelHeader {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    padding: 9px 12px 2px;
}

.TeamMapPanelTitle {
    font-size: var(--totm-fs-lg);
    font-weight: 700;
}

.TeamMapPanelUpdated,
.TeamMapSummary,
.TeamMapNote {
    font-size: var(--totm-fs-xs);
    color: var(--th-muted, var(--totm-text-muted));
}

.TeamMapSummary {
    padding: 0 12px 8px;
}

.TeamMapList {
    list-style: none;
    margin: 0;
    padding: 0;
    /* The panel sits on a 600px map: the list scrolls so the legend below it stays in view. */
    max-height: 300px;
    overflow-y: auto;
    border-top: 1px solid var(--th-line, var(--totm-border));
    border-bottom: 1px solid var(--th-line, var(--totm-border));
}

.TeamMapList li + li {
    border-top: 1px solid var(--th-line-faint, var(--totm-border));
}

/* A row is a real button, so it is reachable by keyboard. The Scheduler's global button rule
   (Scheduler.css, and Themes.css under a theme) forces its fill, text colour, padding, radius
   and weight with !important, so each of those needs !important here to be a plain list row -
   the same thing button.UpcomingWorkRow in Modern.css does. */
button.TeamMapRow,
button.DayReplayRow {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    min-height: 44px;
    height: auto;
    margin: 0;
    padding: 6px 12px !important;
    box-sizing: border-box;
    border: 0;
    border-radius: 0 !important;
    background-color: transparent !important;
    color: var(--th-text, var(--totm-text)) !important;
    font: inherit;
    font-weight: 400 !important;
    text-align: left;
    text-transform: none;
    letter-spacing: normal;
    box-shadow: none;
    cursor: pointer;
}

button.TeamMapRow:hover,
button.DayReplayRow:hover {
    background-color: var(--th-quiet-hover, var(--totm-brand-tint)) !important;
}

button.TeamMapRow:focus-visible,
button.DayReplayRow:focus-visible {
    outline: 2px solid var(--totm-brand);
    outline-offset: -2px;
}

button.TeamMapRow.TeamMapRow--selected,
button.DayReplayRow.DayReplayRow--current {
    background-color: var(--th-accent-tint, var(--totm-brand-tint)) !important;
}

.TeamMapRowText {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.TeamMapRowName {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.TeamMapRowBooking {
    font-size: var(--totm-fs-xs);
    color: var(--th-muted, var(--totm-text-muted));
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.TeamMapAge {
    flex: 0 0 auto;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: var(--totm-fs-xs);
    white-space: nowrap;
}

.TeamMapDot {
    flex: 0 0 auto;
    width: 10px;
    height: 10px;
    box-sizing: border-box;
    border-radius: 50%;
}

/* Age bands. The pill is a tint with dark text of the same hue, so each band differs in
   lightness as well as hue; the wording in the pill says the same thing a third way. */
.TeamMapRow--fresh .TeamMapDot { background: #1B7F4B; }
.TeamMapRow--fresh .TeamMapAge { background: #E3F4EA; color: #14633A; }

.TeamMapRow--stale .TeamMapDot { background: #9A5B00; }
.TeamMapRow--stale .TeamMapAge { background: #FEF3C7; color: #8A4B08; }

.TeamMapRow--old .TeamMapDot { background: #5B6676; }
.TeamMapRow--old .TeamMapAge { background: #EEF0F3; color: #3F4955; }

/* Nobody to show on the map: a hollow dot, so it reads as absent rather than as a fourth age. */
.TeamMapRow--none .TeamMapDot { background: transparent; border: 2px solid #5B6676; }
.TeamMapRow--none .TeamMapAge { background: #EEF0F3; color: #3F4955; }

.TeamMapLegend {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 10px;
    padding: 8px 12px 4px;
    font-size: var(--totm-fs-2xs);
    color: var(--th-muted, var(--totm-text-muted));
}

.TeamMapLegendItem {
    display: flex;
    align-items: center;
    gap: 6px;
}

.TeamMapNote {
    padding: 2px 12px 10px;
    font-size: var(--totm-fs-2xs);
}


/* --- Inside Google's map: always a light surface ------------------------------------------- */

/* The name above a pin. Google draws the text; this gives it a plate so it stays readable over
   roads and parks. */
.TeamMapPinLabel {
    padding: 2px 6px;
    border-radius: 3px;
    background: #FFFFFF;
    border: 1px solid #C9CCD1;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.25);
    font-family: var(--totm-font);
    white-space: nowrap;
}

/* The pop-up's own close button is a <button> Google draws, so the Scheduler's global button
   rule paints it solid blue. Scoped to the pop-up: the map's other controls are left as they were. */
.gm-style-iw button.gm-ui-hover-effect {
    background-color: transparent !important;
}

.TeamMapInfo {
    min-width: 210px;
    max-width: 280px;
    color: #18202B;
    font-family: var(--totm-font);
    font-size: 13px;
    line-height: 1.4;
    text-align: left;
}

.TeamMapInfoName {
    margin-bottom: 4px;
    font-size: 15px;
    font-weight: 700;
}

.TeamMapInfoLine {
    display: flex;
    gap: 8px;
    font-size: 12px;
}

.TeamMapInfoLabel {
    flex: 0 0 68px;
    color: #5B6676;
}

/* Left to the global button rule for its fill and text colour, so it is the same blue (or
   theme accent) as every other action button. Only its size is set here. */
button.TeamMapInfoButton {
    margin: 10px 0 2px;
    min-height: 34px;
    height: auto;
    padding: 0 12px !important;
    font: inherit;
    font-weight: 600 !important;
    text-transform: none;
    cursor: pointer;
}


/* --- Day replay ("Track user") --------------------------------------------------------------

   The stops list reuses the team list's panel and row rules above. What follows is only what is
   the day replay's own: the four totals, the rows between stops, and the time bar. */

.DayReplayTotals {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 12px;
    padding: 4px 12px 10px;
}

.DayReplayTotal {
    display: flex;
    flex-direction: column;
}

.DayReplayTotalLabel {
    font-size: var(--totm-fs-2xs);
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--th-muted, var(--totm-text-muted));
}

.DayReplayTotalValue {
    font-size: var(--totm-fs-lg);
    font-weight: 700;
}

/* Travel and gaps between stops: not buttons, there is nothing to jump to. */
.DayReplayBetween {
    padding: 4px 12px 4px 43px;
    font-size: var(--totm-fs-xs);
    color: var(--th-muted, var(--totm-text-muted));
    background: var(--th-subtle, #F6F7F9);
}

button.DayReplayRow {
    align-items: flex-start;
}

.DayReplayRowDetail {
    font-size: var(--totm-fs-xs);
    color: var(--th-muted, var(--totm-text-muted));
}

.DayReplayNumber {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    box-sizing: border-box;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--totm-fs-xs);
    font-weight: 700;
}

/* Segment colours. A stop with no booking is hollow, travel is a lighter orange and a gap is
   hatched, so the four differ in lightness and pattern as well as hue. */
.DayReplayRow--booked .DayReplayNumber { background: #1769C7; color: #FFFFFF; }
.DayReplayRow--unbooked .DayReplayNumber { background: #FFFFFF; color: #8A4B08; border: 2px solid #8A4B08; }

.DayReplaySegment--booked { background: #1769C7; }
.DayReplaySegment--travel { background: #F0B454; }
.DayReplaySegment--unbooked { background: #FFFFFF; box-shadow: inset 0 0 0 2px #8A4B08; }
.DayReplaySegment--gap { background: repeating-linear-gradient(135deg, #CDD3DB 0 4px, #F6F7F9 4px 8px); }

/* The time bar sits over the bottom of the map, clear of the stops list on its left and of
   Google's zoom and Street View controls on its right. */
.DayReplayBar {
    position: absolute;
    left: 300px;
    right: 60px;
    bottom: 76px;
    z-index: 150;
    box-sizing: border-box;
    padding: 8px 12px 6px;
    background: var(--th-panel, #FFFFFF);
    color: var(--th-text, var(--totm-text));
    border: 1px solid var(--th-line-strong, var(--totm-border-strong));
    border-radius: var(--th-radius-dialog, 4px);
    box-shadow: var(--totm-shadow-hover);
    font-family: var(--totm-font);
    font-size: var(--totm-fs-sm);
    text-align: left;
}

.DayReplayBarTop {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

/* Left to the global button rule for its fill and text colour, like every other action button. */
button.DayReplayPlay {
    flex: 0 0 auto;
    min-width: 64px;
    min-height: 30px;
    height: auto;
    margin: 0;
    padding: 0 10px !important;
    font: inherit;
    font-weight: 600 !important;
    text-transform: none;
    cursor: pointer;
}

.DayReplayTime {
    flex: 0 0 auto;
    font-size: var(--totm-fs-lg);
    font-weight: 700;
    white-space: nowrap;
}

.DayReplayWhat {
    flex: 1 1 auto;
    min-width: 0;
    font-size: var(--totm-fs-xs);
    color: var(--th-muted, var(--totm-text-muted));
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.DayReplayTrack {
    position: relative;
    height: 20px;
    margin-top: 8px;
}

.DayReplaySegments {
    position: absolute;
    top: 4px;
    bottom: 4px;
    left: 0;
    right: 0;
    display: flex;
    border-radius: 3px;
    overflow: hidden;
    outline: 1px solid var(--th-line-strong, var(--totm-border-strong));
}

.DayReplaySegment {
    flex: 1 1 0;
    min-width: 0;
}

/* A real range input laid over the coloured bar, so the time is keyboard-operable. Its own track
   is transparent; only the thumb shows. The compound selector and !important keep the
   Scheduler's global input rules (border, padding, fill) off it. */
input.DayReplayRange {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 20px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

input.DayReplayRange::-webkit-slider-runnable-track {
    height: 20px;
    background: transparent;
}

input.DayReplayRange::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 6px;
    height: 20px;
    border-radius: 3px;
    background: #18202B;
    border: 1px solid #FFFFFF;
}

input.DayReplayRange::-moz-range-track {
    height: 20px;
    background: transparent;
}

input.DayReplayRange::-moz-range-thumb {
    width: 4px;
    height: 18px;
    border-radius: 3px;
    background: #18202B;
    border: 1px solid #FFFFFF;
}

input.DayReplayRange:focus-visible {
    outline: 2px solid var(--totm-brand);
    outline-offset: 2px;
}

.DayReplayEnds {
    display: flex;
    justify-content: space-between;
    margin-top: 2px;
    font-size: var(--totm-fs-2xs);
    color: var(--th-muted, var(--totm-text-muted));
}


/* --- Location badges on bookings (Data.LocationFlags) ---------------------------------------

   A small pill in the booking chip's bottom-right corner. The colours carry meaning (where the
   person is), so like the booking status colours they are the same in every theme; each badge's
   words say the same thing, so colour is never the only signal. Both calendar engines position
   their chips (FullCalendar's .fc-timeline-event is relative, the new engine's .cal-event is
   absolute), so the pill anchors to the chip. */

.LocationFlag {
    position: absolute;
    right: 3px;
    bottom: 2px;
    z-index: 3;
    max-width: calc(100% - 6px);
    box-sizing: border-box;
    padding: 0 6px;
    border-radius: 999px;
    font-family: var(--totm-font);
    font-size: 10px;
    font-weight: 700;
    line-height: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: auto;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.85);
}

.LocationFlag--OnSite { background: #E3F4EA; color: #14633A; }
.LocationFlag--WasOnSite { background: #EEF0F3; color: #3F4955; }
.LocationFlag--OnTheWay { background: #FFFFFF; color: #0C447C; box-shadow: inset 0 0 0 1px #1769C7, 0 0 0 1px rgba(255, 255, 255, 0.85); }
.LocationFlag--Late { background: #FEF3C7; color: #8A4B08; }
.LocationFlag--TimerAway { background: #FEE4E2; color: #B42318; }


/* --- Location & drive times settings (View.LocationSettings) ------------------------------- */

.LocationSettings h3 {
    margin: 14px 0 4px;
}

.LocationSettings h3:first-child {
    margin-top: 0;
}

.LocationSettingsIntro {
    max-width: 700px;
    margin: 0 0 8px;
    color: var(--th-muted, var(--totm-text-muted));
    font-size: var(--totm-fs-sm);
}

.LocationSettingsCheck {
    display: block;
    margin: 6px 0;
}

.LocationSettingsNote,
.LocationSettingsUnit {
    color: var(--th-muted, var(--totm-text-muted));
    font-size: var(--totm-fs-xs);
}

.LocationSettingsNote {
    margin: 2px 0 0 22px;
}


/* --- Who is closest? (nearest staff) --------------------------------------------------------

   Reuses the team list's panel. The suggestion's blue and the old-position amber carry meaning
   and match the pins (View.MapOverlay's NEAREST_* colours), so they are the same in every theme. */

.TeamMapPanel.NearestPanel {
    width: 330px;
}

.NearestPanel .TeamMapPanelHeader {
    align-items: center;
}

button.NearestRefresh {
    min-height: 28px;
    height: auto;
    padding: 0 10px !important;
    font: inherit;
    font-size: var(--totm-fs-xs);
    text-transform: none;
    cursor: pointer;
}

.NearestJob {
    margin: 4px 12px 8px;
    padding: 8px 10px;
    border: 1px solid var(--th-line, var(--totm-border));
    border-radius: 4px;
}

.NearestJobTitle {
    font-weight: 700;
}

.NearestJobLine {
    font-size: var(--totm-fs-xs);
    color: var(--th-muted, var(--totm-text-muted));
}

.NearestList {
    max-height: 340px;
}

.NearestRow {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
}

.NearestRow.NearestRow--best {
    background: var(--th-accent-tint, var(--totm-brand-tint));
}

/* The drive time is a button (pans the map to the person), so it needs the same !important
   reset as the team list's rows to stop the global button rule painting it solid. */
button.NearestDrive {
    flex: 0 0 58px;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0;
    padding: 2px 0 !important;
    border: 0;
    border-radius: 3px !important;
    background-color: transparent !important;
    color: var(--th-text, var(--totm-text)) !important;
    font: inherit;
    font-weight: 400 !important;
    text-transform: none;
    box-shadow: none;
    cursor: pointer;
}

button.NearestDrive:hover {
    background-color: var(--th-quiet-hover, var(--totm-brand-tint)) !important;
}

.NearestMinutes {
    font-size: 16px;
    font-weight: 700;
    white-space: nowrap;
}

.NearestKm,
.NearestSeen {
    font-size: var(--totm-fs-xs);
    color: var(--th-muted, var(--totm-text-muted));
}

.NearestAvailability {
    font-size: var(--totm-fs-xs);
}

/* "Free" and "position is old" are pills - a tint with dark text, as the team list's age pills
   are - so they read on every theme's panel, dark ones included. */
.NearestAvailability--Free,
.NearestAvailability--FreeUntil,
.NearestRow--unsure .NearestSeen {
    align-self: flex-start;
    margin: 1px 0;
    padding: 0 6px;
    border-radius: 999px;
    font-weight: 600;
}

.NearestAvailability--Free,
.NearestAvailability--FreeUntil {
    background: #E3F4EA;
    color: #14633A;
}

.NearestRow--unsure .NearestSeen {
    background: #FEF3C7;
    color: #8A4B08;
}

button.NearestBook {
    flex: 0 0 auto;
    min-height: 32px;
    height: auto;
    padding: 0 12px !important;
    font: inherit;
    font-weight: 600 !important;
    text-transform: none;
    cursor: pointer;
}

.NearestEmpty {
    padding: 10px 12px;
    color: var(--th-muted, var(--totm-text-muted));
}

.NearestUnranked {
    padding: 8px 12px 0;
    font-size: var(--totm-fs-xs);
}

.NearestUnranked:empty {
    display: none;
}

.NearestNote {
    padding-top: 8px;
}

/* --- Timesheet cross-check (View.TimesheetCheck) --------------------------------------------

   Drawn in Util.Control.ReportFilterDialog's card, which is always white, so like the map's
   pop-up it uses fixed light-surface colours rather than theme tokens. The result colours carry
   meaning and pair a tint with dark text of the same hue, so each differs in lightness as well. */

.TimesheetCheck {
    color: #18202B;
    font-family: var(--totm-font);
    font-size: 13px;
    text-align: left;
}

.TimesheetCheckToolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 16px;
    margin: 4px 0 10px;
}

.TimesheetCheckPills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* Real buttons, so the global button rule's !important fill needs !important to undo. */
button.TimesheetCheckPill {
    min-height: 30px;
    height: auto;
    padding: 0 12px !important;
    border: 1px solid #CDD3DB;
    border-radius: 999px !important;
    background-color: #FFFFFF !important;
    color: #3F4955 !important;
    font: inherit;
    font-weight: 600 !important;
    text-transform: none;
    box-shadow: none;
    cursor: pointer;
}

button.TimesheetCheckPill--ok { background-color: #E3F4EA !important; color: #14633A !important; border-color: #E3F4EA; }
button.TimesheetCheckPill--review { background-color: #FEF3C7 !important; color: #8A4B08 !important; border-color: #FEF3C7; }

button.TimesheetCheckPill.TimesheetCheckPill--on {
    outline: 2px solid #18202B;
    outline-offset: 1px;
}

button.TimesheetCheckPill.TimesheetCheckPill--all.TimesheetCheckPill--on {
    background-color: #1B2430 !important;
    color: #FFFFFF !important;
    border-color: #1B2430;
    outline: none;
}

.TimesheetCheckTolerance select {
    height: 30px;
    margin-left: 4px;
}

.TimesheetCheckTableWrap {
    max-height: 42vh;
    overflow: auto;
    border: 1px solid #E4E7EC;
    border-radius: 4px;
}

.TimesheetCheckTable {
    width: 100%;
    min-width: 860px;
    border-collapse: collapse;
}

.TimesheetCheckTable th {
    position: sticky;
    top: 0;
    padding: 8px 12px;
    background: #F6F7F9;
    color: #5B6676;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-align: left;
    text-transform: uppercase;
}

.TimesheetCheckTable td {
    padding: 8px 12px;
    border-top: 1px solid #EEF0F3;
    vertical-align: top;
}

.TimesheetCheckRow {
    cursor: pointer;
}

.TimesheetCheckRow:hover {
    background: #F6F7F9;
}

.TimesheetCheckRow:focus-visible {
    outline: 2px solid #1769C7;
    outline-offset: -2px;
}

.TimesheetCheckRow.TimesheetCheckRow--selected {
    background: #E8F1FB;
}

.TimesheetCheckName {
    font-weight: 600;
    white-space: nowrap;
}

.TimesheetCheckJob {
    max-width: 260px;
}

.TimesheetCheckRow--review .TimesheetCheckDifference {
    color: #8A4B08;
    font-weight: 600;
}

.TimesheetCheckRow--unknown .TimesheetCheckOnSite,
.TimesheetCheckRow--unknown .TimesheetCheckDifference {
    color: #5B6676;
}

.TimesheetCheckResult {
    display: inline-block;
    padding: 1px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.TimesheetCheckResult--ok { background: #E3F4EA; color: #14633A; }
.TimesheetCheckResult--review { background: #FEF3C7; color: #8A4B08; }
.TimesheetCheckResult--unknown { background: #EEF0F3; color: #3F4955; }

.TimesheetCheckEmpty {
    padding: 14px 12px;
    color: #5B6676;
}

.TimesheetCheckDetail {
    margin-top: 12px;
    padding: 14px;
    border: 1px solid #CDD3DB;
    border-radius: 4px;
}

.TimesheetCheckDetailTitle {
    font-size: 15px;
    font-weight: 700;
}

.TimesheetCheckDetailText {
    margin-top: 2px;
    color: #3F4955;
}

.TimesheetCheckDetailText--review {
    color: #8A4B08;
    font-weight: 600;
}

.TimesheetCheckTimeline {
    display: grid;
    grid-template-columns: 90px minmax(0, 1fr);
    gap: 8px 12px;
    align-items: center;
    margin-top: 12px;
    font-size: 12px;
}

.TimesheetCheckLaneLabel {
    color: #3F4955;
    font-weight: 600;
}

.TimesheetCheckTrack {
    position: relative;
    height: 22px;
    background: #F6F7F9;
    border: 1px solid #E4E7EC;
    border-radius: 3px;
}

.TimesheetCheckBar {
    position: absolute;
    top: 0;
    bottom: 0;
    box-sizing: border-box;
    padding: 2px 6px;
    border-radius: 2px;
    color: #FFFFFF;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.TimesheetCheckBar--entry { background: #1769C7; }
.TimesheetCheckBar--visit { background: #1B7F4B; min-width: 3px; }

.TimesheetCheckFix {
    display: inline-block;
    width: 8px;
    height: 8px;
    box-sizing: border-box;
    border-radius: 50%;
}

.TimesheetCheckTrack .TimesheetCheckFix {
    position: absolute;
    top: 6px;
    margin-left: -4px;
}

.TimesheetCheckFix--on { background: #1B7F4B; }
.TimesheetCheckFix--away { background: #FFFFFF; border: 2px solid #9A5B00; }

.TimesheetCheckScale {
    position: relative;
    height: 14px;
    color: #5B6676;
    font-size: 11px;
}

.TimesheetCheckScale span {
    position: absolute;
    transform: translateX(-50%);
    white-space: nowrap;
}

.TimesheetCheckLegend {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
    margin-top: 10px;
    color: #3F4955;
    font-size: 12px;
}

.TimesheetCheckNote {
    margin-top: 10px;
    color: #5B6676;
    font-size: 12px;
}

.TimesheetCheckActions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
    margin-top: 14px;
}

/* Left to the global button rule for its fill, like every other action button; size only. */
button.TimesheetCheckApply {
    min-height: 34px;
    height: auto;
    padding: 0 14px !important;
    font: inherit;
    font-weight: 600 !important;
    text-transform: none;
    cursor: pointer;
}

.TimesheetCheckActionsNote {
    color: #5B6676;
    font-size: 12px;
}

.TimesheetCheckActionResult {
    margin-top: 10px;
    padding: 6px 10px;
    border-radius: 3px;
    background: #E3F4EA;
    color: #14633A;
    font-weight: 600;
}

.TimesheetCheckActionResult--error {
    background: #FEE4E2;
    color: #B42318;
}

.TimesheetCheckButtons {
    margin-top: 12px;
    text-align: right;
}

/* --- Travel & time on site (View.TeamInsights) ----------------------------------------------

   Inside the themed settings dialog, so chrome comes from tokens. The three bar colours carry
   meaning (on site, travelling or elsewhere, no positions) and are the same in every theme; each
   pairs with dark or white text chosen for that fill. */

.TeamInsights {
    color: var(--th-text, var(--totm-text));
    font-family: var(--totm-font);
    font-size: 13px;
    text-align: left;
}

.TeamInsightsHeader {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 16px;
    margin-bottom: 12px;
}

.TeamInsightsIntro,
.TeamInsightsPanelSubtitle,
.TeamInsightsNote {
    color: var(--th-muted, var(--totm-text-muted));
}

.TeamInsightsNote {
    margin-top: 10px;
    font-size: 12px;
}

.TeamInsightsPeriods {
    display: flex;
    gap: 6px;
}

/* A choice of one, so the chosen one must look different in every theme - including Classic,
   whose global button rule paints every button the same solid blue (hence the !important). */
button.TeamInsightsPeriod {
    min-height: 32px;
    height: auto;
    padding: 0 12px !important;
    border: 1px solid var(--th-line-strong, var(--totm-border-strong)) !important;
    border-radius: 3px !important;
    background-color: var(--th-panel, #FFFFFF) !important;
    color: var(--th-text, var(--totm-text)) !important;
    font: inherit;
    font-weight: 500 !important;
    text-transform: none;
    box-shadow: none;
    cursor: pointer;
}

button.TeamInsightsPeriod.TeamInsightsPeriod--on {
    border-color: var(--totm-brand) !important;
    background-color: var(--totm-brand) !important;
    color: #FFFFFF !important;
    font-weight: 700 !important;
}

.TeamInsightsRow {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: stretch;
    margin-bottom: 16px;
}

.TeamInsightsPanel {
    flex: 1 1 380px;
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--th-line, var(--totm-border));
    border-radius: 4px;
}

.TeamInsightsRow .TeamInsightsPanel:first-child {
    flex-grow: 2;
}

h3.TeamInsightsPanelTitle {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
}

.TeamInsightsEmpty {
    padding: 10px 0;
    color: var(--th-muted, var(--totm-text-muted));
}

.TeamInsightsBars,
.TeamInsightsPlant {
    display: grid;
    gap: 9px 12px;
    align-items: center;
    margin-top: 12px;
}

.TeamInsightsBars {
    grid-template-columns: minmax(90px, 140px) minmax(0, 1fr);
}

.TeamInsightsPlant {
    grid-template-columns: minmax(90px, 160px) minmax(0, 1fr) auto;
}

.TeamInsightsName {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.TeamInsightsBar {
    display: flex;
    height: 24px;
    overflow: hidden;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
}

.TeamInsightsBarPart {
    box-sizing: border-box;
    padding: 4px 6px;
    overflow: hidden;
    white-space: nowrap;
}

.TeamInsightsBar--site { background: #1769C7; color: #FFFFFF; }
.TeamInsightsBar--away { background: #F0B454; color: #18202B; }
.TeamInsightsBar--none { background: #DDE1E7; color: #18202B; }

.TeamInsightsLegend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    margin-top: 12px;
    font-size: 12px;
}

.TeamInsightsLegend > span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.TeamInsightsSwatch {
    display: inline-block;
    width: 14px;
    height: 10px;
    border-radius: 2px;
}

.TeamInsightsTightList {
    list-style: none;
    margin: 10px 0 0;
    padding: 0;
    max-height: 360px;
    overflow-y: auto;
}

.TeamInsightsTightList li {
    padding: 9px 0;
    border-top: 1px solid var(--th-line, var(--totm-border));
}

.TeamInsightsTightHeading {
    font-weight: 600;
}

.TeamInsightsTightDetail {
    font-size: 12px;
}

/* The panel's own text colour, so it reads on every theme; bold marks it as the finding. */
.TeamInsightsTightVerdict {
    font-size: 12px;
    font-weight: 700;
}

button.TeamInsightsShow {
    min-height: 28px;
    height: auto;
    margin-top: 4px;
    padding: 0 10px !important;
    font: inherit;
    font-size: 12px;
    text-transform: none;
    cursor: pointer;
}

.TeamInsightsPlantTrack {
    height: 14px;
    overflow: hidden;
    border-radius: 3px;
    background: #EEF0F3;
}

.TeamInsightsPlantFill {
    height: 100%;
    background: #1769C7;
}

.TeamInsightsLearned,
.TeamInsightsJobLengths {
    width: 100%;
    margin-top: 10px;
    border-collapse: collapse;
}

.TeamInsightsLearned th,
.TeamInsightsJobLengths th {
    padding: 6px 8px 6px 0;
    color: var(--th-muted, var(--totm-text-muted));
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-align: left;
    text-transform: uppercase;
}

.TeamInsightsLearned td,
.TeamInsightsJobLengths td {
    padding: 7px 8px 7px 0;
    border-top: 1px solid var(--th-line, var(--totm-border));
}

.TeamInsightsLearnedUsual {
    font-weight: 700;
}

.TeamInsightsPlantText {
    white-space: nowrap;
    font-size: 12px;
}

/* ---- Learned job lengths: the hint when booking a job (section 12) ---- */

.JobLengthHint {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    margin: 8px 0;
    padding: 8px 10px;
    border-left: 3px solid var(--totm-brand, #1976D2);
    background: var(--totm-brand-tint, rgba(25, 118, 210, 0.06));
    color: var(--totm-text, inherit);
    font-size: 13px;
    line-height: 1.4;
}

.JobLengthHintText {
    flex: 1 1 220px;
}

button.JobLengthHintUse {
    min-height: 30px;
    height: auto;
    padding: 0 12px !important;
    font: inherit;
    font-weight: 600 !important;
    text-transform: none;
    white-space: nowrap;
    cursor: pointer;
}

.TeamInsightsJobLengthVerdict {
    color: var(--th-muted, var(--totm-text-muted));
}


/* ---- Map | Satellite switch (Util.MapHelper.addMapTypeToggle) ----
   In place of Google's own control, whose <button>s the global button rule turns into two big
   solid-blue blocks. Sits on the map imagery, so it keeps a white surface in every theme, like
   Google's own controls; the selected half takes the brand colour. The button.Class selectors
   with !important are what it takes to undo Scheduler.css's `button, input[type=button]` rule. */

.MapTypeToggle {
    display: inline-flex;
    margin: 10px;
    padding: 3px;
    gap: 2px;
    border-radius: 8px;
    background: #FFFFFF;
    box-shadow: 0 1px 3px rgba(16, 24, 40, 0.18), 0 1px 2px rgba(16, 24, 40, 0.08);
}

button.MapTypeToggleButton {
    height: 26px;
    margin: 0;
    padding: 0 12px !important;
    border: none;
    border-radius: 6px !important;
    background-color: transparent !important;
    color: #3C4656 !important;
    font: 600 12px/26px var(--totm-font, "Segoe UI", Roboto, Arial, sans-serif);
    font-weight: 600 !important;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: background-color var(--totm-motion, 0.15s ease), color var(--totm-motion, 0.15s ease);
}

button.MapTypeToggleButton:hover {
    background-color: #F1F4F8 !important;
}

button.MapTypeToggleButton--on,
button.MapTypeToggleButton--on:hover {
    background-color: var(--totm-brand, #1976D2) !important;
    color: #FFFFFF !important;
}

button.MapTypeToggleButton:focus-visible {
    outline: 2px solid var(--totm-brand, #1976D2);
    outline-offset: 1px;
}


/* ---- Track user | Show Whole Team, over the map's top-right corner ----
   Same pill as the Map | Satellite switch, under Google's 40px fullscreen button - beside it, it
   runs into the switch on a narrow map. These are
   actions rather than a choice, so neither half is filled; hover shows the brand tint. */

.MapActionBar {
    position: absolute;
    z-index: 200;
    top: 58px;
    right: 10px;
    display: inline-flex;
    padding: 3px;
    gap: 2px;
    border-radius: 8px;
    background: #FFFFFF;
    box-shadow: 0 1px 3px rgba(16, 24, 40, 0.18), 0 1px 2px rgba(16, 24, 40, 0.08);
}

button.MapActionButton {
    height: 26px;
    margin: 0;
    padding: 0 12px !important;
    border: none;
    border-radius: 6px !important;
    background-color: transparent !important;
    color: var(--totm-brand, #1976D2) !important;
    font: 600 12px/26px var(--totm-font, "Segoe UI", Roboto, Arial, sans-serif);
    font-weight: 600 !important;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color var(--totm-motion, 0.15s ease);
}

button.MapActionButton:hover {
    background-color: var(--totm-brand-tint, #E8F1FB) !important;
}

button.MapActionButton:focus-visible {
    outline: 2px solid var(--totm-brand, #1976D2);
    outline-offset: 1px;
}
