html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}
/* Password show/hide toggle, injected by site.js.
   Muted by default so it reads as an affordance rather than an action, and only takes on
   colour once the password is actually visible. */
.password-reveal {
  color: #6c757d;
  border-color: var(--bs-border-color);
}

.password-reveal:hover {
  color: #212529;
}

.password-reveal[aria-pressed="true"] {
  color: #0d6efd;
}

/* The validation message follows the input group rather than sitting inside it. */
.input-group + .text-danger {
  display: block;
}

/* ---------------------------------------------------------------------------------------
   Space sidebar and page tree
   --------------------------------------------------------------------------------------- */
.space-sidebar {
  background: #f8f9fa;
  border: 1px solid #dfe1e6;
  border-radius: 8px;
  padding: 1rem;
}

@media (min-width: 992px) {
  .space-sidebar {
    position: sticky;
    top: 1rem;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
  }
}

.tree-link {
  color: #42526e;
  font-size: 0.9rem;
  line-height: 1.35;
}

.tree-link:hover {
  background: #ebecf0;
  color: #091e42;
}

/* The current page, so people can see where they are in a deep tree. */
.tree-link.active {
  background: #e6effc;
  color: #0052cc;
  font-weight: 600;
}

.page-content {
  line-height: 1.6;
}

/* Sidebar collapse control. The header stays visible when the tree is hidden, so there is
   always something to click to bring it back. */
.space-sidebar-toggle {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: .4rem;
  width: 100%;
  text-align: left;
}

.space-sidebar-toggle:hover {
  color: #0052cc;
}

.toggle-caret {
  font-size: .8em;
  color: #6b778c;
}

/* A sticky sidebar that is collapsed should not still reserve the full column height. */
.space-sidebar:has(.space-sidebar-body[hidden]) {
  max-height: none;
}

/* ---------------------------------------------------------------------------------------
   Rich page content (sanitised HTML from the editor)
   --------------------------------------------------------------------------------------- */
.page-content img { max-width: 100%; height: auto; }

.page-content pre,
.page-content .ql-syntax,
.page-content .ql-code-block-container {
  background: #f4f5f7;
  padding: .75rem 1rem;
  border-radius: 4px;
  overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .9em;
}

.page-content blockquote {
  margin: 1rem 0;
  padding-left: 1rem;
  border-left: 3px solid #dfe1e6;
  color: #5e6c84;
}

.page-content table { border-collapse: collapse; margin: 1rem 0; }
.page-content th,
.page-content td { border: 1px solid #dfe1e6; padding: .35rem .6rem; }

/* Quill's alignment and indent classes, which the sanitiser allows through. */
.page-content .ql-align-center  { text-align: center; }
.page-content .ql-align-right   { text-align: right; }
.page-content .ql-align-justify { text-align: justify; }
.page-content .ql-indent-1 { padding-left: 3em; }
.page-content .ql-indent-2 { padding-left: 6em; }
.page-content .ql-indent-3 { padding-left: 9em; }
.page-content .ql-indent-4 { padding-left: 12em; }

/* The editor itself: give it a workable height rather than collapsing to one line. */
#editor { min-height: 24rem; background: #fff; }
#editor .ql-editor { min-height: 24rem; font-size: 1rem; }

/* ---------------------------------------------------------------------------------------
   Version comparison
   --------------------------------------------------------------------------------------- */
.diff-table td {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .85rem;
  white-space: pre-wrap;
  word-break: break-word;
  vertical-align: top;
}

.diff-inserted { background: #e3fcef; }
.diff-deleted  { background: #ffebe6; }
.diff-modified { background: #fffae6; }
.diff-blank    { background: #f4f5f7; }

/* ---------------------------------------------------------------------------------------
   Comments
   --------------------------------------------------------------------------------------- */
.comment {
  padding: .5rem .75rem;
  border-left: 2px solid #dfe1e6;
  margin-bottom: .5rem;
}

.comment-body {
  font-size: .95rem;
}

.comment-body p:last-child { margin-bottom: 0; }

.comment-thread { max-width: 760px; }

/* ---------------------------------------------------------------------------------------
   Who did it
   ---------------------------------------------------------------------------------------
   The actor column in the Activity log, the author of a note on a user's Comments tab, and
   the address shown under a user's name. All three answer "who", and all three read better
   for being visually unlike the prose around them.

   Courier, in the ordinary text colour. It used to be red as well, and the red was the
   thing people noticed: down a long table it read as a warning on every row, and beside a
   user's name it made a plain email address look like an error. The typeface alone is
   enough to set a name apart from the prose around it. Inheriting the colour also means it
   follows dark mode for free.

   Declared here rather than left to Bootstrap's <code> styling because these are names and
   addresses, not code, and a <span> carrying its own class says so.
   --------------------------------------------------------------------------------------- */
.audit-actor {
  font-family: "Courier New", Courier, ui-monospace, monospace;
  color: inherit;
  font-size: .875rem;
  word-break: break-word;
}

/* The one place a name is coloured: the activity log on a membership inquiry, where the
   name sits beside a grey timestamp at the end of a long line and wants picking out. Blue
   rather than red, because red on every entry reads as a warning on every entry. The same
   blue as an email address, lifted for dark mode the same way. */
.activity-who { color: #1f5fa8; }
:root[data-mode="dark"] .activity-who { color: #7fb3f0; }

/* ---------------------------------------------------------------------------------------
   Graphs on the Activity dashboard
   ---------------------------------------------------------------------------------------
   Eight categorical colours in a fixed order, plus a grey for "Other". The order is not
   cosmetic: it was checked so that every adjacent pair stays distinct under the common
   forms of colour-blindness, in both modes. The dark set is the same eight hues re-stepped
   for the dark card surface, not a lightened copy of the light set.

   Three of the light colours (aqua, yellow, pink) sit under 3:1 against white, which is why
   every graph on that page has a legend with the numbers on it and a table underneath.

   --viz-surface is the card the graph sits on: the gaps between slices and the ring round
   each marker are drawn in it, so the separation is the surface showing through rather
   than an outline.
   --------------------------------------------------------------------------------------- */
.viz, .viz-legend {
  --viz-1: #2a78d6;
  --viz-2: #eb6834;
  --viz-3: #1baf7a;
  --viz-4: #eda100;
  --viz-5: #e87ba4;
  --viz-6: #008300;
  --viz-7: #4a3aa7;
  --viz-8: #e34948;
  --viz-other: #9a9a94;
  --viz-surface: var(--c-white, #ffffff);
}

:root[data-mode="dark"] .viz,
:root[data-mode="dark"] .viz-legend {
  --viz-1: #3987e5;
  --viz-2: #d95926;
  --viz-3: #199e70;
  --viz-4: #c98500;
  --viz-5: #d55181;
  --viz-6: #008300;
  --viz-7: #9085e9;
  --viz-8: #e66767;
  --viz-other: #6f6f6a;
}

.viz-swatch {
  display: inline-block;
  width: .75rem;
  height: .75rem;
  border-radius: 2px;
  vertical-align: -1px;
  margin-right: .35rem;
}

/* The Modules page's heading icon: a plain grey box, drawn rather than an emoji, because no
   emoji is a grey box on every platform. Sized to sit beside the h4 the way the emoji on the
   other module pages do. */
.modules-icon {
  display: inline-block;
  width: 1.1em;
  height: 1.1em;
  background: #8a929c;
  border-radius: .2em;
  vertical-align: -.15em;
  margin-right: .1em;
}

:root[data-mode="dark"] .modules-icon { background: #7c8794; }

/* The four headline numbers. Large, plain, and in the text colour: the number is the chart. */
.viz-figure {
  font-size: 2.25rem;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------------------------------
   Tab panes that are not direct children of .tab-content
   ---------------------------------------------------------------------------------------
   Bootstrap hides inactive panes with

       .tab-content > .tab-pane { display: none; }

   -- a DIRECT child selector. On the user record the editable panes sit inside the <form>
   that saves them, so they are grandchildren of .tab-content and that rule never matches.
   Every pane then renders at once, and the inactive ones, being .fade without .show, are
   merely transparent rather than absent: invisible, full height, and stacked. The symptom
   is a tab that opens with a screenful of blank space above and below its content.

   Wrapping each pane in its own form instead would mean either nested forms (invalid) or
   scattering the HTML5 form= attribute across every input -- which also puts those inputs
   out of reach of jquery-validation, since it finds fields by walking the form's subtree.
   So the DOM stays as it is and the selector is relaxed to a descendant one.

   Scoped to .tabs-flush rather than applied globally, because overriding a framework rule
   everywhere to fix one page is how a stylesheet becomes impossible to reason about.
   --------------------------------------------------------------------------------------- */
.tabs-flush .tab-pane { display: none; }
.tabs-flush .tab-pane.active { display: block; }

/* The first heading or paragraph in a pane must not push the content down: the tab strip
   above it is already the separation. */
.tabs-flush .tab-pane > :first-child { margin-top: 0; }

/* ---------------------------------------------------------------------------------------
   The summary band on a record
   ---------------------------------------------------------------------------------------
   The identifying facts about the thing you are looking at -- the address, when it was
   created, when it was last used -- set in a band the full width of the panel below it, so
   it reads as a header for the whole record rather than as a stray line of small print.

   Its own tokens rather than Bootstrap's bg-body-secondary, because that resolves against
   the framework's theme and this page has two of its own: the tint the reader chose, and
   dark mode. A grey that ignores both is a grey that is wrong half the time.
   --------------------------------------------------------------------------------------- */
.record-summary {
  background: #f1f2f4;
  border: 1px solid #dfe1e6;
  border-radius: .25rem;
  padding: .5rem .75rem;
  margin-bottom: 1rem;
  font-size: .875rem;
  color: #5e6c84;
}

.record-summary .audit-actor { font-size: .875rem; }

:root[data-mode="dark"] .record-summary {
  background: #1b1f27;
  border-color: #2c3340;
  color: #9aa5b1;
}

/* ---------------------------------------------------------------------------------------
   The comment log on a user record
   ---------------------------------------------------------------------------------------
   One comment per row, kept as flat as the content allows: the author and the timestamp sit
   on the same line as the start of the note, and the note itself wraps underneath only when
   it genuinely needs to.

   white-space: pre-wrap is what supports a multi-line comment -- somebody pasting three
   lines of a telephone conversation gets three lines back, rather than one run-on paragraph
   -- while a one-line comment still occupies one line.
   --------------------------------------------------------------------------------------- */
.comment-log-item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .25rem .75rem;
  padding: .4rem .75rem;
}

.comment-log-meta {
  display: flex;
  align-items: baseline;
  gap: .5rem;
  flex: 0 0 auto;
}

.comment-log-body {
  flex: 1 1 20rem;
  min-width: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ---------------------------------------------------------------------------------------
   What the inquirer said on the form
   ---------------------------------------------------------------------------------------
   A yellow note, so this card reads as a different KIND of thing from the ones around it:
   it is what somebody typed into the public form, verbatim, and it cannot be edited. The
   cards above it are the club's own record and can. Making the two look alike invites
   somebody to try to correct the one that is evidence.

   Written as .card.form-answers, not .form-answers, and that matters: theme.css loads after
   this file and sets background, border and radius on .card. A single-class selector here
   ties on specificity and loses on order, and the note quietly came out white. The extra
   class wins on specificity whatever the order.
   --------------------------------------------------------------------------------------- */
.card.form-answers {
  /* A note lying on the page rather than a panel set into it: no border, a soft drop
     shadow, and square corners. Yellow with black text, like the pad it is imitating --
     and black rather than a tinted dark, because the whole point of a note is that it is
     the most legible thing on the page. */
  background: #fdf6c9;
  color: #000;
  border: none;
  border-radius: 0;
  box-shadow: 2px 3px 6px rgba(9, 30, 66, .25);

  /* Barely off square. Enough to say "stuck on" and not enough to be annoying to read;
     straightened on hover so the text is upright while somebody is reading it. */
  transform: rotate(-.5deg);
  transition: transform .15s ease;
}

.form-answers:hover { transform: rotate(0deg); }

/* Everything inside is black. Bootstrap's muted greys are tuned for a white ground and go
   muddy on yellow, and .text-muted in particular carries !important. */
.form-answers,
.form-answers .card-title,
.form-answers dt,
.form-answers dd,
.form-answers p,
.form-answers .text-muted {
  color: #000 !important;
}

/* The questions read as labels without needing a colour of their own. */
.form-answers dt { font-weight: 400; opacity: .72; }
.form-answers dd { font-weight: 600; }

/* Dark mode keeps it yellow. The point of the colour is that this block is a different kind
   of thing, and that has to survive the theme -- a note that turns grey at night is just a
   card again. Slightly deeper so it does not glare. */
:root[data-mode="dark"] .card.form-answers {
  background: #efe3a8;
  box-shadow: 2px 3px 8px rgba(0, 0, 0, .5);
}

/* ---------------------------------------------------------------------------------------
   Status badges and the Statistics boxes
   ---------------------------------------------------------------------------------------
   Driven by MembershipStatuses.Colour, which holds a name -- green, red, grey -- rather than
   a class. The mapping from name to appearance lives here, so restyling is a stylesheet
   change and recolouring a status is a database change, and neither needs the other.

   Every pair is chosen for contrast against its own background rather than inherited from
   Bootstrap's contextual colours, several of which fail against white at small sizes.
   --------------------------------------------------------------------------------------- */
.status-badge {
  font-weight: 600;
  border: 1px solid transparent;
}

/* Each colour rule below also names the button states, because the pipeline's filter
   toggles wear these classes on a .btn and Bootstrap repaints a button on hover: without
   the extra selectors a red "new" toggle went transparent the moment the mouse reached it. */

.status-green, .btn.status-green:hover, .btn.status-green:focus, .btn.status-green:active { background: #1f7a3d; color: #fff; }
.status-red, .btn.status-red:hover, .btn.status-red:focus, .btn.status-red:active { background: #c0392b; color: #fff; }
.status-amber, .btn.status-amber:hover, .btn.status-amber:focus, .btn.status-amber:active { background: #b06f00; color: #fff; }
.status-blue, .btn.status-blue:hover, .btn.status-blue:focus, .btn.status-blue:active { background: #1f5fa8; color: #fff; }
.status-grey, .btn.status-grey:hover, .btn.status-grey:focus, .btn.status-grey:active { background: #6b7280; color: #fff; }
.status-neutral, .btn.status-neutral:hover, .btn.status-neutral:focus, .btn.status-neutral:active { background: #e4e6ea; color: #2b2f36; border-color: #c9ced6; }

:root[data-mode="dark"] .status-green, :root[data-mode="dark"] .btn.status-green:hover, :root[data-mode="dark"] .btn.status-green:focus, :root[data-mode="dark"] .btn.status-green:active { background: #2e9c53; }
:root[data-mode="dark"] .status-red, :root[data-mode="dark"] .btn.status-red:hover, :root[data-mode="dark"] .btn.status-red:focus, :root[data-mode="dark"] .btn.status-red:active { background: #d75043; }
:root[data-mode="dark"] .status-amber, :root[data-mode="dark"] .btn.status-amber:hover, :root[data-mode="dark"] .btn.status-amber:focus, :root[data-mode="dark"] .btn.status-amber:active { background: #c98a17; }
:root[data-mode="dark"] .status-blue, :root[data-mode="dark"] .btn.status-blue:hover, :root[data-mode="dark"] .btn.status-blue:focus, :root[data-mode="dark"] .btn.status-blue:active { background: #3a7fcc; }
:root[data-mode="dark"] .status-grey, :root[data-mode="dark"] .btn.status-grey:hover, :root[data-mode="dark"] .btn.status-grey:focus, :root[data-mode="dark"] .btn.status-grey:active { background: #7c8794; }
:root[data-mode="dark"] .status-neutral, :root[data-mode="dark"] .btn.status-neutral:hover, :root[data-mode="dark"] .btn.status-neutral:focus, :root[data-mode="dark"] .btn.status-neutral:active { background: #2c3340; color: #dfe3ea; border-color: #3c4553; }

/* The summary boxes on the Statistics tab, tinted to agree with the badges. A wash rather
   than the full colour: a row of saturated boxes competes with the numbers on them. */
.stat-green   { background: #e6f4ea; border-color: #a8d5b8; }
.stat-red     { background: #fdecea; border-color: #f0b8b1; }
.stat-amber   { background: #fdf3e2; border-color: #e8cf9e; }
.stat-blue    { background: #e9f1fb; border-color: #b3ceec; }
.stat-grey    { background: #f1f2f4; border-color: #d3d7dd; }

:root[data-mode="dark"] .stat-green   { background: #16301f; border-color: #2c5c3b; }
:root[data-mode="dark"] .stat-red     { background: #351a17; border-color: #6b332c; }
:root[data-mode="dark"] .stat-amber   { background: #33280f; border-color: #6b5420; }
:root[data-mode="dark"] .stat-blue    { background: #16232f; border-color: #2d4a66; }
:root[data-mode="dark"] .stat-grey    { background: #22262d; border-color: #3a4049; }

/* ---------------------------------------------------------------------------------------
   The membership activity log
   ---------------------------------------------------------------------------------------
   One entry per row wherever the content allows it: the type, the summary, who and when all
   sit on one line, with the body opening underneath only when somebody asks for it. The log
   is scanned far more often than it is read, and a scannable log is a compact one.
   --------------------------------------------------------------------------------------- */
.activity-item {
  padding: .4rem .75rem;
}

.activity-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .25rem .5rem;
}

.activity-summary {
  flex: 1 1 12rem;
  min-width: 0;
  overflow-wrap: anywhere;
}

.activity-meta {
  flex: 0 0 auto;
  display: flex;
  align-items: baseline;
  gap: .5rem;
  white-space: nowrap;
}

.activity-detail {
  white-space: pre-wrap;
  word-break: break-word;
  margin-top: .25rem;
}

/* The disclosure arrow on its own line wastes a row per entry. */
.activity-item details > summary {
  display: inline;
  cursor: pointer;
}

/* ---------------------------------------------------------------------------------------
   Pipeline status toggles
   ---------------------------------------------------------------------------------------
   The tick or cross in front of the label carries the state as well as the colour does, so
   the control still works for a reader who cannot separate the green from the grey.
   --------------------------------------------------------------------------------------- */
.status-toggle { text-transform: none; }

.status-toggle span[aria-hidden] {
  font-weight: 700;
  margin-right: .15rem;
}


/* ---------------------------------------------------------------------------------------
   The orange button
   ---------------------------------------------------------------------------------------
   The club's action colour: #FFCC66 with black text. Used for signing in and for opening a
   module -- the things a person came to the page to do.

   Black text rather than white, and not negotiable: #FFCC66 is a light colour, and white on
   it fails contrast badly enough to be unreadable in sunlight on a phone. Black on it is
   comfortably past the threshold.

   The hover and active shades are darker rather than lighter, so the button still reads as
   pressed on a screen where the ambient light has washed the difference out.
   --------------------------------------------------------------------------------------- */
.btn-orange {
  background-color: #ffcc66;
  border-color: #e6b84d;
  color: #000;
  font-weight: 600;
}

.btn-orange:hover,
.btn-orange:focus {
  background-color: #f5bd47;
  border-color: #d9a733;
  color: #000;
}

.btn-orange:active,
.btn-orange.active {
  background-color: #e6ae38;
  border-color: #c9971f;
  color: #000;
}

.btn-orange:focus-visible {
  outline: 2px solid #7a5a00;
  outline-offset: 2px;
  box-shadow: none;
}

.btn-orange:disabled,
.btn-orange.disabled {
  background-color: #ffe4ab;
  border-color: #ffe4ab;
  color: #6b6b6b;
}

/* Dark mode leaves the fill alone. It is a brand colour and a call to action -- dimming it
   would make the one thing the page wants you to press the quietest thing on it. */

/* ---------------------------------------------------------------------------------------
   Email addresses in the membership pipeline
   ---------------------------------------------------------------------------------------
   Blue, because an address is a thing you act on -- you write to it -- and it should look
   different from the telephone number sitting under it. Not a link: there is nothing to
   click, and styling non-links as links teaches people to distrust the ones that are.
   --------------------------------------------------------------------------------------- */
.email-text {
  color: #1f5fa8;
  word-break: break-word;
}

:root[data-mode="dark"] .email-text { color: #7fb3f0; }

/* ---------------------------------------------------------------------------------------
   The orange button in dark mode
   ---------------------------------------------------------------------------------------
   theme.css carries

       :root[data-mode="dark"] a { color: #8dc2ea; }

   which is more specific than .btn-orange, so every orange button rendered as an anchor --
   which is all of the module buttons -- took pale blue text on an orange ground at night.
   The Sign in button escaped it only because it happens to be a <button>.

   Restated here at a specificity that wins, for the anchors and the buttons alike. The fill
   stays orange in both themes on purpose: it is the brand's call to action, and dimming the
   one thing the page wants pressed would be the wrong kind of dark mode.
   --------------------------------------------------------------------------------------- */
:root[data-mode="dark"] .btn-orange,
:root[data-mode="dark"] a.btn-orange,
:root[data-mode="dark"] .btn-orange:hover,
:root[data-mode="dark"] .btn-orange:focus,
:root[data-mode="dark"] .btn-orange:active {
  color: #000;
}

:root[data-mode="dark"] .btn-orange:hover,
:root[data-mode="dark"] .btn-orange:focus {
  background-color: #f5bd47;
  border-color: #d9a733;
}

/* ---------------------------------------------------------------------------------------
   The Connections Guide, in the Webmail module.

   The shapes here are the ones webmailhelper.md asks for by name -- an orange warning box
   with an exclamation mark, and a small blue box for the port numbers. Kept as classes
   rather than inline styles because the file can grow more of them at any time and they
   should all look the same when it does.
   --------------------------------------------------------------------------------------- */

.guide-body p { margin-bottom: .75rem; }
.guide-body > h3:first-child { margin-top: 0 !important; }

.guide-warning {
    display: flex;
    gap: .6rem;
    align-items: flex-start;
    background: #FFF3CD;
    border: 1px solid #E5C55B;
    border-left-width: 4px;
    border-radius: .375rem;
    color: #000;
    padding: .7rem .85rem;
    margin-bottom: 1rem;
    font-size: .925rem;
}

/* The exclamation mark the file asks for. A circle rather than bare punctuation, so it reads
   as a mark against the box rather than as the first character of the sentence. */
.guide-warning-mark {
    flex: none;
    display: grid;
    place-items: center;
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 50%;
    background: #B8860B;
    color: #fff;
    font-weight: 700;
    font-size: .8rem;
    line-height: 1;
}

/* Small, blue, and inline: the ports arrive as three of these in a row and should sit
   together rather than each claiming a line of its own. */
.guide-note {
    display: inline-block;
    background: #CFE2FF;
    border: 1px solid #9EC5FE;
    border-radius: .375rem;
    color: #052C65;
    padding: .3rem .6rem;
    margin: 0 .4rem .5rem 0;
    font-size: .875rem;
    font-weight: 600;
}

/* A setting and its value. The label is the quiet half: somebody scanning this is looking for
   the server name, not for the words "Incoming mail server". */
.guide-setting {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem 1rem;
    align-items: baseline;
    padding: .45rem 0;
    border-bottom: 1px solid var(--bs-border-color);
}

.guide-setting-label { flex: 1 1 14rem; color: var(--bs-secondary-color); font-size: .9rem; }
.guide-setting-value { flex: 2 1 16rem; font-family: var(--bs-font-monospace); font-size: .925rem; }

/* A value the file described rather than gave -- "[your club email address, for example ...]".
   Deliberately NOT monospace: everything in that column is there to be copied, and a sentence
   dressed as a server name is a sentence somebody will paste into Outlook. */
.guide-setting-example {
    flex: 2 1 16rem;
    font-size: .9rem;
    font-style: italic;
    color: var(--bs-secondary-color);
}

.guide-steps { padding-left: 1.25rem; margin-bottom: 1rem; }
.guide-steps li { margin-bottom: .35rem; }

/* Dark mode. The three boxes keep their own colours -- a warning that changes colour with the
   theme stops being a warning -- but the text on them is pinned dark so it never inherits the
   pale body colour and disappears into its own background. */
:root[data-mode="dark"] .guide-warning,
:root[data-mode="dark"] .guide-warning span,
:root[data-mode="dark"] .guide-note {
    color: #000;
}

:root[data-mode="dark"] .guide-note { color: #052C65; }

/* ---------------------------------------------------------------------------------------
   Move a module up or down, from the corner of its tile on the home page.

   Small and quiet on purpose. These sit next to the module's icon and must not compete with
   it -- they are a thing you go looking for once, when the order is wrong, not part of what
   the tile is telling you.
   --------------------------------------------------------------------------------------- */

.module-move { display: flex; gap: 2px; margin: 0; }

.module-move-btn {
    display: grid;
    place-items: center;
    width: 1.5rem;
    height: 1.5rem;
    padding: 0;
    border: 1px solid var(--bs-border-color);
    border-radius: .25rem;
    background: var(--bs-body-bg);
    color: var(--bs-secondary-color);
    font-size: .6rem;
    line-height: 1;
    cursor: pointer;
    transition: background-color .12s ease, color .12s ease, border-color .12s ease;
}

.module-move-btn:hover:not(:disabled) {
    background: #FFCC66;
    border-color: #E0A93A;
    color: #000;
}

/* Disabled rather than hidden at the ends of the list. An arrow that vanishes moves the other
   one under the pointer, so the second click of two lands on the wrong button. */
.module-move-btn:disabled { opacity: .35; cursor: default; }

/* =========================================================================================
   My Flights
   ========================================================================================= */

/* The From / To airport pickers: a text box with a list under it. The list is positioned
   over whatever follows the box rather than pushing it down, so the form does not jump
   while somebody types. */
.airport-picker {
  position: relative;
}

.airport-picker-list {
  position: absolute;
  z-index: 1050;
  left: 0;
  right: 0;
  top: 100%;
  margin: .15rem 0 0;
  padding: .25rem 0;
  list-style: none;
  max-height: 18rem;
  overflow-y: auto;
  background: var(--bs-body-bg, #fff);
  border: 1px solid var(--bs-border-color, #dee2e6);
  border-radius: .375rem;
  box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .15);
}

.airport-picker-item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .35rem;
  padding: .3rem .75rem;
  cursor: pointer;
  line-height: 1.3;
}

.airport-picker-item:hover,
.airport-picker-item.is-active {
  background: var(--bs-tertiary-bg, #f1f3f5);
}

.airport-picker-code {
  font-family: var(--bs-font-monospace);
  font-weight: 600;
  min-width: 3.2em;
}

.airport-picker-detail {
  flex-basis: 100%;
  font-size: .8em;
  color: var(--bs-secondary-color, #6c757d);
  padding-left: 3.55em;
}

.airport-picker-note {
  padding: .3rem .75rem;
  font-size: .85em;
  color: var(--bs-secondary-color, #6c757d);
}

/* Airline logos from the public logo CDN are 120x40 with whatever background the airline
   uses; a fixed height keeps the rows level and the white box keeps dark logos readable in
   dark mode. */
.airline-logo {
  height: 1.4rem;
  width: auto;
  max-width: 4.5rem;
  vertical-align: middle;
  background: #fff;
  border-radius: .2rem;
  padding: .1rem .2rem;
}

/* The administrator's raw dump: one long JSON document, wrapped so the page never scrolls
   sideways, in a box that scrolls on its own past a screenful. */
.raw-dump {
  max-height: 70vh;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

/* The route map on a flight's page. A fixed height, since Leaflet sizes to its box. */
.route-map {
  height: 26rem;
  background: #1b1b1f;
}

/* Light street tiles turned dark: inverted, hue-rotated back so water stays bluish, and
   dimmed. The tracks are in a separate pane and keep their colours. */
.route-map .leaflet-tile-pane {
  filter: invert(1) hue-rotate(180deg) brightness(.85) contrast(.9) saturate(.6);
}

/* The rule builder's rows are flex lines of small controls; keep them from crowding. */
.rule-builder .form-select-sm,
.rule-builder .form-control-sm {
  min-width: 5rem;
}

/* ---------------------------------------------------------------------------------------
   The filter bar
   ---------------------------------------------------------------------------------------
   An orange band sitting on top of a table, holding the controls that narrow it: a dropdown
   or two and a search box. Settings → APIs uses it. The tally of what survived goes under
   the table, not in the bar -- the bar is for the controls, not for what they did.

   The club's action colour with black text, the same pair as .btn-orange and for the same
   reason -- #FFCC66 is light enough that white on it is unreadable outdoors. It keeps that
   fill in dark mode too, like the orange button: the bar is the handle on the table, and
   dimming it would hide the one control the page is offering.

   The controls inside it are forced back to white on black. They sit on a light ground in
   both themes, so a dark-mode form control inherited from the theme would be a black box on
   an orange bar.
   --------------------------------------------------------------------------------------- */
.filter-bar {
  background-color: #ffcc66;
  border: 1px solid #e6b84d;
  border-bottom: 0;
  border-radius: .375rem .375rem 0 0;
  padding: .5rem .75rem;
  color: #000;
}

.filter-bar-title {
  font-weight: 700;
  color: #000;
  white-space: nowrap;
}

.filter-bar label {
  display: block;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .02em;
  color: #000;
  margin-bottom: .1rem;
}

.filter-bar .form-select,
.filter-bar .form-control {
  background-color: #fff;
  color: #000;
  border-color: #d9a733;
}

.filter-bar .form-select:focus,
.filter-bar .form-control:focus {
  border-color: #7a5a00;
  box-shadow: 0 0 0 .2rem rgba(122, 90, 0, .25);
}

/* The table the bar heads reads as one object with it: square top corners, and no gap. */
.filter-table { margin-bottom: 0; }
.filter-table-wrap {
  border: 1px solid #e6b84d;
  border-top: 0;
  border-radius: 0 0 .375rem .375rem;
}

/* Nothing matched: a line in the table's own body rather than an empty frame. */
.filter-empty td { padding: 1rem; }

/* The flight timeline: a line down the left, a dot per step, and the jobs branching off it. */
.flight-timeline,
.flight-timeline-branches {
    list-style: none;
    margin: 0;
    padding: 0;
}

.flight-timeline-step {
    --timeline-dot: var(--bs-secondary-color);
    position: relative;
    padding: 0 0 1.25rem 1.75rem;
}

.flight-timeline-step:last-child {
    padding-bottom: 0;
}

.flight-timeline-step::before {
    content: "";
    position: absolute;
    left: 0.4rem;
    top: 0.3rem;
    bottom: -0.3rem;
    width: 2px;
    background: var(--bs-border-color);
}

.flight-timeline-step:last-child::before {
    display: none;
}

.flight-timeline-step::after {
    content: "";
    position: absolute;
    left: 0;
    top: 0.25rem;
    width: 0.9rem;
    height: 0.9rem;
    border-radius: 50%;
    border: 2px solid var(--timeline-dot);
    background: var(--bs-body-bg);
}

.flight-timeline-step.is-done,
.flight-timeline-branch.is-done { --timeline-dot: var(--bs-success); }
.flight-timeline-step.is-running,
.flight-timeline-branch.is-running { --timeline-dot: var(--bs-info); }
.flight-timeline-step.is-failed,
.flight-timeline-branch.is-failed { --timeline-dot: var(--bs-danger); }

.flight-timeline-step.is-done::after,
.flight-timeline-step.is-running::after,
.flight-timeline-step.is-failed::after {
    background: var(--timeline-dot);
}

.flight-timeline-step.is-not-recorded::after {
    border-style: dashed;
}

.flight-timeline-branches {
    margin-top: 0.5rem;
    border-left: 2px solid var(--bs-border-color);
}

.flight-timeline-branch {
    --timeline-dot: var(--bs-secondary-color);
    position: relative;
    margin: 0 0 0.5rem 1rem;
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--bs-border-color);
    border-left: 3px solid var(--timeline-dot);
    border-radius: 0.25rem;
}

.flight-timeline-branch:last-child {
    margin-bottom: 0;
}

/* The connector from the line to the job. */
.flight-timeline-branch::before {
    content: "";
    position: absolute;
    left: calc(-1rem - 3px);
    top: 1rem;
    width: 1rem;
    height: 2px;
    background: var(--bs-border-color);
}

.flight-timeline-bar {
    height: 0.3rem;
    margin: 0.3rem 0 0.15rem;
    border-radius: 0.15rem;
    background: var(--bs-success);
}

/* API calls under a job (Pages/Shared/_ApiCalls.cshtml). Colours from the text colour, so any theme reads. */
.api-calls > summary, .api-call > summary { cursor: pointer; }
.api-call { border-left: 3px solid rgba(127, 127, 127, .5); padding-left: .5rem; }
.api-call-body { padding: .25rem 0 .5rem; }
.api-json { white-space: pre-wrap; word-break: break-all; max-height: 22rem; overflow: auto; font-size: .75rem;
            padding: .5rem; border: 1px solid rgba(127, 127, 127, .35); border-radius: .375rem; background: rgba(127, 127, 127, .08); color: inherit; }
