/* ===== GLOBAL ===== */
html,
body {
  overflow-x: hidden;
}

body {
  background-color: #f8f9fa;
  margin: 0;
  font-family: Arial, sans-serif;
}

.imgcontainer {
  display: flex;
  gap: 1rem;
  justify-content: space-evenly;
  flex-wrap: wrap;

}

.highlight-box {
  background: rgba(142, 175, 31, 0.08);
  border: 1px solid rgba(142, 175, 31, 0.2);
  padding: 1rem;
  border-radius: 12px;
  margin: 1rem 0;
}

.sampleimg {
  max-width: 30vw;
  border: 1px solid rgba(142, 175, 31, 0.25);
  border-radius: 8px;
  margin: 1rem 0;
  height: fit-content;
}

.text-center {
  text-align: center;
}

.text-start {
  text-align: left;
}

.mt-5 {
  margin-top: 3rem;
}

.atlas-wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1rem;
  text-align: center;
}

/* === Imported from index.html inline styles === */
.atlas-header-flex {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.atlas-logo-img {
  max-width: 100%;
  height: auto;
  max-height: 300px;
  margin-bottom: -80px;
  margin-top: -50px;
}

.atlas-title-margin {
  margin-left: 20px;
  margin-top: 20px;
  margin-right: 20px;
}

.atlas-h1-title {
  color: #8eaf1f;
  text-align: center;
}

.atlas-h2-title {
  color: #8eaf1f;
  font-family: Impact, Haettenschweiler, 'Arial Narrow Bold', sans-serif;
  text-align: center;
}

h3 {
  color: #8eaf1f;
  font-family: Impact, Haettenschweiler, 'Arial Narrow Bold', sans-serif;
  text-align: center;
}

h4 {
  color: #8eaf1f;
  font-family: Impact, Haettenschweiler, 'Arial Narrow Bold', sans-serif;
  text-align: center;
}

li {
  color: #000000;
}


.atlas-btn-new-label {
  color: #fff;
  background: #8eaf1f;
  border-radius: 8px;
  font-size: 0.98em;
  font-weight: 700;
  padding: 2px 12px;
  margin-bottom: 4px;
  display: inline-block;
}

.atlas-back-container {
  width: 100%;
  max-width: 1140px;
  margin: 1rem auto 0;
  padding: 0 1.25rem;
  position: relative;
}

.atlas-back-btn {
  background-color: #000000;
  color: #8eaf1f;
  border: 1px solid #8eaf1f;
  border-radius: 999px;
  padding: 0.5rem 1.2rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 2;
  display: inline-block;
}

.atlas-back-btn:hover {
  background-color: #8eaf1f;
  color: #000000;
}

.atlas-back-btn:active {
  transform: translateY(1px);
}

.atlas-align-center-col {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.atlas-install-help {
  color: #8eaf1f;
  font-size: 1.05em;
  text-align: center;
  max-width: 420px;
}

.atlas-learn-list {
  max-width: 540px;
}

/* ===== HEADER ===== */
.atlas-header {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.atlas-logo {
  max-width: 100%;
  height: auto;
  max-height: 300px;
  margin-bottom: -80px;
  margin-top: -50px;
}

.atlas-title-wrap {
  margin: 20px;
}

.atlas-main-title {
  color: #8eaf1f;
  text-align: center;
}

.atlas-subtitle {
  color: #8eaf1f;
  font-family: Impact, Haettenschweiler, 'Arial Narrow Bold', sans-serif;
  text-align: center;
}

/* ===== BUTTONS ===== */
.atlas-link-btn {
  background-color: #000000;
  border-color: #000000;
  color: #8eaf1f;
}

.atlas-link-btn:hover,
.atlas-link-btn:focus,
.atlas-link-btn:active {
  background-color: #111111;
  border-color: #111111;
  color: #8eaf1f;
  box-shadow: none;
}

/* ===== BUTTON GROUP ===== */
.atlas-button-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.9rem;
}

.atlas-button-column {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.atlas-spacer {
  visibility: hidden;
  height: 24px;
  margin-bottom: 4px;
}

/* ===== CONTENT ===== */
.atlas-content-shell {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.atlas-hero-copy {
  max-width: 860px;
  margin: 0 auto;
  text-align: center;
}

.atlas-three-up {
  max-width: 1080px;
  margin: 0 auto;
}

/* ===== SUMMARY ===== */
.atlas-summary-points {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem 1rem;
  max-width: 860px;
  margin: 1.25rem auto 0;
  text-align: left;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.atlas-summary-point {
  background: rgba(142, 175, 31, 0.08);
  border: 1px solid rgba(142, 175, 31, 0.22);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  font-size: 0.96rem;
  color: #000000;
}

.atlas-summary-point strong {
  color: #8eaf1f;
  display: block;
  margin-bottom: 0.2rem;
}

/* ===== SPOTLIGHT ===== */
.atlas-spotlight {
  background: linear-gradient(135deg, #000000, #1a1a1a);
  border: 2px solid #8eaf1f;
  border-radius: 18px;
  color: #f3f3f3;
  padding: 2rem;
  margin: 2.5rem auto;
  max-width: 980px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18);
}

.atlas-spotlight h4,
.atlas-spotlight h5 {
  color: #8eaf1f;
}

.h5 {
  color: #8eaf1f;
}

.atlas-spotlight-copy {
  color: #d7d7d7;
}

.atlas-spotlight-copy-block {
  max-width: 860px;
  margin: 0 auto;
  text-align: center;
}

.atlas-spotlight-point {
  background: rgba(142, 175, 31, 0.08);
  border: 1px solid rgba(142, 175, 31, 0.28);
  border-radius: 12px;
  padding: 1rem;
  height: 100%;
}

/* ===== FEATURES ===== */
.atlas-feature-showcase {
  margin-top: 2rem;
}

.feature {
  background: #1e1e1e;
  padding: 1rem;
  border-radius: 10px;
  border: 1px solid #333;
}

.feature strong {
  color: #8eaf1f;
  display: block;
  margin-bottom: 0.5rem;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
  text-align: left;
}

.atlas-feature-showcase .atlas-screenshot-frame {
  max-width: 340px;
  margin-top: 0;
}

.atlas-feature-showcase-copy {
  color: #d7d7d7;
}

.atlas-kicker {
  color: #8eaf1f;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.atlas-section-lead {
  max-width: 820px;
  margin: 0 auto 1rem;
}

.lead {
  font-size: 1.1rem;
  color: #000000;

}

.card-dark li {
  color: #d7d7d7;
}

.info-lead {
  font-size: 1.1rem;
  color: #fff;
}

.lead a {
  color: #8eaf1f;
  font-weight: 600;
  text-decoration: none;
}

/* ===== SCREENSHOTS ===== */
.atlas-screenshot-frame {
  background: linear-gradient(180deg, #202020, #141414);
  border: 1px solid rgba(142, 175, 31, 0.28);
  border-radius: 18px;
  padding: 0.9rem;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.14);
  margin: 1.35rem auto 0;
  max-width: 300px;
}

.atlas-screenshot-frame img {
  display: block;
  width: 100%;
  border-radius: 12px;
}

.atlas-screenshot-caption {
  margin-top: 0.75rem;
  color: #d7d7d7;
  font-size: 0.92rem;
  text-align: left;
}

/* ===== LISTS ===== */
.atlas-compact-list {
  margin-top: 0.9rem;
  padding-left: 1.1rem;
  text-align: left;
}

.atlas-compact-list li {
  margin-bottom: 0.45rem;
  color: #fff;
}

.os-atlas-compact-list li {
  margin-bottom: .45rem;
  color: black;
}

footer {
  margin-top: 1rem;
  padding-bottom: 1rem;
  padding-top: 1rem;
  text-align: center;
  color: #8eaf1f;
  font-size: 0.9rem;
  background-color: #212529;
  width: 100vw;
}

footer p {
  margin: 0 1rem;
}

/* ===== LEARN MORE ===== */
.atlas-learn-more {
  max-width: 1140px;
  margin: 0 auto 2.5rem;
  padding: 0 1.25rem;
  text-align: center;
}

.atlas-learn-more summary {
  list-style: none;
}

.atlas-learn-more summary::-webkit-details-marker {
  display: none;
}

.atlas-learn-more-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.85rem 1.4rem;
  background: #000;
  border: 1px solid #000;
  border-radius: 999px;
  color: #8eaf1f;
  cursor: pointer;
  font-weight: 600;
}

.atlas-learn-more-toggle::after {
  content: "+";
}

.atlas-learn-more[open] .atlas-learn-more-toggle::after {
  content: "-";
}

.atlas-learn-more-content {
  margin-top: 2rem;
}

.atlas-learn-more-anchor {
  scroll-margin-top: 1rem;
}

.atlas-account-actions {
  position: absolute;
  top: 1.1rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  width: 100%;
  max-width: 1140px;
  margin: 0;
  padding: 0 1.25rem;
  z-index: 2;
  pointer-events: none;
}

.atlas-account-actions .btn {
  pointer-events: auto;
}

.atlas-account-actions[hidden] {
  display: none !important;
}

/* ===== TEGU ===== */
.tegu-assistant.hidden {
  display: none;
}

.tegu-assistant {
  position: fixed;
  right: 12px;
  bottom: 2px;
  z-index: 3000;
  display: flex;
  gap: 10px;
}

.tegu-help-btn {
  position: fixed;
  right: 12px;
  bottom: 12px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #8eaf1f;
  color: #000;
  border: none;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
  z-index: 2999;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: 700;
  font-size: 1.05rem;
}

.tegu-help-btn:active {
  transform: translateY(1px);
}

.tegu-img {
  width: 100px;
  height: auto;
  margin-bottom: -30px;
}

.tegu-bubble {
  max-width: 290px;
  background: #1e1e1e;
  color: #e0e0e0;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 0.9rem;
  position: relative;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.25s ease;
  margin-bottom: 30px;
}

.tegu-bubble::after {
  content: "";
  position: absolute;
  bottom: 8px;
  right: -6px;
  width: 12px;
  height: 12px;
  background: #1e1e1e;
  transform: rotate(45deg);
}

.tegu-bubble.show {
  opacity: 1;
  transform: translateY(0);
}

.tegu-bubble {
  max-width: 220px;
}

/* ===== MOBILE ===== */
@media (max-width: 767.98px) {
  .atlas-content-shell {
    padding: 0 1rem;
  }

  .atlas-button-group {
    flex-direction: column;
    align-items: center;
  }

  .atlas-account-actions {
    position: static;
    transform: none;
    justify-content: center;
    margin-bottom: 0.75rem;
  }

  .atlas-summary-points {
    grid-template-columns: 1fr;
  }

  .tegu-bubble {
    max-width: 220px;
  }
}

.carousel-inner {
  max-height: 70vh;
}

.tegu-assistant.hidden {
  display: none;
}

/* Match dark UI */
.pin-table {
  background-color: transparent;
  color: inherit;
  /* uses your page text color */
}

/* Table borders */
.pin-table td,
.pin-table th {
  background-color: transparent;
  color: inherit;
  border-color: rgba(255, 255, 255, 0.2);
  /* softer borders for dark UI */
}

/* Header row */
.pin-table th {
  background-color: rgba(255, 255, 255, 0.05);
  font-weight: 600;
}

/* Key labels (left column) */
.pin-table .key-label {
  font-weight: bold;
  background-color: rgba(255, 255, 255, 0.08);
}

/* Optional: subtle row striping */
.pin-table tr:nth-child(even) td {
  background-color: rgba(255, 255, 255, 0.03);
}

.pin-calc-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.95fr) minmax(0, 1.35fr);
  gap: 16px;
  align-items: start;
}

.pin-calc-panel {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.02);
}

.pin-calc-output-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pin-calc-title {
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  margin-bottom: 10px;
  color: #8eaf1f;
}

.pin-calc-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.pin-calc-output-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-bottom: 2px;
}

.pin-calc-title--center {
  text-align: center;
  width: 100%;
  margin-bottom: 0;
}

.pin-calc-action-field {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 280px;
  min-width: 220px;
}

.pin-calc-action-field label {
  margin-bottom: 0;
  white-space: nowrap;
  font-size: 0.88rem;
  color: #cfd6b5;
}

.pin-calc-action-field--qty {
  flex: 0 0 auto;
  min-width: 0;
}

.pin-calc-action-field--qty input {
  width: 5.5rem;
}

.pin-calc-secondary-actions {
  display: flex;
  justify-content: flex-start;
  align-items: stretch;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.pin-calc-option-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
  min-width: 0;
  flex: 1 1 auto;
}

.pin-calc-option-stack--center {
  align-items: center;
  width: 100%;
}

.pin-calc-output-options {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  width: 100%;
}

.pin-calc-output-options .cylinder-type-options {
  width: auto;
  justify-content: flex-start;
  gap: 0.75rem;
}

.pin-calc-form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  width: 100%;
  align-items: end;
}

.pin-calc-form-grid .pin-calc-action-field {
  margin-bottom: 0;
}

.pin-calc-form-grid .pin-calc-action-field--wide {
  min-width: 0;
}

.pin-calc-bottom-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  width: 100%;
  align-items: end;
}

.pin-calc-secondary-actions .btn {
  margin-left: auto;
  flex: 0 0 auto;
}

.pin-calc-notes-field {
  display: flex;
  align-items: center;
  min-width: 0;
  flex: 1 1 auto;
}

.pin-calc-notes-field--wide {
  width: 100%;
}

.pin-calc-notes-field input {
  width: 100%;
}

/* Ensure key search dropdown is not clipped by sibling panels */
#keySearchContainer {
  overflow: visible !important;
}

#searchResults {
  position: absolute !important;
  top: calc(100% + 0.35rem) !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  max-height: 280px !important;
  overflow-y: auto !important;
  z-index: 3000 !important;
  display: none;
  background: #1e1e1e;
  border: 1px solid #444;
  border-radius: 6px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.45);
}

#searchResults .list-group-item {
  background: transparent;
  color: #e0e0e0;
  border: none;
}

#searchResults .list-group-item:hover {
  background: rgba(142,175,31,0.08);
  color: #fff;
}

/* Pin-key list and buttons for pinstack calculator */
.pin-key-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.pin-key-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(142, 175, 31, 0.06);
  border: 1px solid rgba(142, 175, 31, 0.14);
  color: #e0e0e0;
  padding: 0.35rem 0.6rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.92rem;
}

.pin-key-btn span {
  color: inherit;
  white-space: nowrap;
}

.pin-key-btn button {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.08);
  color: #e0e0e0;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.pin-key-btn button:hover {
  background: #ff5c5c;
  border-color: #ff5c5c;
  color: #fff;
}

/* Control key style variant (non-removable) */
.pin-key-btn.is-control {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  color: #cfd6b5;
}

.pin-key-btn.is-control button {
  display: none;
}

@media (max-width: 420px) {
  .pin-key-btn { font-size: 0.86rem; padding: 0.28rem 0.45rem; }
  .pin-key-btn button { width: 20px; height: 20px; }
}




.pin-key-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 42px;
}

.pin-key-bittings {
  margin-top: 10px;
  overflow-x: auto;
}

.pin-key-bittings .pin-table {
  margin-bottom: 0;
  width: 100%;
}

.pin-key-bittings .pin-table td,
.pin-key-bittings .pin-table th {
  padding: 0.3rem 0.45rem;
  font-size: 0.9rem;
}

.pin-output-wrap {
  overflow-x: auto;
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  text-align: center;
}

.pin-output-wrap .pin-table {
  margin-bottom: 0;
  margin-left: auto;
  margin-right: auto;
}

.pin-output-actions {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin-top: 12px;
  min-width: 0;
}

.pin-output-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.pin-output-actions .btn {
  flex: 0 0 auto;
}

.pin-calc-shortcuts {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  margin-top: 14px;
}

.cylinder-type-options {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  margin-bottom: 0;
  width: 100%;
  min-width: 0;
}

.cylinder-type-options .form-check {
  flex: 0 0 auto;
  margin-bottom: 0;
}

.pin-calc-toggle-line {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: nowrap;
  white-space: nowrap;
  min-width: 0;
  padding-left: 0;
  margin-left: 0;
}

.pin-calc-toggle-line .form-check-input {
  margin: 0;
  margin-left: 0;
  margin-top: 0;
  flex: 0 0 auto;
  float: none;
  align-self: center;
}

.pin-calc-toggle-line .form-check-label {
  display: inline-flex;
  align-items: center;
  margin: 0;
  line-height: 1;
  white-space: nowrap;
}

.pin-calc-conventional-row {
  margin-bottom: 0;
}

.virtual-clipboard-panel {
  margin-top: 18px;
}

.virtual-clipboard-entry-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 14px;
}

.virtual-clipboard-entry {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  padding: 12px;
}

.virtual-clipboard-entry-header {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.virtual-clipboard-entry-text {
  margin: 0;
  white-space: pre-wrap;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.9rem;
  line-height: 1.45;
  color: #e0e0e0;
}

.virtual-clipboard-summary {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  padding: 12px;
  margin-bottom: 14px;
}

.virtual-clipboard-summary-title {
  font-weight: 700;
  color: #cfd6b5;
  margin-bottom: 8px;
}

.virtual-clipboard-summary-group {
  margin-bottom: 8px;
}

.virtual-clipboard-summary-group:last-child {
  margin-bottom: 0;
}

.virtual-clipboard-summary-label {
  font-weight: 600;
  color: #cfd6b5;
  margin-right: 8px;
}

.virtual-clipboard-filter-bar {
  display: flex;
  align-items: stretch;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.virtual-clipboard-filter-field {
  flex: 1 1 320px;
  min-width: 0;
}

.virtual-clipboard-empty-state {
  border: 1px dashed rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  padding: 12px;
  color: #cfd6b5;
  text-align: center;
  background: rgba(255, 255, 255, 0.02);
}

.virtual-clipboard-box {
  width: 100%;
  resize: none;
  overflow: hidden;
  background-color: #161616;
  color: #e0e0e0;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  padding: 0.9rem;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.92rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: normal;
  overflow-wrap: normal;
  tab-size: 2;
}

.pin-table td,
.pin-table th {
  padding: 0.4rem 0.5rem;
}

@media (max-width: 768px) {
  .pin-calc-layout {
    grid-template-columns: 1fr;
  }

  .pin-calc-actions {
    flex-wrap: wrap;
  }

  .pin-calc-form-grid {
    grid-template-columns: 1fr;
  }

  #gmkRuleButtons,
  #masterRuleButtons,
  #changeRuleButtons {
    gap: 0.12rem;
  }

  #gmkRuleButtons .rule-btn,
  #masterRuleButtons .rule-btn,
  #changeRuleButtons .rule-btn {
    min-width: 0;
    padding: 0.3rem 0.45rem;
    font-size: 0.8rem;
  }
}

@media (max-width: 420px) {
  .pin-calc-bottom-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .cylinder-type-options {
    flex-wrap: wrap;
    gap: 0.6rem;
  }

  #gmkRuleButtons,
  #masterRuleButtons,
  #changeRuleButtons {
    gap: 0.08rem;
  }

  #gmkRuleButtons .rule-btn,
  #masterRuleButtons .rule-btn,
  #changeRuleButtons .rule-btn {
    padding: 0.25rem 0.3rem;
    font-size: 0.76rem;
  }
}

input.form-control::placeholder,
textarea.form-control::placeholder,
select.form-select option:disabled {
  color: #686868 !important;
  opacity: 1;
}

/* Tegu assistant container */
.tegu-assistant {
  position: fixed;
  top: auto;
  bottom: 2px;
  right: 12px;
  z-index: 3000;
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.header-logo {
  max-width: 100%;
  height: auto;
  max-height: 210px;
  margin-bottom: -44px;
  margin-top: -26px;
}

/* Help button (fixed lower-right) */
.tegu-help-btn {
  position: fixed;
  right: 12px;
  bottom: 12px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #8eaf1f;
  color: #000;
  border: none;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
  z-index: 2999;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: 700;
  font-size: 1.05rem;
}

.tegu-help-btn:active {
  transform: translateY(1px);
}

/* Tegu image */
.tegu-img {
  width: 100px;
  height: auto;
  margin-bottom: -30px;
}

/* Speech bubble */
.tegu-bubble {
  max-width: 260px;
  background: #1e1e1e;
  color: #e0e0e0;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 0.9rem;
  position: relative;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.25s ease;
  margin-bottom: 30px;
}

/* Bubble arrow */
.tegu-bubble::after {
  content: "";
  position: absolute;
  bottom: 8px;
  right: -6px;
  width: 12px;
  height: 12px;
  background: #1e1e1e;
  transform: rotate(45deg);
}

/* Visible state */
.tegu-bubble.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 768px) {
  .header-wrap {
    text-align: center;
  }

  .header-copy {
    margin-left: 0 !important;
    margin-top: 10px !important;
  }

  .tree-key-status-field {
    max-width: none;
  }

  .tree-key-status-buttons {
    width: 100%;
  }

  .tree-key-status-buttons .btn {
    flex: 1 1 8rem;
  }
}

/* Dark theme base */
body {
  background-color: #121212;
  color: #e0e0e0;
  /* readable contrast */
}

/* Card backgrounds */
.card,
.card-body,
.card-header {
  background-color: #1e1e1e !important;
  color: #e0e0e0 !important;
}

.card-dark {
  background: linear-gradient(135deg, #1a1a1a, #0f0f0f);
  border: 1px solid rgba(142, 175, 31, 0.25);
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

/* Inputs */
input.form-control,
select.form-select {
  background-color: #2c2c2c;
  color: #e0e0e0;
  border: 1px solid #444;
}

input.form-control:focus,
select.form-select:focus {
  background-color: #2c2c2c;
  color: #fff;
  border-color: #0d6efd;
  box-shadow: none;
}

.atlas-shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.25rem;
}

.atlas-btn {
  background: #8eaf1f;
  color: #000;
  font-weight: 700;
  border: none;
  padding: 12px 18px;
  border-radius: 8px;
  text-decoration: none;
  margin-top: 1rem;
  cursor: pointer;
  display: block;
  margin: 1.5rem auto 0;
}

.atlas-btn:hover {
  background: #a2c92d;
}

/* Buttons */
.btn-atlas,
.btn-secondary,
.btn-primary,
.btn-success {
  background-color: #8eaf1f;
  border-color: #000;
  color: #000;
  font-weight: 700;
}

.btn-atlas:hover,
.btn-atlas:focus,
.btn-secondary:hover,
.btn-secondary:focus,
.btn-primary:hover,
.btn-primary:focus,
.btn-success:hover,
.btn-success:focus {
  background-color: #a2c92d;
  border-color: #000;
  color: #000;
  box-shadow: none;
}

.generate-system-btn {
  font-weight: 500;
}

.btn-outline-dark {
  color: #e0e0e0;
  border-color: #555;
}

.btn-outline-dark:hover {
  background-color: #0d6efd;
  color: #fff;
}

/* Remove focus outline from all buttons (random GMK & generate system) */
button,
button:focus,
button:focus-visible,
button:active,
.btn,
.btn:focus,
.btn:focus-visible,
.btn:active,
.btn-outline-dark:focus,
.btn-outline-dark:focus-visible,
.btn-outline-dark:active,
.btn-primary:focus,
.btn-primary:focus-visible,
.btn-primary:active,
.btn-success:focus,
.btn-success:focus-visible,
.btn-success:active,
.btn-info:focus,
.btn-info:focus-visible,
.btn-info:active {
  outline: none !important;
  box-shadow: none !important;
  border-color: inherit !important;
}

button:focus::-moz-focus-inner,
.btn:focus::-moz-focus-inner {
  border: 0 !important;
}

/* Checkbox */
.form-check-input {
  background-color: #2c2c2c;
  border-color: #555;
}

.form-check-input:checked {
  background-color: #0d6efd;
  border-color: #0d6efd;
}

/* Tree view */
.tree details summary {
  color: #e0e0e0;
}

.key-bitting {
  color: inherit;
}

.tree-key-status-toolbar {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.tree-key-status-field {
  flex: 1 1 24rem;
  min-width: 18rem;
  max-width: 34rem;
}

.tree-key-status-buttons {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tree-key-status-buttons .btn {
  min-width: 7rem;
  border-color: rgba(255, 255, 255, 0.2);
  color: #e0e0e0;
  background-color: transparent;
}

.tree-key-status-buttons .btn:hover,
.tree-key-status-buttons .btn:focus,
.tree-key-status-buttons .btn.active {
  background-color: #8eaf1f;
  border-color: #000;
  color: #000;
  box-shadow: none;
}

.tree-key-status-help {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
}

.key-status-available {
  color: #e0e0e0 !important;
}

.key-status-activated {
  color: #8eaf1f !important;
}

.key-status-deactivated {
  color: #dc3545 !important;
}

/* Scrollbars */
#searchResults,
#virtualClipboardFilterResults,
#treeKeyStatusResults {
  max-height: 240px;
  overflow-y: auto;
  background-color: #121212;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 0.375rem;
}

#searchResults .list-group-item,
#virtualClipboardFilterResults .list-group-item,
#treeKeyStatusResults .list-group-item {
  background-color: #121212;
  color: #e0e0e0;
  border-color: rgba(255, 255, 255, 0.12);
}

#searchResults .list-group-item:hover,
#searchResults .list-group-item:focus,
#virtualClipboardFilterResults .list-group-item:hover,
#virtualClipboardFilterResults .list-group-item:focus,
#treeKeyStatusResults .list-group-item:hover,
#treeKeyStatusResults .list-group-item:focus {
  background-color: #1e1e1e;
  color: #ffffff;
}

#searchResults::-webkit-scrollbar,
#virtualClipboardFilterResults::-webkit-scrollbar,
#treeKeyStatusResults::-webkit-scrollbar {
  width: 8px;
}

#searchResults::-webkit-scrollbar-thumb,
#virtualClipboardFilterResults::-webkit-scrollbar-thumb,
#treeKeyStatusResults::-webkit-scrollbar-thumb {
  background-color: #555;
  border-radius: 4px;
}

#searchResults::-webkit-scrollbar-track,
#virtualClipboardFilterResults::-webkit-scrollbar-track,
#treeKeyStatusResults::-webkit-scrollbar-track {
  background-color: #2c2c2c;
}

#systemCodeDisplay input::placeholder {
  color: #686868;
  opacity: 1;
}

input::placeholder,
textarea::placeholder,
select::placeholder {
  color: #686868;
  opacity: 1;
}

#gmkRuleButtons,
#masterRuleButtons,
#changeRuleButtons {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.16rem;
  overflow: hidden;
  width: 100%;
  box-sizing: border-box;
  padding-right: 0.2rem;
}

/* Ensure all progression rule buttons match across all rows */
#gmkRuleButtons .rule-btn,
#masterRuleButtons .rule-btn,
#changeRuleButtons .rule-btn {
  background-color: transparent;
  color: #e0e0e0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  min-width: 44px;
  flex: 1 1 0;
  text-align: center;
  transition: all 0.15s ease;
}

#gmkRuleButtons .rule-btn:hover,
#masterRuleButtons .rule-btn:hover,
#changeRuleButtons .rule-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
}

#gmkRuleButtons .rule-btn.btn-secondary,
#masterRuleButtons .rule-btn.btn-secondary,
#changeRuleButtons .rule-btn.btn-secondary {
  background-color: #6c757d;
  color: #fff;
  border-color: #6c757d;
}

#gmkRuleButtons .rule-btn.btn-secondary:hover,
#masterRuleButtons .rule-btn.btn-secondary:hover,
#changeRuleButtons .rule-btn.btn-secondary:hover {
  background-color: #5a6268;
  border-color: #5a6268;
}

.progression-table {
  width: 100% !important;
  table-layout: fixed !important;
  border-collapse: separate;
  border-spacing: 0;
  margin: 0;
  min-width: 0 !important;
}

.progression-table th,
.progression-table td {
  word-break: break-word;
  padding: 0.5em 0.2em;
  min-width: 0 !important;
  max-width: none !important;
}

.table-responsive {
  width: 100% !important;
  overflow-x: auto;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

#progressionChart,
#progressionChartSection {
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

.upc-card-body {
  padding-left: 0 !important;
  padding-right: 0 !important;
}

@media (max-width: 600px) {
  .header-logo {
    max-width: 90vw;
    max-height: 80px;
    margin-bottom: -20px;
    margin-top: -10px;
  }

  .header-copy h1,
  .header-copy h2 {
    font-size: 1.1em !important;
    text-align: center;
  }

  .header-wrap {
    flex-direction: column;
    align-items: center;
    padding: 0 2vw;
  }

  .container,
  .card {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  #progressionCard.card {
    max-width: 99vw !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-shadow: none;
  }

  .upc-card-body {
    padding: 1em 0.5em !important;
  }

  .form-label,
  label,
  .known-cuts-label {
    font-size: 1em !important;
  }

  .form-select,
  .form-control,
  .bitting-btn {
    font-size: 1em !important;
    min-width: 2.2em;
    min-height: 2.2em;
  }

  .input-group-sm>.form-control,
  .input-group-sm>.form-select,
  .input-group-sm>.input-group-text,
  .input-group-sm>.btn {
    font-size: 1em !important;
    padding: 0.25em 0.5em !important;
  }

  .centered-section,
  .centered-known-cuts {
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.25em !important;
  }

  .centered-known-cuts>div,
  .centered-known-cuts>input {
    margin-right: 0.1em !important;
    margin-bottom: 0.2em !important;
  }

  .centered-known-cuts input.form-control {
    width: 1.8em !important;
    min-width: 1.5em !important;
    max-width: 2.2em !important;
    font-size: 0.95em !important;
    padding: 0.15em 0.1em !important;
  }

  .centered-known-cuts div {
    width: 2em !important;
    min-width: 1.5em !important;
    max-width: 2.2em !important;
    font-size: 0.95em !important;
    padding: 0.05em 0 !important;
  }

  .progression-table th,
  .progression-table td {
    font-size: 0.95em !important;
    padding: 0.3em 0.2em !important;
  }

  .progression-table {
    min-width: 400px;
    font-size: 0.95em;
  }

  .d-grid.mt-3 {
    margin-top: 1em !important;
  }
}

/* .progression-table { overflow-x: auto; display: block; } -- removed to allow table to fill width */
.bitting-btn {
  background-color: #8eaf1f;
  color: #000;
  border: 1px solid #000;
  font-weight: 700;
  border-radius: 4px;
  width: 100%;
  height: 100%;
  padding: 0.1em 0;
  margin: 0;
  font: inherit;
  text-align: center;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.bitting-btn.eliminated-bitting {
  background-color: #a82323 !important;
  color: #fff !important;
  text-decoration: line-through;
}

body {
  background-color: #121212;
  color: #e0e0e0;
}

.card,
.upc-card-body,
.card-header {
  background-color: #1e1e1e !important;
  color: #e0e0e0 !important;
}

input.form-control,
select.form-select {
  background-color: #2c2c2c;
  color: #e0e0e0;
  border: 1px solid #444;
}

/* Hide number input spinners/arrows for all browsers */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type=number] {
  -moz-appearance: textfield;
}

input.form-control:focus,
select.form-select:focus {
  background-color: #2c2c2c;
  color: #fff;
  border-color: #0d6efd;
  box-shadow: none;
}

.btn-atlas,
.btn-secondary,
.btn-primary,
.btn-success {
  background-color: #8eaf1f;
  border-color: #000;
  color: #000;
  font-weight: 700;
}

.btn-atlas:hover,
.btn-atlas:focus,
.btn-secondary:hover,
.btn-secondary:focus,
.btn-primary:hover,
.btn-primary:focus,
.btn-success:hover,
.btn-success:focus {
  background-color: #a2c92d;
  border-color: #000;
  color: #000;
  box-shadow: none;
}

.btn-outline-dark {
  color: #e0e0e0;
  border-color: #555;
}

.btn-outline-dark:hover {
  background-color: #0d6efd;
  color: #fff;
}

button,
button:focus,
button:focus-visible,
button:active,
.btn,
.btn:focus,
.btn:focus-visible,
.btn:active,
.btn-outline-dark:focus,
.btn-outline-dark:focus-visible,
.btn-outline-dark:active,
.btn-primary:focus,
.btn-primary:focus-visible,
.btn-primary:active,
.btn-success:focus,
.btn-success:focus-visible,
.btn-success:active,
.btn-info:focus,
.btn-info:focus-visible,
.btn-info:active {
  outline: none !important;
  box-shadow: none !important;
  border-color: inherit !important;
}

.form-check-input {
  background-color: #2c2c2c;
  border-color: #555;
}

.form-check-input:checked {
  background-color: #0d6efd;
  border-color: #0d6efd;
}

label {
  color: #cfd6b5;
}

.error-msg {
  color: #dc3545;
  font-size: 0.95em;
  margin-top: 4px;
}

.known-cuts-label {
  font-weight: 600;
  color: #8eaf1f;
  margin-bottom: 6px;
}

.progression-table th,
.progression-table td {
  text-align: center;
}

.progression-table {
  background-color: #232323;
  color: #e0e0e0;
  border-color: #444;
}

.progression-table th {
  background-color: #2c2c2c;
  color: #8eaf1f;
  font-weight: 700;
  border-bottom: 2px solid #8eaf1f;
}

.progression-table td {
  background-color: #232323;
  color: #e0e0e0;
  border-color: #444;
}

.progression-table tr {
  border-bottom: 1px solid #444;
}

.progression-table tbody tr:nth-child(even) td {
  background-color: #262b1a;
}

.progression-table tbody tr:hover td {
  background-color: #323c1f;
  color: #fff;
}

.progression-table thead th {
  border-top: none;
}

.progression-table td {
  font-size: 1.08em;
}

/* Centering for dropdown and known cuts */
.centered-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.centered-known-cuts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

/* Pin-key list and buttons for pinstack & generator calculators */
.pin-key-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.pin-key-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(142, 175, 31, 0.06);
  border: 1px solid rgba(142, 175, 31, 0.14);
  color: #e0e0e0;
  padding: 0.35rem 0.6rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.92rem;
}

.pin-key-btn span {
  color: inherit;
  white-space: nowrap;
}

.pin-key-btn button {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.08);
  color: #e0e0e0;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.pin-key-btn button:hover {
  background: #ff5c5c;
  border-color: #ff5c5c;
  color: #fff;
}

/* Control key style variant (non-removable) */
.pin-key-btn.is-control {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  color: #cfd6b5;
}

.pin-key-btn.is-control button {
  display: none;
}

@media (max-width: 420px) {
  .pin-key-btn { font-size: 0.86rem; padding: 0.28rem 0.45rem; }
  .pin-key-btn button { width: 20px; height: 20px; }
}

/* Ensure key search dropdown is not clipped by sibling panels */
#keySearchContainer {
  overflow: visible !important;
}

#searchResults {
  position: absolute !important;
  top: calc(100% + 0.35rem) !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  max-height: 280px !important;
  overflow-y: auto !important;
  z-index: 3000 !important;
  display: none;
  background: #1e1e1e;
  border: 1px solid #444;
  border-radius: 6px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.45);
}

#searchResults .list-group-item {
  background: transparent;
  color: #e0e0e0;
  border: none;
}

#searchResults .list-group-item:hover {
  background: rgba(142,175,31,0.08);
  color: #fff;
}

.header-logo {
  max-width: 100%;
  height: auto;
  max-height: 210px;
  margin-bottom: -44px;
  margin-top: -26px;
}

.header-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.header-copy {
  margin-left: 20px;
  margin-top: 20px;
}

@media (max-width: 768px) {
  .header-wrap {
    text-align: center;
  }

  .header-copy {
    margin-left: 0 !important;
    margin-top: 10px !important;
  }
}

.tegu-assistant.hidden {
  display: none;
}

.tegu-assistant {
  position: fixed;
  right: 12px;
  bottom: 2px;
  z-index: 3000;
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.tegu-help-btn {
  position: fixed;
  right: 12px;
  bottom: 12px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #8eaf1f;
  color: #000;
  border: none;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
  z-index: 2999;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: 700;
  font-size: 1.05rem;
}

.tegu-help-btn:active {
  transform: translateY(1px);
}

.tegu-img {
  width: 100px;
  height: auto;
  margin-bottom: -30px;
}

.tegu-bubble {
  max-width: 290px;
  background: #1e1e1e;
  color: #e0e0e0;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 0.9rem;
  position: relative;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.25s ease;
  margin-bottom: 30px;
}

.tegu-bubble::after {
  content: "";
  position: absolute;
  bottom: 8px;
  right: -6px;
  width: 12px;
  height: 12px;
  background: #1e1e1e;
  transform: rotate(45deg);
}

.tegu-bubble.show {
  opacity: 1;
  transform: translateY(0);
}