
/* ==== Global element defaults ==== */
svg {
  vertical-align: -0.1em;
}

html,
body {
  overscroll-behavior-x: none;
}

/* ==== Layout and colour tokens ==== */
:root {
  --width-normal: 1600px;
  --gutter:       1rem;

  --page-title-size:        clamp(1.35rem, 1.1rem + 1vw, 1.75rem);
  --page-title-weight:      700;
  --page-title-tracking:    -0.01em;
  --page-title-line-height: 1.2;
  --page-meta-size:         0.95rem;
  --page-head-pad-top:      0.7rem;
  --page-head-pad-bottom:   0.45rem;
  --page-fade:              1.5rem;
  --section-title-size:     1.25rem;
  --section-title-weight:   700;
  --subsection-title-size:  1rem;
  --subsection-title-weight: 700;

  --app-selected-bg: rgba(var(--bs-primary-rgb), 0.1);
  --app-selected-outline: var(--bs-primary);
}

:root,
[data-bs-theme="light"] {
  --subtle-btn-bg:       #f2f2f3; 
  --subtle-btn-hover-bg: #e6e6e8; 
}
[data-bs-theme="dark"] {
  --subtle-btn-bg:       #1f2225; 
  --subtle-btn-hover-bg: #2a2e33; 
}

[data-bs-theme="light"] {
  --bs-info-text-emphasis:  #41464b;
  --bs-info-bg-subtle:      #f1f3f5;
  --bs-info-border-subtle:  #d8dde1;
  --bs-info:                #747c84;
}
[data-bs-theme="dark"] {
  --bs-info-text-emphasis:  #c7cbd0;
  --bs-info-bg-subtle:      #292d31;
  --bs-info-border-subtle:  #464b50;
  --bs-info:                #9ba2a9;
}

/* ==== No-cover placeholder ==== */
.no-cover-svg {
  --nc-bg: transparent; 
  --nc-border: #ddd8d0;
  --nc-icon: #b3aca1;
  --nc-text: #8f887c;
}

/* ==== Readable greys in dark mode ==== */
[data-bs-theme="dark"] .text-secondary {
  color: var(--bs-secondary-color) !important;
}
[data-bs-theme="dark"] .btn-outline-secondary {
  --bs-btn-color: #adb5bd;
  --bs-btn-disabled-color: #8f969c;
}

[data-bs-theme="dark"] .no-cover-svg {
  --nc-bg: transparent; 
  --nc-border: #34373b;
  --nc-icon: #5c626a;
  --nc-text: #838a92;
}

.no-cover-svg .nc-panel { fill: var(--nc-bg); stroke: var(--nc-border); stroke-width: 1.5; }
.no-cover-svg .nc-brand { fill: var(--nc-icon); }
.no-cover-svg .nc-text  {
  fill: var(--nc-text);
  font-weight: 600;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ==== Reading-status colours ==== */
:root,
[data-bs-theme="light"] {
  --rs-reading-bg:     #dbeafd;
  --rs-reading-text:   #1a4c86;
  --rs-read-bg:        #d7f2e8;
  --rs-read-text:      #0f6b4c;
  --rs-abandoned-bg:   #fbdfdf;
  --rs-abandoned-text: #932424;
  --rs-future-bg:      #fbe9c4;
  --rs-future-text:    #7a5300;
  --rs-unread-bg:      #ece9e3;
  --rs-unread-text:    #57544c;
}
[data-bs-theme="dark"] {
  --rs-reading-bg:     #16283d;
  --rs-reading-text:   #8ec2f7;
  --rs-read-bg:        #113329;
  --rs-read-text:      #7fdab7;
  --rs-abandoned-bg:   #3b1818;
  --rs-abandoned-text: #f3a4a3;
  --rs-future-bg:      #3a2c0b;
  --rs-future-text:    #f0c775;
  --rs-unread-bg:      #47443c;
  --rs-unread-text:    #c9c6bc;
}

/* ==== Gold ==== */
:root {
  --gold:      #c99a00;
  --gold-tint: rgba(201, 154, 0, 0.12);
}

/* ==== Filter bubbles ==== */
.badge.filter-bubble--reading {
  padding: 0;
  overflow: hidden; 
}
.filter-bubble .filter-seg {
  padding: 0.1rem 0.7rem calc(0.1rem + 1.5px);
  background: var(--bs-secondary-bg);
  color: var(--bs-body-color);
}
.filter-bubble .filter-seg--reading   { background: var(--rs-reading-bg);   color: var(--rs-reading-text); }
.filter-bubble .filter-seg--read      { background: var(--rs-read-bg);      color: var(--rs-read-text); }
.filter-bubble .filter-seg--abandoned { background: var(--rs-abandoned-bg); color: var(--rs-abandoned-text); }
.filter-bubble .filter-seg--future    { background: var(--rs-future-bg);    color: var(--rs-future-text); }
.filter-bubble .filter-seg--unread    { background: var(--rs-unread-bg);    color: var(--rs-unread-text); }

.badge.filter-bubble--gold {
  background: var(--gold-tint);
}
.filter-bubble--gold .badge-filter-word {
  color: var(--gold);
}

.filter-bubbles-container .badge {
  display: inline-flex;
  align-items: center;
  height: 1.4rem;
  margin-top: 0;
  padding: 0 0.7rem;
  border-radius: 999px;
  line-height: 1;
  color: var(--bs-body-color);
  background-color: var(--bs-secondary-bg);
  vertical-align: middle;
}
.filter-bubbles-container .badge.filter-bubble--gold {
  background-color: var(--gold-tint);
}
.filter-bubbles-container .badge.filter-bubble--reading {
  padding: 0;
}
.filter-bubbles-container .badge-filter-word {
  display: inline-flex;
  align-items: center;
  height: 100%;
  padding-bottom: 0;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1;
}
.filter-bubbles-container .filter-seg {
  padding: 0 0.7rem;
}
.filter-bubbles-container .badge:has(.bubble-remove) {
  padding-right: 0.2rem;
}
.bubble-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.1rem;
  height: 1.1rem;
  margin-left: 0.25rem;
  border-radius: 50%;
  color: var(--bs-body-color);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  opacity: 0.7;
}
.bubble-remove:hover,
.bubble-remove:focus-visible {
  opacity: 1;
  background: rgba(127, 127, 127, 0.22);
  color: var(--bs-body-color);
}
.filter-bubble--gold .bubble-remove {
  color: var(--gold);
}

/* ==== Sort indicator ==== */
.sort-arrow {
  flex-shrink: 0;
}
.sort-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  opacity: 0.55;
}
.sort-icon svg { width: 14px; height: 14px; }
.mob-col-header.mob-col-sorted {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  white-space: nowrap;
}
/* ==== Square icon buttons ==== */
.square-btn {
  width: 35px;
  min-width: 35px;
  height: 35px;
  min-height: 35px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.square-btn .btn-icon {
  width: 100%;
  height: 100%;
}

/* ==== Facet controls ==== */
.facet-group {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: 0.25rem;
  flex-shrink: 0; 
}
.facet-tip {
  display: inline-flex; 
}
.facet-btn svg {
  width: 1.15rem;
  height: 1.15rem;
  flex-shrink: 0;
}
.facet-btn-label {
  display: none;
}
@media (min-width: 1200px) {
  .facet-btn.square-btn {
    width: auto;
    padding-inline: 0.6rem;
    gap: 0.35rem;
  }
  .facet-btn-label {
    display: inline;
  }
}

.filter-box {
  position: relative;
  flex: 0 1 220px;
  min-width: 130px;
}
.filter-box .form-control {
  padding-right: 2.2rem;
}
.filter-box-submit {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 2.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--bs-secondary-color);
}
.filter-box-submit:hover,
.filter-box-submit:focus-visible {
  color: var(--brand-accent);
}
.filter-box-submit svg {
  width: 1.05rem;
  height: 1.05rem;
}
.facet-btn.is-applied {
  background: var(--bs-secondary-bg);
  color: var(--gold);
  border-color: var(--gold);
}
.facet-btn.is-applied svg {
  fill: currentColor;
}

.facet-menu {
  min-width: 13rem;
  font-size: 0.875rem;
}
.facet-menu--form {
  padding: 0.5rem 0.75rem;
}
.facet-option {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
}
.facet-option-label {
  flex: 1 1 auto;
  white-space: nowrap;
}
.facet-count {
  margin-left: auto;
  color: var(--bs-secondary-color);
  font-variant-numeric: tabular-nums;
}
.facet-btn.is-empty,
.facet-menu .is-empty {
  color: var(--bs-secondary-color);
}
.facet-btn--reading.is-applied {
  background: var(--facet-bg, var(--gold-tint));
  color: var(--facet-fg, var(--gold));
  border-color: var(--facet-fg, var(--gold));
}
.facet-btn--reading.is-applied svg {
  fill: none;
  stroke-width: 2.4;
}
.facet-menu .dropdown-item.is-selected {
  background: var(--bs-secondary-bg);
  font-weight: 600;
}
.facet-menu .form-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.075rem 0; 
  margin-bottom: 0;
}
.facet-menu .form-check-input {
  float: none;
  margin: 0;
  flex-shrink: 0;
}
.facet-stars {
  letter-spacing: 1px;
  line-height: 1;
}
.facet-stars .star-full  { color: var(--gold); }
.facet-stars .star-empty { color: var(--bs-border-color); }

.facet-rating-divider {
  margin: 0.25rem 0;
  opacity: 0.15;
}

.facet-mobile-heading {
  margin-top: 0.6rem;
  margin-bottom: 0.15rem;
  font-size: 0.8rem;
  color: var(--bs-secondary-color);
}
.facet-mobile .form-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.1rem 0; 
  margin-bottom: 0;
}
.facet-mobile .form-check-input {
  float: none;
  margin: 0;
  flex-shrink: 0;
}
/* ==== Whole-row click targets ==== */
.facet-menu .form-check,
.facet-mobile .form-check,
#settingsOffcanvas .form-check,
#filtersOffcanvas .form-check {
  position: relative;
}
.facet-menu .form-check-label::after,
.facet-mobile .form-check-label::after,
#settingsOffcanvas .form-check-label::after,
#filtersOffcanvas .form-check-label::after {
  content: "";
  position: absolute;
  inset: 0;
  cursor: pointer;
}
.facet-menu .form-check-input:disabled ~ .form-check-label::after,
.facet-mobile .form-check-input:disabled ~ .form-check-label::after,
#settingsOffcanvas .form-check-input:disabled ~ .form-check-label::after,
#filtersOffcanvas .form-check-input:disabled ~ .form-check-label::after {
  cursor: default;
}
#settingsOffcanvas .form-check,
#filtersOffcanvas .form-check {
  margin-bottom: 0;
  padding-top: 0.0625rem;
  padding-bottom: 0.0625rem;
}


/* ==== Choice tiles ==== */
.choice-tiles {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.choice-tile {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin: 0;
  padding: 0.75rem 1rem;
  background: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: 0.5rem;
  cursor: pointer;
}
.choice-tile:hover {
  border-color: var(--app-selected-outline);
}
.choice-tile > input {
  position: absolute;
  top: 0.75rem;
  left: 1rem;
  width: 2rem;
  height: 2rem;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.choice-box,
.choice-dot {
  flex: none;
  width: 2rem;
  height: 2rem;
  color: var(--bs-secondary-color);
}
.choice-box-tick,
.choice-dot-fill {
  display: none;
}
.choice-dot-fill {
  fill: currentColor;
  stroke: none;
}
.choice-tile:has(> input:checked) {
  border-color: var(--app-selected-outline);
  background: var(--app-selected-bg);
}
.choice-tile:has(> input:checked) :is(.choice-box, .choice-dot) {
  color: var(--app-selected-outline);
}
[data-bs-theme="dark"] .choice-tile:has(> input:checked) :is(.choice-box, .choice-dot) {
  color: var(--bs-link-color);
}
.choice-tile:has(> input:checked) :is(.choice-box-tick, .choice-dot-fill),
.choice-box.is-ticked .choice-box-tick {
  display: inline;
}
.choice-box.is-ticked {
  color: var(--app-selected-outline);
}
[data-bs-theme="dark"] .choice-box.is-ticked {
  color: var(--bs-link-color);
}
.choice-tile:has(> input:disabled),
.choice-tile > input:disabled {
  cursor: default;
}
.choice-tile:has(> input:disabled) :is(.choice-box, .choice-dot) {
  opacity: 0.55;
}
.choice-tile:has(> input:disabled):not(:has(> input:checked)):hover {
  border-color: var(--bs-border-color);
}
.choice-tile:has(> input:focus-visible) {
  box-shadow: 0 0 0 0.25rem var(--bs-focus-ring-color);
}
.choice-tile-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
  padding-top: 0.3rem;
}
.choice-tile-name {
  font-weight: 600;
}
.choice-tile-what {
  color: var(--bs-secondary-color);
  font-size: 0.9rem;
}
.choice-tile-list {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  color: var(--bs-secondary-color);
  font-size: 0.9rem;
}
.choice-tile-note {
  font-style: italic;
}
.choice-tile.is-bare {
  align-items: center;
  gap: 0.5rem;
  padding: 0;
  background: none;
  border: 0;
}
.choice-tile.is-bare > input {
  top: 0;
  left: 0;
}
.choice-tile.is-bare:has(> input:checked) {
  background: none;
}
.choice-tile.is-bare .choice-tile-text {
  padding-top: 0;
}
.choice-tile.is-bare:not(.is-control) .choice-box {
  margin-left: -0.2rem;
}
.choice-tile.is-control {
  gap: 0.45rem;
}
.choice-tile.is-control > input {
  width: 1.9375rem;
  height: 1.9375rem;
}
.choice-tile.is-control .choice-box {
  width: 2.5rem;
  height: 2.5rem;
  margin: -0.28125rem;
  stroke-width: 0.6;
}
.choice-tile.is-control .choice-box-tick {
  stroke-width: 1.6;
}

/* ==== Buttons ==== */
.btn-subtle {
  --bs-btn-bg: var(--bs-tertiary-bg); 
  --bs-btn-hover-bg: var(--bs-secondary-bg); 
  --bs-btn-border-color: var(--bs-border-color);
  --bs-btn-hover-border-color: var(--bs-border-color);
  --bs-btn-color: var(--bs-body-color);
  --bs-btn-hover-color: var(--bs-body-color);
  --bs-btn-active-bg: var(--bs-secondary-bg);
  --bs-btn-active-border-color: var(--bs-border-color);
  --bs-btn-active-color: var(--bs-body-color);
}

.btn-outline-form {
  --bs-btn-border-width: var(--bs-border-width);
  --bs-btn-color: var(--bs-body-color);
  --bs-btn-bg: transparent;
  --bs-btn-border-color: var(--bs-border-color);
  --bs-btn-hover-color: var(--bs-body-color);
  --bs-btn-hover-bg: var(--bs-secondary-bg);
  --bs-btn-hover-border-color: var(--bs-border-color);
  --bs-btn-active-color: var(--bs-body-color);
  --bs-btn-active-bg: var(--bs-secondary-bg);
  --bs-btn-active-border-color: var(--bs-border-color);
  --bs-btn-disabled-color: var(--bs-secondary-color);
  --bs-btn-disabled-border-color: var(--bs-border-color);
}


/* ==== Field icon ==== */
.field-icon-wrap {
  position: relative;
  z-index: 0;
}
.field-icon-wrap .field-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--bs-secondary-color);
  display: flex;
  pointer-events: none;
  z-index: 10;
}
.field-icon-wrap .field-icon svg {
  display: block;
  width: 100%;
  height: 100%;
}
.field-icon-wrap > .form-control {
  padding-left: 2.35rem;
}
.field-icon-wrap > .input-group > .form-control:first-child {
  padding-left: 2.35rem;
}



/* ==== Content width ==== */
@media (min-width: 1200px) {
  :root {
    --gutter: 1.5rem;
  }
}
.container,
.container-fluid {
  --bs-gutter-x: calc(2 * var(--gutter));
}
.content-wrap {
  width: 100%;
  max-width: var(--width-normal);
  margin-inline: auto;
  padding-inline: var(--gutter);
}



/* ==== End of list ==== */
.end-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 2rem var(--gutter) 0;
  color: var(--bs-secondary-color);
  font-size: 0.85rem;
  text-align: center;
}
.end-rule {
  width: 120px;
  height: 1px;
  margin-bottom: 0.4rem;
  background: var(--bs-border-color);
}
.end-message-link {
  color: var(--bs-link-color);
}



/* ==== Page transitions ==== */
@view-transition {
  navigation: auto;
}
@media (prefers-reduced-motion: reduce) {
  @view-transition {
    navigation: none;
  }
}
nav.navbar {
  view-transition-name: site-navbar;
}

/* ==== Navbar ==== */

.navbar {
  width: 100%;
  max-width: 100%;
  margin-inline: auto;
}

.navbar-inner {
  width: 100%;
  max-width: var(--width-normal);
  margin-inline: auto;
  padding-inline: var(--gutter);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.navbar-toggler {
  display: inline-flex;
  align-items: center;
  margin-left: 0.3rem;
  padding: 0 1.5rem 0 0.25rem;
  border: none;
  font-size: 1.2rem; 
}
.navbar-toggler:focus:not(:focus-visible) {
  outline: none;
  box-shadow: none;
}

.navbar-brand-container,
.user-profile-container {
  position: relative;
  z-index: 1130;
  min-width: 0;
}
.user-profile-container {
}

.user-profile-container .btn {
  padding: 0.25rem 0.625rem;
  min-width: 0;
}

@media (max-width: 991.98px) {
  .navbar-toggler,
  .user-profile-container .btn {
    min-height: 2.75rem;
  }
}

@media (min-width: 992px) {
  .navbar-collapse {
    display: flex !important;
    justify-content: start;
  }
}

/* ==== Mobile menu ==== */

@media (max-width: 991.98px) {
  .navbar-collapse {
    position: fixed;
    top: var(--navbar-h);
    left: 0;
    right: 0;
    bottom: 0;
    font-size: 1.2rem;
    background-color: var(--bs-tertiary-bg);
    padding: 1rem;
    z-index: 1120;
    overflow: hidden;
  }

  .nav-link {
    line-height: 2.15;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    padding-left: 0.35rem;
  }

  .nav-menu-search-box {
    padding-top: 1rem;
    padding-bottom: 0.5rem;
    padding-left: 0.35rem;
    max-width: 400px;
  }

  .mobile-nav-screens,
  .mobile-nav-anon {
    font-size: 1.4rem;
  }
  .mobile-nav-screens .nav-link,
  .mobile-nav-anon .nav-link {
    line-height: 1.8;
    padding-top: 0.7rem;
    padding-bottom: 0.7rem;
  }
  .mobile-nav-screens .nav-menu-search-box .form-control {
    font-size: 1.15rem;
  }

  .mobile-nav-screens {
    position: relative;
    height: 100%;
    overflow: hidden;
  }

  .mobile-nav-main {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
  }
  .mobile-nav-main.is-searching::after {
    content: "";
    flex: none;
    height: 100vh;
  }

  .mobile-nav-drill-trigger {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    background: none;
    border: 0;
    text-align: left;
    color: inherit;
  }
  .mobile-nav-drill-trigger::after {
    content: "";
    width: 0.5em;
    height: 0.5em;
    margin-left: 0.5em;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(-45deg);
    opacity: 0.6;
    flex-shrink: 0;
  }

  .mobile-nav-submenu {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    background-color: var(--bs-tertiary-bg);
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    overflow-y: auto;
  }
  .mobile-nav-submenu.is-open {
    transform: translateX(0);
  }

  .mobile-nav-submenu-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    background: none;
    border: 0;
    border-bottom: 1px solid var(--bs-border-color);
    text-align: left;
    color: inherit;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
  }
  .mobile-nav-submenu-header svg { flex-shrink: 0; }
}

/* ==== Desktop mega-menu ==== */
@media (min-width: 992px) {
  .mega-dropdown-menu {
    position: fixed !important;
    inset: auto 0 auto 0 !important;
    top: var(--navbar-h) !important;
    transform: none !important;
    margin: 0 !important;
    border: 0;
    border-radius: 0;
    background-color: var(--bs-tertiary-bg);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    padding: 0;
    z-index: 1030;
  }
  .mega-dropdown-inner {
    width: max-content;
    padding-bottom: 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }
  .mega-dropdown-menu .dropdown-item {
    width: auto;
    font-size: 1.05rem;
    padding: 0.35rem 1.5rem 0.35rem 1rem;
    border-radius: 0.5rem;
  }
  .mega-dropdown-menu .dropdown-item:hover,
  .mega-dropdown-menu .dropdown-item:focus {
    background-color: var(--bs-secondary-bg);
  }

  .mega-dropdown-backdrop {
    position: fixed;
    top: var(--navbar-h);
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1019;
    background: rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
  }
  .mega-dropdown-backdrop.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
}


/* ==== Hamburger icon ==== */
.hamburger-box {
  position: relative;
  display: block;
  width: 1.2em; 
  height: 0.95em;
}

.hamburger-bar {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: currentColor;
  border-radius: 2px;
  transition: top 0.3s ease, transform 0.3s ease, opacity 0.2s ease;
}
.hamburger-bar:nth-child(1) { top: 0; }
.hamburger-bar:nth-child(2) { top: 50%; transform: translateY(-50%); }
.hamburger-bar:nth-child(3) { top: auto; bottom: 0; }

.navbar-toggler[aria-expanded="true"] .hamburger-bar:nth-child(1) {
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
}
.navbar-toggler[aria-expanded="true"] .hamburger-bar:nth-child(2) {
  opacity: 0;
}
.navbar-toggler[aria-expanded="true"] .hamburger-bar:nth-child(3) {
  top: 50%;
  bottom: auto;
  transform: translateY(-50%) rotate(-45deg);
}


/* ==== Logo ==== */
.navbar-brand {
  padding-block: 0;
  margin-right: 1rem;
}
@media (min-width: 992px) {
  .navbar-brand { margin-right: 2.75rem; }
}
@media (min-width: 1200px) {
  .navbar-brand { margin-right: 4rem; }
}

/* ==== Current navbar section ==== */
.navbar .nav-link.is-active,
.navbar .nav-link.is-active:hover,
.navbar .nav-link.is-active:focus {
  color: var(--brand-accent);
  font-weight: 600;
}
@media (min-width: 992px) {
  .navbar .nav-menu-search-box {
    flex: 0 1 300px;
    min-width: 160px;
  }
}
.navbar-brand .logo {
  display: block;
}
.navbar-brand .logo-wide {
  display: none;
}
@media (min-width: 360px) {
  .navbar-brand .logo-wide { display: block; }
  .navbar-brand .logo-stacked { display: none; }
}

.avatar-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--bs-border-color);
  background: var(--bs-tertiary-bg);
  color: var(--bs-secondary-color);
  flex-shrink: 0;
}
.avatar-circle-lg {
  width: 44px;
  height: 44px;
}



/* ==== Inline messages ==== */
@keyframes msgShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-1px); }
  40%, 80% { transform: translateX(1px); }
}
.msg-shake { animation: msgShake 0.4s ease; }

.alert-sm {
  font-size: 0.9rem;
  padding: 0.5rem;
}
.alert-icon-wrap {
  flex-shrink: 0;
  width: 1.1rem;
  height: 1.1rem;
}
.alert-sm.alert-dismissible {
  padding-right: 2.75rem;
}
.alert-sm.alert-dismissible .btn-close {
  padding: 0.75rem;
}

.msg-body--truncate {
  display: flex;
  flex-wrap: nowrap;
  align-items: baseline;
  white-space: nowrap;
  min-width: 0; 
  flex: 1 1 auto;
}
.msg-has-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 0.75rem;
  row-gap: 0.8rem;
}
.msg-has-actions .msg-actions .btn {
  margin-block: -0.3rem;
}
.msg-has-actions > :first-child {
  flex: 0 1 auto;
  min-width: 0;
}
.msg-has-actions .msg-var {
  max-width: min(20rem, calc(100vw - 7rem));
}
.msg-var-wrap {
  white-space: nowrap;
}
.msg-var {
  display: inline-block;
  max-width: min(calc(100% - 1.5em), 20rem);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}
.msg-body--truncate .msg-var {
  max-width: none;
  min-width: 0; 
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}



/* ==== Icons and links ==== */
.custom-icon {
    margin-right: 0.5em;
}

.no-underline-link {
    text-decoration: none;
}

.underline-link {
    text-decoration: underline;
}

/* ==== Action buttons ==== */
.nav-container {
    display: flex;
    align-items: center;
    padding: 5px 0;
    gap: 0.75rem;
}

.nav-floating {
    position: fixed;
    z-index: 10;
    bottom: 16px;
    left: 0;
    right: 0;
    justify-content: center;
    pointer-events: none;
}
.nav-floating .btn {
    pointer-events: auto;
}

.nav-inline {
    display: flex; 
    flex-wrap: wrap;
    justify-content: flex-start; 
    margin-top: 1.75rem;
}
@media (max-width: 767.98px) {
    .nav-inline {
        position: fixed;
        z-index: 10;
        bottom: 16px;
        left: 0;
        right: 0;
        justify-content: center; 
        pointer-events: none;
        margin-top: 0;

        max-width: 350px; 
        margin-left: auto; 
        margin-right: auto; 
    }
    .nav-inline .btn {
        flex: 1 1 150px; 
        max-width: fit-content; 
    }
}


.nav-container .btn,
.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 500;
    gap: 0.4em;
    white-space: nowrap;
    pointer-events: auto;
}
@media (max-width: 767.98px) {
    .nav-container .btn,
    .btn-action {
        font-size: 1.2rem;
        min-height: 2.5em;
    }
}

.nav-container .btn .btn-icon,
.btn-action .btn-icon {
    width: 1.5em;
    height: 1.5em;
    display: block;
    flex-shrink: 0;
}
.btn .btn-icon {
    width: 1.5em;
    height: 1.5em;
    display: block;
    flex-shrink: 0;
}
@media (max-width: 767.98px) {
    .nav-container .btn .btn-icon,
    .btn-action .btn-icon {
        font-size: 1.5rem;
        height: 1.2em;
        width: 1.2em;
    }
}

.btn .btn-spinner {
    display: none;
    width: 1.2em;
    height: 1.2em;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    flex-shrink: 0;
    animation: btn-spin 0.7s linear infinite;
}
@keyframes btn-spin {
    to { transform: rotate(360deg); }
}
.btn .btn-text-loading {
    display: none;
}
.btn.btn-loading .btn-icon,
.btn.btn-loading .btn-text {
    display: none;
}
.btn.btn-loading .btn-spinner {
    display: inline-block;
}
.btn.btn-loading .btn-text-loading {
    display: inline;
}

@media (max-width: 767.98px) {
    .nav-container {
        bottom: 12px;
    }
}


/* ==== The bottom bar of a form (conventions.md 6c1) ==== */
.action-bar {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 10px;
}
.action-bar .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4em;
    flex-shrink: 0;
    white-space: nowrap;
    pointer-events: auto;
}
@media (max-width: 767.98px) {
    .action-bar {
        position: fixed;
        z-index: 20;
        right: 0;
        bottom: 0;
        left: 0;
        max-width: none;
        margin: 0;
        padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom, 0px));
        justify-content: center;
        border-top: 1px solid var(--bs-border-color);
        background: var(--bs-body-bg);
        pointer-events: auto;
    }
    .offcanvas-body:has(> .action-bar) {
        display: flex;
        flex-direction: column;
    }
    .offcanvas .action-bar {
        position: sticky;
        margin: auto calc(-1 * var(--bs-offcanvas-padding-x, 1rem)) calc(-1 * var(--bs-offcanvas-padding-y, 1rem));
    }
    .action-bar .btn {
        flex: 0 0 auto;
        height: 48px;
        min-height: 48px;
        max-width: none;
        padding: 0 14px;
        font-size: 1.05rem;
    }
    .action-bar.is-compact .btn:not(.action-main) {
        width: 48px;
        padding: 0;
    }
    .action-bar.is-compact .btn:not(.action-main) .btn-text,
    .action-bar.is-compact .btn:not(.action-main) .btn-text-loading {
        position: absolute;
        width: 1px;
        height: 1px;
        margin: -1px;
        overflow: hidden;
        clip-path: inset(50%);
    }
}

/* ==== The answers of a panel that asks a question (conventions.md 6c1) ==== */
.answer-stack {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 1.5rem;
}
.answer-stack .btn {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.5rem;
    width: 100%;
    min-height: 48px;
    font-size: 1rem;
    text-align: left;
    white-space: normal;
}
.answer-stack .btn .btn-icon {
    width: 1.3em;
    height: 1.3em;
    flex-shrink: 0;
}

/* ==== Offcanvas that leaves the page scrollable ==== */
.offcanvas[data-bs-scroll="true"] .offcanvas-body {
  overscroll-behavior: contain;
}


/* ==== Book card in an offcanvas ==== */
.fixed-size-card {
  width: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.fixed-size-card img,
.fixed-size-card svg {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.offcanvas-body { overflow-x: hidden; }
.offcanvas-heading { font-size: 1rem; font-weight: bold; margin-bottom: 0px; }
/* ==== The "already in your library" panel: the copy without labels ==== */
.dup-copy p { margin: 0; }
.dup-copy .dup-title { font-size: 1.05rem; font-weight: 700; line-height: 1.3; }
.dup-copy .dup-authors { margin-top: 2px; color: var(--bs-secondary-color); }
.dup-copy .dup-location { display: flex; align-items: center; gap: 0.35rem; margin-top: 8px; }
.dup-copy .dup-pin { display: inline-flex; flex-shrink: 0; width: 1rem; height: 1rem; }
.dup-copy .dup-pin svg { width: 100%; height: 100%; }
.offcanvas-text {
  font-size: 0.9rem;
  align-items: start;
  margin-bottom: 3px;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}


/* ==== Back to top ==== */

#backToTopBtn {
    position: fixed;
    bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    right: calc(24px + env(safe-area-inset-right, 0px));
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background-color: var(--brand);
    color: #fff;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition:
        opacity 0.25s ease,
        transform 0.25s ease,
        translate 0.25s ease,
        visibility 0.25s;
    z-index: 1040;
}

#backToTopBtn svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

#backToTopBtn.is-visible {
    opacity: 1;
    visibility: visible;
    transform: none;
}

#backToTopBtn.is-visible:hover {
    background-color: var(--brand-hover);
    color: #fff;
}

body.nav-open #backToTopBtn.is-visible {
    opacity: 0;
    visibility: hidden;
}

/* ==== Navbar fade ==== */
.nav-fade {
    display: none;
}
body.no-chevron-tint .nav-fade {
    display: block;
    position: sticky;
    top: var(--nav-h, 56px);
    z-index: 1010;
    height: var(--page-fade);
    margin-bottom: calc(-1 * var(--page-fade));
    border-top: 1px solid var(--bs-border-color);
    background: linear-gradient(to bottom, var(--bs-tertiary-bg), transparent);
    pointer-events: none;
}

/* ==== Page head ==== */
.page-head {
    display: flow-root;
    background-color: var(--bs-tertiary-bg);
}
.page-head:not(:has(+ .page-toolbar-top, + .page-toolbar, .page-toolbar)) {
    padding-bottom: var(--page-fade);
    background: linear-gradient(to bottom, var(--bs-tertiary-bg) calc(100% - var(--page-fade)), var(--bs-body-bg) 100%);
}
.page-head--sticky {
    position: sticky;
    top: var(--nav-h, 56px);
    z-index: 1015;
}
.page-head-inner {
    position: relative;
    max-width: var(--width-normal);
    margin-inline: auto;
    padding-inline: var(--gutter);
}
.page-head #inline-messages .alert {
    margin-bottom: 0;
}
.page-title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    column-gap: 0.85rem;
    padding-block: var(--page-head-pad-top) var(--page-head-pad-bottom);
    min-width: 0;
}
.page-title {
    margin: 0;
    min-width: 0;
    max-width: 100%;
    font-size: var(--page-title-size);
    font-weight: var(--page-title-weight);
    letter-spacing: var(--page-title-tracking);
    line-height: var(--page-title-line-height);
    padding-bottom: 0.15em;
    margin-bottom: -0.15em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.page-title--wrap {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
}
.page-title-criteria {
    font-weight: 400;
}
.faq-off-note {
    padding: 0.5rem 0.75rem;
    border-radius: var(--bs-border-radius);
    background: var(--bs-tertiary-bg);
    color: var(--bs-secondary-color);
    font-size: 0.9rem;
}
.page-title:has(.title-menu) {
    overflow: visible;
}
.title-menu {
    display: inline-flex;
    max-width: 100%;
}
.title-menu-btn {
    display: inline-flex;
    align-items: baseline;
    max-width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0.1em;
    background: none;
    color: inherit;
    font: inherit;
    letter-spacing: inherit;
    line-height: inherit;
}
.title-menu-text {
    min-width: 0;
    padding-bottom: 0.15em;
    margin-bottom: -0.15em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.title-menu-btn::after {
    flex: none;
    align-self: center;
    margin-left: 0.3em;
    border-top-width: 0.22em;
    border-right-width: 0.2em;
    border-left-width: 0.2em;
    color: var(--bs-secondary-color);
}
.title-menu-btn:hover,
.title-menu-btn[aria-expanded="true"] {
    background: var(--bs-secondary-bg);
    box-shadow: 0 0 0 0.2em var(--bs-secondary-bg);
}
.title-menu-btn:hover::after,
.title-menu-btn[aria-expanded="true"]::after {
    color: var(--bs-body-color);
}
.title-menu-btn:focus-visible,
.showing-menu-btn:focus-visible {
    outline: 2px solid var(--bs-primary);
    outline-offset: 2px;
}
.page-title-row .showing-menu {
    display: flex;
}
.showing-menu-btn {
    padding: 0 0.2rem;
    border: 0;
    background: none;
    color: var(--bs-secondary-color);
    font-size: var(--page-meta-size);
    white-space: nowrap;
}
.showing-menu-btn:hover,
.showing-menu-btn[aria-expanded="true"] {
    color: var(--bs-body-color);
    text-decoration: underline;
    text-underline-offset: 3px;
}
.page-count {
    color: var(--bs-secondary-color);
    font-size: var(--page-meta-size);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.page-subline .edit-search-link {
    margin: 0;
}
.page-subline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.9rem;
    padding-bottom: 0.55rem;
    color: var(--bs-body-color);
    font-size: 0.9rem;
}

/* ==== Section titles ==== */
.section-title {
    margin: 0 0 0.3rem;
    font-size: var(--section-title-size);
    font-weight: var(--section-title-weight);
    line-height: 1.3;
}
.subsection-title {
    margin: 0 0 0.35rem;
    font-size: var(--subsection-title-size);
    font-weight: var(--subsection-title-weight);
    line-height: 1.3;
}

/* ==== Sign-in pages ==== */
body.auth-page .navbar {
    background-color: var(--bs-body-bg);
}
body.auth-page .navbar-inner {
    max-width: none;
}
body.auth-page .nav-fade,
body.auth-page .chevron-trail-band {
    display: none;
}
.auth-main {
    width: 100%;
    max-width: calc(26rem + 2 * var(--gutter));
    margin: clamp(1.5rem, 7vh, 4.5rem) auto 0;
    padding-inline: var(--gutter);
}
.auth-main--wide {
    max-width: calc(70rem + 2 * var(--gutter));
}
.auth-title {
    margin-bottom: 0.6rem;
    text-align: center;
}
.cf-turnstile {
    position: relative;
    line-height: 0;
}
.cf-turnstile > div {
    clip-path: inset(1px round var(--bs-border-radius));
}
.cf-turnstile::after {
    content: "";
    position: absolute;
    inset: 0;
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
    pointer-events: none;
}

/* ==== Kebab menus ==== */
.kebab-wrap {
    position: relative;
    display: inline-block;
}
.kebab-btn:not(.btn) {
    display: inline-flex;
    align-items: center;
    padding: 3px 5px;
    border: none;
    border-radius: 4px;
    background: none;
    color: var(--bs-secondary-color);
    cursor: pointer;
}
.kebab-btn:not(.btn):hover {
    background-color: var(--bs-secondary-bg);
    color: var(--bs-body-color);
}
.kebab-btn svg {
    width: 18px;
    height: 18px;
}
.mob-kebab-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: none;
    color: var(--bs-secondary-color);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.mob-kebab-btn:active {
    background: var(--bs-secondary-bg);
}
.mob-kebab-btn svg {
    width: 17px;
    height: 17px;
}
.kebab-drop {
    min-width: 170px;
    padding: 4px;
    border: 1px solid var(--bs-border-color);
    border-radius: 8px;
    background: var(--bs-body-bg);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.10);
}
.kebab-drop button {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 7px 10px;
    border: none;
    border-radius: 6px;
    background: none;
    color: var(--bs-body-color);
    font-size: 0.85rem;
    text-align: left;
    cursor: pointer;
}
.kebab-drop button:hover {
    background-color: var(--bs-secondary-bg);
}
.kebab-drop button.danger {
    color: var(--bs-danger);
}
.kebab-drop button.danger:hover {
    background-color: var(--bs-danger-bg-subtle);
}
.kebab-drop button:disabled {
    opacity: 0.55;
    cursor: default;
    background: none;
}
.kebab-text {
    display: flex;
    flex-direction: column;
}
.kebab-hint {
    font-size: 0.85em;
    color: var(--bs-secondary-color);
}
.kebab-drop hr {
    margin: 3px 0;
    border-color: var(--bs-border-color);
    opacity: 0.75;
}
.kebab-drop svg {
    flex-shrink: 0;
    width: 15px;
    height: 15px;
}
@media (max-width: 991.98px) {
    .kebab-btn:not(.btn) {
        padding: 9px 11px;
    }
    .mob-kebab-btn {
        width: 40px;
        height: 40px;
        margin-block: -6px;
    }
    .kebab-drop {
        min-width: 220px;
        padding: 6px;
    }
    .kebab-drop button {
        gap: 12px;
        padding: 11px 14px;
        font-size: 1rem;
    }
    .kebab-drop svg {
        width: 18px;
        height: 18px;
    }
    .kebab-drop hr {
        margin: 4px 0;
    }
}

/* ==== Fit rows ==== */
.fit-row.is-tight .fit-hide {
    display: none;
}

/* ==== Page toolbar ==== */
.page-toolbar-top {
    display: flex;
    background-color: var(--bs-tertiary-bg);
}
.page-toolbar-top::before {
    content: "";
    flex: 1 1 auto;
    max-width: var(--width-normal);
    height: 2px;
    margin-inline: auto;
    background-color: var(--bs-border-color);
}
.page-toolbar {
    position: sticky;
    top: var(--nav-h, 56px);
    z-index: 100;
    padding-top: 0.3rem;
    background: linear-gradient(to bottom, var(--bs-tertiary-bg), var(--bs-body-bg));
}
.page-head .page-toolbar {
    position: static;
}
.page-toolbar-line {
    max-width: var(--width-normal);
    height: 2px;
    margin-inline: auto;
    background-color: var(--bs-border-color);
}
.page-toolbar-line--top {
    margin-bottom: 0.3rem;
}
.page-toolbar-line--bottom {
    margin-block: 0.3rem 0.25rem;
}
@media (max-width: 991.98px) {
    .page-toolbar-line {
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }
}
.manage-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    max-width: var(--width-normal);
    margin-inline: auto;
    padding-inline: var(--gutter);
    font-size: 0.875rem;
}
.manage-toolbar .form-control {
    font-size: inherit;
}
.manage-filter {
    flex: 0 1 260px;
}
.manage-add {
    flex: 0 1 460px;
    align-items: center;
    gap: 0.4rem;
    margin-left: auto;
}
.manage-add-field {
    flex: 1 1 auto;
    min-width: 0;
}
.manage-add-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 2.4rem;
    align-self: stretch;
    padding: 0;
}
.manage-add-btn svg,
.manage-add-phone svg {
    width: 1.1rem;
    height: 1.1rem;
}
.manage-add-phone {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    flex: none;
    margin-left: auto;
    font-size: inherit;
}
@media (max-width: 767.98px) {
    .manage-filter {
        flex: 1 1 0;
    }
}

/* ==== No-results message ==== */
.no-results {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    margin: 2rem 0rem 3rem;
    padding: 0.9rem 1rem;
    border: 1px solid var(--bs-info-border-subtle);
    border-left: 4px solid var(--bs-info);
    border-radius: 0.375rem;
    background-color: var(--bs-info-bg-subtle);
    color: var(--bs-info-text-emphasis);
    font-size: 0.85rem;
    line-height: 1.35;
}

.no-results svg {
    flex-shrink: 0;
    color: var(--bs-info-text-emphasis);
}

/* ==== Locations explainer launchers ==== */
.loc-explainer-thumb {
    position: relative;
    flex: 0 0 auto;
    display: block;
    width: 128px;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.5rem;
    background: var(--bs-body-bg);
    cursor: pointer;
}
.loc-explainer-thumb img {
    display: block;
    width: 100%;
    height: auto;
    transition: transform 0.3s ease;
}
[data-bs-theme="dark"] .loc-explainer-thumb img {
    filter: brightness(0.88) saturate(0.95);
}
.loc-explainer-thumb:hover img {
    transform: scale(1.04);
}
.no-results .loc-explainer-play svg,
.loc-explainer-play svg {
    color: #ffffff;
}
.loc-explainer-play {
    position: absolute;
    top: 50%;
    left: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(31, 79, 143, 0.9);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transform: translate(-50%, -50%);
    transition: transform 0.2s ease;
}
.loc-explainer-thumb:hover .loc-explainer-play,
.loc-explainer-thumb:focus-visible .loc-explainer-play {
    transform: translate(-50%, -50%) scale(1.1);
}
.loc-explainer-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0;
    border: 0;
    background: none;
    color: var(--bs-link-color);
    font: inherit;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
}
.loc-explainer-link:hover {
    color: var(--bs-link-hover-color);
}
.loc-explainer-watch {
    align-self: flex-start;
    margin-top: 0.15rem;
    font-size: 0.92rem;
}
.no-results.loc-empty {
    container-type: inline-size;
    align-items: center;
    gap: 1.25rem;
    font-size: 0.9rem;
    line-height: 1.5;
}
@container (max-width: 23.4em) {
    .loc-empty-break {
        display: none;
    }
}
@media (max-width: 575.98px) {
    .no-results.loc-empty {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.9rem;
    }
    .no-results.loc-empty .loc-explainer-thumb {
        width: 100%;
        max-width: 280px;
    }
}
.loc-explainer-modal .modal-body {
    padding-bottom: 0.5rem;
}
@media (min-width: 576px) {
    .loc-explainer-modal .modal-dialog {
        max-width: clamp(480px, calc((100vh - 420px) * 1.6 + 2rem), 800px);
    }
}
.loc-explainer-modal [data-loc-demo]:empty {
    aspect-ratio: 16 / 10;
}

.show-all-link {
  font-size: 0.85rem;
  white-space: nowrap;
}
.edit-search-link {
  margin: 0 0.75rem;
  font-size: 0.85rem;
  white-space: nowrap;
}


/* ==== Accordions ==== */
:root,
[data-bs-theme="light"] {
  --acc-header-bg:       #e9ecef;
  --acc-header-hover-bg: #dde1e5;
  --acc-header-color:    #212529;
  --acc-open-bg:         #d3deee;
  --acc-open-color:      #0c2240;
  --acc-border:          #dee2e6;
  --acc-accent:          #1f4f8f;
}
[data-bs-theme="dark"] {
  --acc-header-bg:       #2b3138;
  --acc-header-hover-bg: #363e47;
  --acc-header-color:    #e9ecef;
  --acc-open-bg:         #1f3a63;
  --acc-open-color:      #ffffff;
  --acc-border:          #414a54;
  --acc-accent:          #8db4ea;
}

.accordion:not(.elegant-accordion) {
  --bs-accordion-btn-bg:       var(--acc-header-bg);
  --bs-accordion-btn-color:    var(--acc-header-color);
  --bs-accordion-active-bg:    var(--acc-open-bg);
  --bs-accordion-active-color: var(--acc-open-color);
  --bs-accordion-border-color: var(--acc-border);
}
.accordion:not(.elegant-accordion) .accordion-button.collapsed:hover {
  background-color: var(--acc-header-hover-bg);
}

.accordion:not(.elegant-accordion) .accordion-item {
  position: relative;
}
.accordion:not(.elegant-accordion) .accordion-item::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 4px;
  background: var(--acc-accent);
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
  z-index: 5;
}
.accordion:not(.elegant-accordion) .accordion-item:first-of-type::before {
  border-top-left-radius: var(--bs-accordion-inner-border-radius, 0.375rem);
}
.accordion:not(.elegant-accordion) .accordion-item:last-of-type::before {
  border-bottom-left-radius: var(--bs-accordion-inner-border-radius, 0.375rem);
}
.accordion:not(.elegant-accordion) .accordion-item:has(> .accordion-header > .accordion-button:not(.collapsed))::before {
  opacity: 1;
}

.accordion-error > .accordion-header > .accordion-button::before {
  content: "!";
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.3rem;
  height: 1.3rem;
  margin-right: 0.6rem;
  border-radius: 50%;
  background: var(--bs-danger);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1;
}
.accordion-error-msg {
  display: block;
  font-size: 0.8rem;
  color: var(--bs-danger-text-emphasis);
  padding: 0 var(--bs-accordion-btn-padding-x, 1.25rem) 0.25rem;
}

@media (max-width: 767.98px) {
  .accordion:not(.elegant-accordion) {
    --bs-accordion-btn-padding-x: 0.75rem;
    --bs-accordion-body-padding-x: 0.75rem;
  }
}

/* ==== Install the app ==== */
[data-install][hidden],
[data-install-item][hidden] {
  display: none !important;
}
.install-guide ol {
  padding-left: 1.25rem;
}
.install-guide li {
  margin-bottom: 0.6rem;
}
.install-share-icon {
  width: 1.15em;
  height: 1.15em;
  vertical-align: -0.2em;
}
.install-guide-note {
  color: var(--bs-secondary-color);
  font-size: 0.875rem;
  margin-bottom: 0;
}

/* ==== Date boxes ==== */
input.date-input,
input.date-input.is-invalid {
  padding-right: 2rem;
  background-repeat: no-repeat;
  background-position: right .6rem center;
  background-size: 1rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none' stroke='%236c757d' stroke-width='1.3'%3E%3Crect x='2' y='3' width='12' height='11' rx='1.5'/%3E%3Cpath d='M2 6.5h12M5 1.5v3M11 1.5v3'/%3E%3C/svg%3E");
}
.date-picker-overlay {
  position: absolute;
  z-index: 2;
  cursor: pointer;
}
.date-picker-overlay input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  font-size: 16px;
  pointer-events: none;
  -webkit-appearance: none;
  appearance: none;
}

/* ==== Step accordions ==== */
.step-accordion .accordion-button:disabled { opacity: .55; }
.step-accordion .step-summary { font-weight: normal; margin-left: 1rem; }
.step-accordion .accordion-button:not(.collapsed) .step-summary { display: none; }

/* ==== Page end ==== */
.page-end { height: 3rem; flex: none; }
@media (max-width: 767.98px) {
  .page-end { height: calc(4.5rem + env(safe-area-inset-bottom, 0px)); }
}

/* ==== Getting started checklist ==== */
.tour-checklist {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.tour-band .tour-checklist {
  position: relative;
  flex: 1 1 auto;
  padding: 1.5rem 1.75rem 1.4rem;
  border-radius: 0.75rem;
  background: var(--brand-tint);
}
.tour-checklist-head {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.tour-checklist-title {
  margin: 0;
  font-size: var(--section-title-size, 1.25rem);
  font-weight: var(--section-title-weight, 700);
}
.tour-checklist-count {
  color: var(--bs-secondary-color);
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}
.tour-checklist-lead {
  margin: 0;
  color: var(--bs-secondary-color);
}
.tour-note {
  margin: 0;
  font-weight: 600;
}
.tour-band-done {
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
}
.tour-band-done .tour-note {
  flex: 1 1 auto;
  padding: 1rem 1.75rem;
  border-radius: 0.75rem;
  background: var(--brand-tint);
  font-weight: 400;
}
.tour-checklist-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem 1rem;
  flex-wrap: wrap;
}
.tour-checklist-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
}
.tour-band .tour-checklist-head {
  padding-right: 2rem;
}
.tour-checklist-items {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin: 0.25rem 0 0;
  padding: 0;
  list-style: none;
}
.tour-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}
.tour-item-mark {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 50%;
  border: 1.5px solid var(--bs-border-color);
  color: var(--bs-secondary-color);
  font-size: 0.85rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.tour-item.is-done .tour-item-mark {
  border-color: var(--bs-success);
  background: var(--bs-success);
  color: #fff;
}
.tour-item-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.tour-item-title {
  font-weight: 600;
}
a.tour-item-title {
  text-decoration: none;
}
a.tour-item-title:hover {
  text-decoration: underline;
}
.tour-item-desc {
  color: var(--bs-secondary-color);
  font-size: 0.92rem;
}
.tour-item.is-done .tour-item-title {
  color: var(--bs-secondary-color);
}
.tour-item.is-locked .tour-item-title,
.tour-item.is-locked .tour-item-mark {
  opacity: 0.7;
}
.tour-checklist-app {
  margin: 0;
  padding-top: 0.75rem;
  border-top: 1px solid var(--bs-border-color-translucent);
  font-size: 0.92rem;
}
.tour-checklist-app .btn-link {
  font-size: inherit;
  font-weight: 600;
}
.tour-checklist-app .tour-app-done,
.tour-checklist-app.is-done .tour-app-open {
  display: none;
}
.tour-checklist-app.is-done .tour-app-done {
  display: inline;
}
.tour-app-done svg {
  color: var(--bs-success-text-emphasis);
  width: 1em;
  height: 1em;
  vertical-align: -0.1em;
}



/* ==== Live auto-save flash ==== */
.live-save-flash {
  display: inline-block; font-size: 0.72rem; padding: 0.1rem 0.55rem;
  border-radius: 999px; background: var(--bs-success, #198754); color: #fff;
  opacity: 0; transition: opacity 0.2s ease; white-space: nowrap;
}
.live-save-flash.show { opacity: 1; }
.live-save-flash.is-error { background: var(--bs-danger, #dc3545); }

/* ==== No zoom on touch screens ==== */
@media (hover: none) and (pointer: coarse) {
  .form-control-sm,
  .form-select-sm {
    font-size: 1rem;
  }

  .btn-sm {
    --bs-btn-padding-y: calc(0.25rem + 1.5px);
  }
}

/* ==== Quality dot ==== */
:root {
  --quality-red: #d64545;
  --quality-yellow: #dca10d;
  --quality-green: #2e9b5f;
}
[data-bs-theme="dark"] {
  --quality-red: #e8675b;
  --quality-yellow: #efc043;
  --quality-green: #5fc08a;
}
.quality { position: relative; display: inline-block; vertical-align: middle; margin-left: 0.5rem; line-height: 1; }
.quality-dot {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 0;
  border-radius: 50%;
  padding: 0;
  vertical-align: middle;
  cursor: pointer;
}
.quality-dot--red { background: var(--quality-red); }
.quality-dot--yellow { background: var(--quality-yellow); }
.quality-dot--green { background: var(--quality-green); }
.quality-pop {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: -0.6rem;
  z-index: 40;
  width: max-content;
  max-width: min(21rem, calc(100vw - 2rem));
  padding: 0.65rem 0.8rem;
  background: var(--bs-body-bg);
  color: var(--bs-body-color);
  border: 1px solid var(--bs-border-color);
  border-radius: 0.6rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.45;
  text-align: left;
  white-space: normal;
  letter-spacing: normal;
}
.quality-pop::before { content: ""; position: absolute; left: 0; right: 0; top: -10px; height: 10px; }
.quality.open .quality-pop,
.quality-pop.quality-pop--float { display: block; }
@media (hover: hover) {
  .quality:hover .quality-pop { display: block; }
}
.titleText .quality { vertical-align: 0.12em; }
@media (hover: none), (max-width: 575.98px) {
  .titleText .quality { position: static; }
  .titleText .quality-pop { left: 0; right: 0; width: auto; max-width: none; }
}
.quality-head { display: flex; align-items: center; gap: 0.45rem; font-weight: 600; margin-bottom: 0.3rem; }
.quality-head .quality-dot { width: 10px; height: 10px; cursor: default; }
.quality-line { display: block; margin: 0.15rem 0; overflow-wrap: anywhere; }
.quality-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.9rem;
  margin-top: 0.5rem;
  padding-top: 0.45rem;
  border-top: 1px solid var(--bs-border-color-translucent);
}
.quality-foot a,
.quality-foot button { border: 0; background: none; padding: 0; color: var(--bs-link-color); font: inherit; cursor: pointer; }
