body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

body > .container,
body > .container-fluid {
  flex: 1;
}

footer {
  margin-top: auto;
}

.navbar {
  transition: top 0.5s ease;
}

.navbar-hide {
  top: -60px;
}

.footer {
  transition: bottom 0.5s ease;
}

.footer-hide {
  bottom: -60px;
}

.btn-md {
  width: 100px;
}

.btn-wx {
  width: 150px;
}

.img-xl {
  height: 48px;
}

.img-lg {
  height: 36px;
}

.img-md {
  height: 24px;
}

.img-sm {
  height: 18px;
}

.img-xs {
  height: 9px;
}

#copyright {
  text-align: center;
  padding: .3em;
}

.top-spacer {
  margin-top: 60px;
}

.bottom-spacer {
  padding: 10px;
  padding-right: 11px;
  margin-bottom: 90px;
}

/* Mobile First: Default style for mobile screens */
.img-height {
  width: 100%;
}

/* Desktop: Screen sizes 768px and wider */
@media (min-width: 768px) {
  .img-height {
    height: 200px;
    object-fit: contain;
  }
}

@media (min-width: 768px) {
  .carousel-inner .carousel-item {
    display: flex !important;
  }
}

/* Sticky Save/Download bar: docks flush to the top of the window, content
   scrolls beneath it, and a shadow appears only while it is docked. */
.export-toolbar {
  position: sticky;
  top: 0;
  z-index: 1020;
  background: #fff;
  margin-left: -.5rem;
  margin-right: -.5rem;
  padding-left: .5rem;
  padding-right: .5rem;
  border-bottom: 1px solid #dee2e6;
}
.export-toolbar.is-docked {
  box-shadow: 0 .5rem .75rem -.5rem rgba(0, 0, 0, .3);
}
/* Keep jump links from parking section headers under the sticky bar. */
.settings-accordion .accordion-item {
  scroll-margin-top: 4.5rem;
}

.card .form-check-input {
  width: 1.3em;
  height: 1.3em;
}

.color-swatch {
  width: 32px; height: 32px; border-radius: 4px;
  border: 1px solid #ccc; display: inline-block;
  vertical-align: middle; margin-right: 8px;
  cursor: pointer; flex-shrink: 0;
}
.color-input-group {
    display: flex; align-items: center; gap: 8px;
}
.color-input-group input[type="color"] {
  width: 40px; height: 36px; padding: 2px; border: 1px solid #ccc;
  border-radius: 4px; cursor: pointer; flex-shrink: 0;
}
.color-input-group input[type="text"] {
  flex: 1;
}
.theme-card { transition: box-shadow 0.2s; }
.theme-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.section-header {
  background: #f8f9fa; padding: 8px 12px; border-radius: 6px;
  font-weight: 600; margin-top: 16px; margin-bottom: 8px;
  font-size: 0.95em; color: #495057;
}
/* Configuration editor */
.setting-row {
  border: 1px solid transparent;
  border-radius: .375rem;
  padding: .4rem .55rem;
}
.setting-row:hover {
  border-color: #e9ecef;
  background: #fcfcfd;
}
.setting-row.is-modified {
  background: #fff9e6;
  border-color: #ffe08a;
}
.setting-row .setting-modified-badge {
  display: none;
  font-size: .6rem;
  vertical-align: middle;
}
.setting-row.is-modified .setting-modified-badge {
  display: inline-block;
}
.setting-help {
  font-size: .78rem;
  line-height: 1.3;
  color: #6c757d;
  margin-top: .15rem;
}
.settings-accordion .accordion-body {
  padding: .75rem;
}
.section-jump {
  overflow-x: auto;
  white-space: nowrap;
  padding-bottom: 2px;
  scrollbar-width: thin;
}
.section-jump .btn {
  flex: 0 0 auto;
}
.list-group-item.active .fw-bold {
  color: #fff !important;
}
.preview-box {
  border: 1px solid #dee2e6; border-radius: 8px; padding: 0;
  overflow: hidden; background: #fff;
}
.preview-box .preview-header {
  padding: 8px 12px; border-bottom: 1px solid #dee2e6;
  background: #f8f9fa; font-weight: 600; font-size: 0.9em;
}
.preview-box .preview-body {
  padding: 12px; min-height: 60px;
}
.color-hex-hint {
  font-size: 0.75em; color: #6c757d;
  display: block; margin-top: 2px;
}
