/* vim: set tabstop=2 shiftwidth=2 expandtab smarttab: */

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--gf-font-body);
  font-size: var(--gf-text-base);
  font-weight: var(--gf-weight-normal);
  line-height: var(--gf-lh);
}

b, strong {
  font-weight: 700;
}

header, section, footer, nav {
  display: block;
}

#main-header {
  position: sticky;
  top: 0;
  z-index: 3;
}

#mobile-subheader {
  position: sticky;
  z-index: 2;
  transition: transform var(--gf-transition);
}

#mobile-subheader.mobile-subheader-hidden,
#mobile-subheader.mobile-subheader-locked {
  transform: translateY(-100%);
}

/* Column layout */

.left-column, .middle-column, .right-column {
  /*
   * NOTE: This is sometimes overridden by content with a margin of "-12px -16px" (see table styles)
   * or "padding: 0" (see overrides below for main-content)
   */
  padding: var(--gf-space-3) var(--gf-space-4);
}

.columns-wrap {
  display: flex;
  max-width: 1000px;
  margin: 0 auto;
}

.middle-column {
  flex: 1;
}

.right-column {
  white-space: nowrap;
}

.content-columns, .sticky-header {
  background-color: var(--gf-surface);
}

.header-columns {
  align-items: center;
}

.header-columns .left-column, .header-columns .middle-column, .header-columns .right-column {
  padding-left: var(--gf-space-2);
  padding-right: var(--gf-space-2);
  overflow: hidden;
}

.header-columns > :first-child {
  padding-left: var(--gf-space-4);
}

.header-columns .header-search {
  padding-right: var(--gf-space-4);
}

.header-columns h1, .header-columns h2, .header-columns h3 {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: "..";
  /* Roomier than the tight heading default so the italic wordmark's descenders
     aren't clipped by the overflow:hidden used for horizontal truncation. */
  line-height: 1.3;
}

.header-columns .left-column {
  box-shadow: 0px 0px 8px -1px rgba(0, 0, 0, .2);
  flex-shrink: 0;
}

/* Don't clip the italic wordmark's tail to ".."; its column is sized to fit it. */
.header-columns .left-column h1 {
  overflow: visible;
  text-overflow: clip;
}

.header-columns .header-site-name {
  padding-left: var(--gf-space-4);
  flex: 1 1 auto;
  min-width: 0;
}

/* Wordmark sits below the h1 page-title size so it doesn't truncate beside the
   search box on phones. */
.header-columns .header-site-name h1 {
  font-size: 1.5rem;
}

.header-columns .header-add-expense {
  flex-shrink: 0;
}

.header-columns .header-search {
  flex: 0 0 auto;
  min-width: 0;
}

.header-search label {
  display: flex;
  align-items: center;
  gap: var(--gf-space-1);
}

.header-search input[type=search] {
  width: calc(100vw - 300px);
  box-sizing: border-box;
  transition: width 0.3s ease-in-out, box-shadow var(--gf-transition);
  border: var(--gf-border-width) solid var(--gf-border);
  border-radius: var(--gf-radius-pill);
  background: var(--gf-surface);
  color: var(--gf-text);
  padding: 0.3em 0.8em;
}

/* The teal focus ring is invisible on the teal header; use a light halo. */
.header-search input[type=search]:focus {
  width: calc(100vw - 150px);
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.4);
}

/* really small screens: "g.f" is much shorter than "group.finance" */
@media screen and (max-width: 374px) {
  .header-search input[type=search] {
    width: calc(100vw - 190px);
  }
}

#main-content {
  display: flex;
  flex-direction: column;

  /*
   * Ensures we don't grow wider to support extra wide content when that content could
   * scroll itself instead. The min-width component is needed so we also don't try to
   * push into the sidebar's allotted space either in this situation.
   *
   * We used to get this same effect by setting `overflow: auto` here, but that caused
   * issues for content using sticky positioning.
   */
  max-width: 100%;
  min-width: 0;

  /*
   * override default padding from .middle-column since we want the footer to be flush
   * with the edges of the element (and we can't use negative margins on the footer
   * because it causes weird scrollbars in Safari with flex layouting)
   */
  padding: 0;
}

#main-content section {
  flex: 1;
  padding: var(--gf-space-3) var(--gf-space-4);
}

#main-content footer {
  padding: var(--gf-space-1);
}

a {
  color: var(--gf-link);
  text-decoration: none;
  transition: text-shadow 0.1s;
}

.node.mermaid-link .nodeLabel {
  color: var(--gf-link) !important;
}

button, input[type=submit], input[type=button], input[type=reset] {
  padding: 0.25rem 0.5rem;
}

/* Shared keyboard-focus ring (not shown on mouse/touch). */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible,
.gf-action-btn:focus-visible,
.gf-segmented-option input:focus-visible + span {
  outline: none;
  box-shadow: var(--gf-focus-ring);
}

/* Minimum 16px font size on form inputs prevents iOS Safari from zooming in
   on focus (scoped to iOS via server-side UA detection on <html>) */
.is-ios input:not([type=submit]):not([type=button]):not([type=reset]):not(.font-size-inherit),
.is-ios textarea:not(.font-size-inherit),
.is-ios select:not(.font-size-inherit) {
  font-size: max(1em, 16px);
}

textarea {
  font-family: inherit;
  line-height: inherit;
  font-weight: inherit;
}

/* Shared input/select skin. `input:not([type])` catches type-less inputs; the
   header search opts out via its own higher-specificity rules in `.header-search`. */
input:not([type]),
input[type=text],
input[type=number],
input[type=email],
input[type=password],
input[type=tel],
input[type=url],
input[type=date],
input[type=search],
select,
textarea {
  border: var(--gf-border-width) solid var(--gf-border);
  border-radius: var(--gf-radius-sm);
  background: var(--gf-surface-sunken);
  color: inherit;
  font-family: inherit;
  font-size: inherit;
  padding: 0.4em 0.6em;
  box-sizing: border-box;
}

input[type=checkbox],
input[type=radio] {
  accent-color: var(--gf-accent);
  width: 1.05rem;
  height: 1.05rem;
}

h1, h2, h3, h4 {
  margin: 0.75em 0 0.5em;
  padding: 0;
}

/* Chrome headings opt out (nav opts out via its own #main-nav rules). */
.header-columns h1, .header-columns h2, .header-columns h3, .header-columns h4,
footer h1, footer h2, footer h3, footer h4 {
  margin: 0;
}

/* Headings use the webfont; h4 stays on the body stack as emphasized body. */
h1, h2, h3 {
  font-family: var(--gf-font-heading);
  font-weight: var(--gf-weight-bold);
  line-height: var(--gf-lh-tight);
  letter-spacing: var(--gf-tracking-tight);
}

h1 a, h2 a, h3 a, nav a, footer a {
  color: inherit;
  text-decoration: none;
}

h1 a:hover, h2 a:hover, h3 a:hover, nav a:hover, footer a:hover {
  text-decoration: underline;
}

h1 {
  font-size: var(--gf-text-xl);
}

h2 {
  font-size: var(--gf-text-lg);
}

section h3, section h4 {
  margin-top: var(--gf-space-3);
}

h3 {
  font-size: var(--gf-text-md);
}

h4 {
  font-size: var(--gf-text-base);
  font-weight: var(--gf-weight-bold);
}

hr {
  border: 0;
  border-top: 1px solid var(--gf-border);
}

.full-width, table.full-width {
  width: 100%;
  box-sizing: border-box;
}

input[type=range].full-width {
  width: 100%;
  box-sizing: border-box;
  margin: 0;
}

.gf-truncated {
  display: inline-block;
  vertical-align: middle;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: "..";
  /* You should specify your own max-width when using this, and probably a title="" too */
}

.subtag {
  font-variant: small-caps;
  cursor: default;
  display: inline-block;
  padding: 2px 3px;
  font-size: 80%;
  border-radius: var(--gf-radius-sm);
  margin: 0 2px;
  vertical-align: middle;
}

.subtag code {
  font-variant: normal;
}

/* Tables */

div.wide-table-container {
  overflow-x: auto;
  margin: var(--gf-space-3) calc(-1 * var(--gf-space-4));
  width: calc(100% + 32px);
}

/* -12px to cancel section padding; replaces the 10px margin from above */
#main-content section > div.wide-table-container:first-child,
#main-content section > style:first-child + div.wide-table-container,
#main-content section > script:first-child + div.wide-table-container {
  margin-top: calc(-1 * var(--gf-space-3));
}

#main-content section > div.wide-table-container:last-child {
  margin-bottom: calc(-1 * var(--gf-space-3));
}

table {
  width: 100%;
  margin: var(--gf-space-3) auto;
  border-collapse: collapse;
}

table.wide-table {
  margin: 0;
  width: 100%;
}

th {
  color: var(--gf-text-strong);
}

th, td {
  text-align: left;
  padding: var(--gf-space-2) var(--gf-space-3);
  border-bottom-width: 1px;
  border-bottom-style: solid;
  border-color: var(--gf-border);
}

tr.new-section > th, tr.new-section > td {
  border-top-width: 4px;
  border-top-style: solid;
}

tfoot th, tfoot td {
  border-bottom-style: none;
  vertical-align: top;
}

tr.double-row-top > td {
  border-bottom-style: none;
}
tr.double-row-middle > td {
  border-top-style: none;
  border-bottom-style: none;
  padding-left: var(--gf-space-5);
}
tr.double-row-bottom > td {
  border-top-style: none;
  padding-left: var(--gf-space-5);
}

table.tight-double-rows tr.double-row-top > td {
  padding-bottom: 0;
}
table.tight-double-rows tr.double-row-middle > td {
  padding-top: 0;
  padding-bottom: 0;
}
table.tight-double-rows tr.double-row-bottom > td {
  padding-top: 0;
}

table.noborder th, table.noborder td {
  border-bottom-style: none;
}

tr.highlighted > td, tr.highlighted > th,
.highlighted-evens > tr:nth-child(even) > td,
.highlighted-evens > tr:nth-child(even) > th,
.highlighted-odds > tr:nth-child(odd) > td,
.highlighted-odds > tr:nth-child(odd) > th
{
  background-color: var(--gf-accent-subtle);
}

td.slightly-highlighted {
  background-color: var(--gf-accent-subtle);
}

th.bordered, td.bordered {
  border-style: solid !important;
}

table.little, table.little table {
  margin: 0;
  width: auto;
}

table.little th, table.little td {
  padding: 2px;
  border-bottom-style: none;
}

.unseen-on-load {
  font-weight: bold;
}

.money-green {
  color: var(--money-green);
}

.money-red {
  color: var(--money-red);
}

.money-grey {
  color: var(--money-grey);
}

.money-orange {
  color: var(--money-orange);
}

.money-black {
  color: var(--gf-text-strong);
}

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

.text-muted-more {
  color: var(--gf-text-subtle);
}

.dotted-underline {
  text-decoration: underline;
  text-decoration-style: dotted;
  -webkit-text-decoration-style: dotted;
}

.only-emojis {
  text-underline-offset: 0.2em;
  font-size: 200%;
}

.serif-plz {
  font-family: "Times New Roman", times, serif;
}

.arrow-container {
  display: inline-block;
  min-width: 0.8em;
  text-align: center;
}

.info-box {
  border-left: 3px solid var(--gf-accent);
  background: var(--gf-accent-subtle);
  padding: 0.4em 0.8em;
  margin: 0.6em 0;
  font-size: 90%;
}

/* Generic clickable banner for surfacing an alert or ongoing event at the
 * top of a content page. Styled as a link. */
a.gf-banner {
  display: block;
  padding: 0.7em 1em;
  margin: 0 0 1em 0;
  border-radius: var(--gf-radius-sm);
  border-left: 3px solid var(--gf-accent);
  background: var(--gf-accent-subtle);
  color: var(--gf-text);
  text-decoration: none;
  font-weight: 500;
}

a.gf-banner:hover {
  background: var(--gf-accent-subtle-hover);
  text-decoration: none;
}

.gf-banner .gf-banner-label {
  font-weight: 700;
  margin-right: 0.3em;
}

.gf-banner i.fas {
  margin-left: 0.4em;
  font-size: 85%;
}

/* Stat card: a centered, highlighted container used to emphasize key
 * numeric values. */
.gf-stat-card {
  border-radius: var(--gf-radius-lg);
  padding: var(--gf-space-5) var(--gf-space-4);
  margin: var(--gf-space-4) 0;
  text-align: center;
  background: var(--gf-accent-subtle);
  color: var(--gf-text);
}
.gf-stat-card-row {
  display: flex;
  justify-content: space-around;
  gap: var(--gf-space-5);
}
.gf-stat-card-stat {
  flex: 1;
  min-width: 0;
  /* Column with an even gap, so each page can order label and value either way. */
  display: flex;
  flex-direction: column;
  gap: var(--gf-space-1);
}
.gf-stat-card-value {
  /* clamp() keeps a three-across row from overflowing on phones. */
  font-size: clamp(1.75rem, 6vw, 2.25rem);
  font-family: var(--gf-font-heading);
  font-weight: var(--gf-weight-bold);
  line-height: var(--gf-lh-tight);
  word-break: break-word;
}
.gf-stat-card-label {
  font-size: var(--gf-text-sm);
  text-transform: uppercase;
  letter-spacing: var(--gf-tracking-caps);
  opacity: 0.7;
}
.gf-stat-card-note {
  font-size: var(--gf-text-sm);
  color: var(--gf-text-muted);
}

/* Subtle card treatment so multiple cards in a row aren't visually noisy. */
.gf-card {
  padding: var(--gf-space-3) var(--gf-space-4);
  margin: 0.6em 0;
  border-radius: var(--gf-radius-md);
  background: var(--gf-surface-card);
}
.gf-card > *:first-child {
  margin-top: 0;
}
.gf-card > *:last-child {
  margin-bottom: 0;
}
/* Modifier for a .gf-card that's a clickable link: chevron on the right
   plus a hover/focus tint so the click target reads as navigable. */
.gf-card-link {
  display: flex;
  align-items: center;
  gap: var(--gf-space-3);
  text-decoration: none;
  color: inherit;
  transition: background 0.1s ease;
}
.gf-card-link:hover,
.gf-card-link:focus {
  background: color-mix(in srgb, var(--gf-text) 8%, var(--gf-surface-card));
  text-decoration: none;
}
.gf-tint-blue.gf-card-link:hover,
.gf-tint-blue.gf-card-link:focus {
  background: var(--gf-info-emphasis);
}
.gf-card-link-body {
  flex: 1 1 auto;
  min-width: 0;
}
.gf-card-link-chevron {
  flex: 0 0 auto;
  opacity: 0.5;
  font-size: 90%;
}
.gf-card-link:hover .gf-card-link-chevron,
.gf-card-link:focus .gf-card-link-chevron {
  opacity: 0.85;
}

/* Card-row: a .gf-card laid out as body [meta?] [actions?] [chevron?] for
   entity lists. Unlike .gf-card-link (the whole card is one <a>), a row can
   hold its own interactive control via the stretched-link variant below. */
.gf-card-row {
  display: flex;
  align-items: center;
  gap: var(--gf-space-3);
  position: relative;
}
.gf-card-row-body {
  flex: 1 1 auto;
  min-width: 0;
}
.gf-card-row-title {
  font-weight: var(--gf-weight-bold);
}
.gf-card-row-sub {
  font-size: var(--gf-text-sm);
  color: var(--gf-text-muted);
  font-style: italic;
}
.gf-card-row-meta {
  flex: 0 0 auto;
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: var(--gf-space-1);
  white-space: nowrap;
}
.gf-card-row-date {
  font-size: var(--gf-text-sm);
  color: var(--gf-text-muted);
}
.gf-card-row-total {
  font-size: var(--gf-text-sm);
  color: var(--gf-text-muted);
}
.gf-card-row-actions {
  flex: 0 0 auto;
  position: relative;
  z-index: 1;
}
.gf-card-row-chevron {
  flex: 0 0 auto;
  opacity: 0.5;
  font-size: 90%;
}

/* Stretched-link variant: the primary link covers the whole card via an
   ::after overlay; .gf-card-row-actions sit above it (z-index) so an inner
   button stays independently clickable. */
.gf-card-row-link {
  text-decoration: none;
  color: inherit;
}
.gf-card-row-link::after {
  content: "";
  position: absolute;
  inset: 0;
}
.gf-card-row:has(.gf-card-row-link:hover),
.gf-card-row:has(.gf-card-row-link:focus-visible) {
  background: color-mix(in srgb, var(--gf-text) 8%, var(--gf-surface-card));
}
.gf-card-row:has(.gf-card-row-link:hover) .gf-card-row-chevron,
.gf-card-row:has(.gf-card-row-link:focus-visible) .gf-card-row-chevron {
  opacity: 0.85;
}

/* Unseen / needs-attention state (replaces yellow-highlighted for cards).
   Inset shadow keeps the accent bar from shifting content under border-box. */
.gf-card-unseen {
  box-shadow: inset 3px 0 0 var(--gf-accent);
  background: var(--gf-accent-subtle);
}

/* Sort/filter control row above a card list. */
.gf-list-sort {
  margin: var(--gf-space-3) 0;
  font-size: var(--gf-text-sm);
}

/* my-tabs people-section heading above each card list. */
.gf-tab-section-title {
  margin-bottom: var(--gf-space-2);
}

/* Color tints: status-token background + border accent for cards,
   banners, status callouts, etc.  Pair with .gf-card or use standalone. */
.gf-tint-red {
  background: var(--gf-danger-subtle);
  border-color: var(--gf-danger-border);
}
.gf-tint-red-subtle {
  background: var(--gf-danger-subtle);
}
.gf-tint-green {
  background: var(--gf-success-subtle);
  border-color: var(--gf-success-border);
}
.gf-tint-blue {
  background: var(--gf-info-subtle);
  border-color: var(--gf-info-border);
}

/* Labeled form field with stacked label / input / hint. Scoped via a
   wrapping class so it doesn't bleed into existing forms. */
.gf-field {
  margin: 0.75em 0;
}
.gf-field > label {
  display: block;
  font-size: 95%;
  margin-bottom: 0.25em;
}
.gf-field-hint {
  margin: 0.25em 0 0 0;
  font-size: var(--gf-text-xs);
}
.gf-field input:not([type]),
.gf-field input[type=text],
.gf-field input[type=number],
.gf-field input[type=email],
.gf-field input[type=password],
.gf-field input[type=tel],
.gf-field input[type=url],
.gf-field input[type=date],
.gf-field select {
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.gf-input-with-affix {
  display: flex;
  align-items: stretch;
  gap: 0.25em;
}
.gf-field .gf-input-with-affix input {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
}

/* Money input: currency-symbol prefix affix visually fused with the number input. */
.gf-money-input {
  display: inline-flex;
  align-items: stretch;
  border: var(--gf-border-width) solid var(--gf-border);
  border-radius: var(--gf-radius-sm);
  overflow: hidden;
  max-width: 10em;
  background: var(--gf-surface-sunken);
}
.gf-money-input-prefix {
  padding: 0 0.6em;
  display: flex;
  align-items: center;
  background: var(--gf-surface-sunken);
  border-right: var(--gf-border-width) solid var(--gf-border);
  font-weight: 600;
  user-select: none;
}
.gf-money-input input {
  border: none;
  background: transparent;
  /* Match the shared input skin's padding so the pill is the same height. */
  padding: 0.4em 0.6em;
  flex: 1 1 0;
  min-width: 0;
  width: auto;
  color: inherit;
  font-family: inherit;
  font-size: inherit;
}
/* Wrapper shows the ring via :focus-within; suppress the inner input's own. */
.gf-money-input input:focus,
.gf-money-input input:focus-visible {
  outline: none;
  box-shadow: none;
}
.gf-money-input:focus-within {
  box-shadow: var(--gf-focus-ring);
}

.gf-radio-stack label {
  display: inline-block;
  margin-right: 1em;
}
@media screen and (max-width: 699px) {
  .gf-radio-stack label {
    display: block;
    margin: 0.25em 0;
  }
}

/* Flex-based result list (search results, member lists, etc.) */

.gf-result-list {
  list-style: none;
  margin: 0 0 0 1em;
  padding: 0;
  max-width: 500px;
}

.gf-result-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--gf-space-2);
  padding: var(--gf-space-2) 0;
}

.gf-result-item-main {
  min-width: 0;
}

.gf-result-item-side {
  flex-shrink: 0;
  text-align: right;
  white-space: nowrap;
}

.gf-result-divider {
  margin: var(--gf-space-1) 0;
  opacity: 0.4;
}

.gf-result-heading {
  margin: 0.8em 0 0.3em;
  font-size: 1.05em;
  font-weight: bold;
}

.gf-search-summary {
  margin: 0 0 0.5em;
  font-size: 0.95em;
}

.gf-empty-state {
  text-align: center;
  padding: 2em 1em;
}

.gf-notice {
  text-align: center;
  padding: var(--gf-space-3) var(--gf-space-4);
  margin-bottom: var(--gf-space-4);
  border: var(--gf-border-width) solid var(--gf-border);
  border-radius: var(--gf-radius-md);
  background: var(--gf-surface-sunken);
  color: var(--gf-text-muted);
}

.gf-showmore-link {
  display: block;
  padding: var(--gf-space-1) 0;
  font-size: 0.9em;
  cursor: pointer;
}

.gf-showmore-hidden {
  display: none;
}

.listing-page-header-line {
  font-size: 90%;
}

.listing-page-details-block {
  font-size: 90%;
}

.listing-page-status-update {
  font-size: 90%;
  font-style: italic;
  max-width: 75%;
  margin-left: auto;
  margin-right: auto;
}

.listing-page-timestamp-line {
  font-size: 80%;
  font-style: italic;
}

/* Footer */

footer {
  padding: var(--gf-space-1);
}

footer p, footer ul {
  margin: var(--gf-space-1);
  padding: 0;
  text-align: center;
}

footer ul {
  list-style-type: none;
}

footer ul > li {
  display: inline;
}

footer ul > li::before {
  content: "\0020 \00B7 \0020";
  font-size: inherit;
  padding: 0 2px;
}

footer ul > li:first-child::before {
  content: none;
}

.transition-background, .transition-background > * {
  transition: background-color 1.5s;
}

.desktop {
  display: none;
}

.screen-really-small {
  display: none;
}

/* large screens (desktop) */
/* This same width threshold is also used in nav.css and themes/*.css */
@media print, screen and (min-width: 700px) {
  .desktop {
    display: revert;
  }

  .mobile {
    display: none;
  }

  body.wide-mode .columns-wrap {
    max-width: calc(100vw - 80px);
  }

  .left-column {
    width: 218px;
  }

  .content-columns {
    min-height: calc(100vh - var(--header-height, 56px));
  }

  .content-columns .left-column {
    padding-top: 0;
    padding-bottom: 0;
  }

  .content-columns .left-column, .content-columns .middle-column {
    box-shadow: 2px 2px 4px -1px rgba(0, 0, 0, 0.2);
  }

  .header-columns .left-column, .header-columns .middle-column, .header-columns .right-column {
    padding-left: var(--gf-space-4);
    padding-right: var(--gf-space-4);
  }

  .header-columns .header-search {
    flex: 0 0 auto;
  }

  .header-search input[type=search] {
    width: clamp(10em, calc(100vw - 500px), 20em);
  }

  .header-search input[type=search]:focus {
    width: clamp(15em, calc(100vw - 400px), 30em);
  }

  table {
    margin: var(--gf-space-3) auto;
    width: auto;
  }

  table:not(.little) {
    min-width: 435px;
  }
}

.gf-inline-btn {
  background: none;
  border: none;
  opacity: 0.5;
  cursor: pointer;
  padding: 0 var(--gf-space-1);
  font-size: inherit;
  vertical-align: middle;
  color: inherit;
}

.gf-inline-btn:hover:not(:disabled) {
  opacity: 1;
}

.gf-inline-btn:disabled {
  opacity: 0.2;
  cursor: default;
}

/* Action bar */

.gf-action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gf-space-2);
  justify-content: center;
  margin: var(--gf-space-3) 0 var(--gf-space-5);
}

.gf-action-bar > form {
  display: contents;
}

.gf-action-btn {
  display: inline-flex;
  align-items: center;
  line-height: normal;
  gap: var(--gf-space-2);
  padding: var(--gf-space-2) var(--gf-space-4);
  border: 1px solid var(--gf-accent);
  border-radius: var(--gf-radius-md);
  background-color: var(--gf-accent);
  color: var(--gf-accent-contrast);
  font-size: 0.95em;
  cursor: pointer;
  transition: opacity var(--gf-transition);
  font-family: inherit;
  text-shadow: none;
}

.gf-action-btn:hover {
  opacity: 0.85;
}

.gf-action-btn:active {
  opacity: 0.7;
}

.gf-action-btn.pressed {
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
  opacity: 0.85;
}

/* Muted surface + readable text, rather than 50% opacity (which read as
   near-invisible on the teal-on-dark CTA). */
.gf-action-btn:disabled {
  opacity: 1;
  background-color: var(--gf-surface-sunken);
  color: var(--gf-text-muted);
  border-color: var(--gf-border);
  cursor: not-allowed;
}

.gf-action-btn:disabled:hover,
.gf-action-btn:disabled:active {
  opacity: 1;
  background-color: var(--gf-surface-sunken);
}

.gf-action-btn-secondary {
  background-color: var(--gf-accent-subtle);
  color: var(--gf-text);
}

.gf-action-btn-secondary:hover {
  background-color: var(--gf-accent-subtle-hover);
}

.gf-action-btn-sm {
  padding: var(--gf-space-1) var(--gf-space-3);
  font-size: 0.85em;
}

.gf-action-bar-flush {
  margin: 0;
}

.gf-action-bar-left {
  justify-content: flex-start;
}

.gf-action-bar-right {
  justify-content: flex-end;
}

.gf-action-bar-sticky-container {
  position: sticky;
  bottom: 0;
  padding: var(--gf-space-3) var(--gf-space-4) var(--gf-space-4);
  margin: 0 calc(-1 * var(--gf-space-4)) calc(-1 * var(--gf-space-3));
  background-color: var(--gf-surface);
  border-top: 1px solid var(--gf-divider);
  z-index: 1;
}

/* Overflow menu */

.gf-overflow-menu-wrapper {
  position: relative;
  display: inline-flex;
}

.gf-overflow-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 15;
  min-width: 220px;
  border: 1px solid var(--gf-border);
  border-radius: var(--gf-radius-sm);
  background-color: var(--gf-surface-raised);
  box-shadow: var(--gf-shadow-2);
  overflow: hidden;
}

.gf-overflow-menu-open {
  display: block;
}

.gf-overflow-menu-item,
a.gf-overflow-menu-item,
a.gf-overflow-menu-item:hover {
  display: flex;
  align-items: center;
  gap: var(--gf-space-2);
  padding: var(--gf-space-3) var(--gf-space-4);
  width: 100%;
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.95em;
  color: inherit;
  text-align: left;
  text-decoration: none;
  text-shadow: none;
  box-sizing: border-box;
}

.gf-overflow-menu-item-icon {
  width: 1.2em;
  text-align: center;
  flex-shrink: 0;
}

.gf-overflow-menu-item-text {
  flex: 1;
}

.gf-overflow-menu-item-subtitle {
  font-size: 0.85em;
  opacity: 0.7;
}

.gf-overflow-menu-item-static {
  cursor: default;
}

.gf-overflow-menu-divider {
  margin: var(--gf-space-1) 0;
  border: none;
  border-top-width: 1px;
  border-top-style: solid;
  border-top-color: var(--gf-border);
}

/* Overflow menu: mobile bottom sheet */

.gf-overflow-menu-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 14;
  background: var(--gf-overlay);
}

.gf-overflow-menu-backdrop-visible {
  display: block;
}

/* Segmented control */

.gf-segmented-control {
  display: flex;
}

.gf-segmented-option {
  flex: 1;
  cursor: pointer;
}

.gf-segmented-option:has(input:disabled) {
  cursor: default;
  opacity: 0.5;
  pointer-events: none;
}

.gf-segmented-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.gf-segmented-option span {
  display: block;
  text-align: center;
  padding: var(--gf-space-2) 2px;
  border: 1.5px solid;
  font-size: 0.78em;
  line-height: 1.3;
  transition: background-color var(--gf-transition), color var(--gf-transition), border-color var(--gf-transition);
}

.gf-segmented-option span i {
  font-size: 1.2em;
  display: block;
  margin-bottom: -1px;
}

.gf-segmented-option:first-child span {
  border-radius: var(--gf-radius-sm) 0 0 var(--gf-radius-sm);
}

.gf-segmented-option:last-child span {
  border-radius: 0 var(--gf-radius-sm) var(--gf-radius-sm) 0;
}

.gf-segmented-option:not(:first-child) span {
  border-left-width: 0;
}

.gf-segmented-option input:checked + span {
  background-color: var(--gf-accent);
  color: var(--gf-accent-contrast);
  border-color: var(--gf-accent);
}

.gf-segmented-option input:not(:checked) + span {
  background-color: var(--gf-accent-subtle);
  color: var(--gf-text);
  border-color: var(--gf-accent);
}

.gf-segmented-option input:not(:checked) + span:hover {
  background-color: var(--gf-accent-subtle-hover);
}

@media screen and (min-width: 700px) {
  .gf-segmented-option span {
    padding: var(--gf-space-3) var(--gf-space-1);
    font-size: 0.85em;
  }
}

/* Segmented control: compact variant */

.gf-segmented-control-sm {
  display: inline-flex;
}

.gf-segmented-control-sm .gf-segmented-option {
  flex: initial;
}

.gf-segmented-control-sm .gf-segmented-option span {
  padding: var(--gf-space-1) var(--gf-space-3);
  font-size: 0.82em;
}

.gf-segmented-control-sm .gf-segmented-option:first-child span {
  border-radius: var(--gf-radius-sm) 0 0 var(--gf-radius-sm);
}

.gf-segmented-control-sm .gf-segmented-option:last-child span {
  border-radius: 0 var(--gf-radius-sm) var(--gf-radius-sm) 0;
}

@media screen and (min-width: 700px) {
  .gf-segmented-control-sm .gf-segmented-option span {
    padding: var(--gf-space-1) var(--gf-space-4);
    font-size: 0.88em;
  }
}

/* Infinite scroll spinner */
.gf-lazyload-spinner {
  display: inline-block;
  padding: var(--gf-space-3);
  font-size: 1.2em;
  color: var(--gf-text-subtle);
}

/* Back-to-top button */
.back-to-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 5;
  width: 40px;
  height: 40px;
  border: 1px solid var(--gf-border);
  border-radius: 50%;
  background-color: var(--gf-surface-raised);
  color: var(--gf-text);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
}

/* small screens (mobile): action bar + overflow menu */
@media screen and (max-width: 699px) {
  .gf-action-bar {
    flex-wrap: wrap;
    flex-direction: row;
  }

  .gf-action-btn {
    justify-content: center;
  }

  :where(.gf-action-bar) .gf-action-btn:not(.gf-action-btn-secondary) {
    flex: 1 0 100%;
  }

  .gf-action-bar:not(:has(> .gf-action-btn-secondary)) .gf-action-btn:not(.gf-action-btn-secondary) {
    flex: 1 0 auto;
  }

  .gf-action-bar-compact .gf-action-btn {
    flex: 1 1 0;
    white-space: nowrap;
  }

  :where(.gf-action-bar) .gf-action-btn-secondary {
    flex: 1 1 auto;
  }

  .gf-action-bar-right .gf-action-btn {
    flex: none;
  }

  .gf-overflow-menu-wrapper {
    flex: 0 0 auto;
  }

  .gf-overflow-menu {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    border-radius: var(--gf-radius-md) var(--gf-radius-md) 0 0;
    min-width: 0;
    z-index: 15;
    padding: var(--gf-space-3) 0;
  }

  .gf-overflow-menu-item {
    padding: var(--gf-space-4);
  }

  .gf-overflow-menu-divider {
    margin: var(--gf-space-2) 0;
  }
}

/* really small screens */
@media screen and (max-width: 374px) {
  .screen-really-small {
    display: revert;
  }

  .screen-reasonably-sized {
    display: none;
  }
}

