/* Page-specific form styles also set font shorthands. Keep closed values consistent. */
select:not([multiple]):is(:not([size]), [size="1"]), .axis-caption {
  font-size: 1rem !important;
  font-weight: 510 !important;
}
select { text-overflow: ellipsis; }
#layer-current-name,
.registry-inline-picker {
  font-size: 1.05em;
}
.registry-inline-picker {
  font-weight: 510;
}

.atlas-picker {
  position: fixed;
  inset: auto;
  margin: 0;
  padding: 4px;
  min-width: 0;
  max-width: calc(100vw - 16px);
  border: 1px solid #bbc7b6;
  border-radius: 9px;
  background: #fffdf6;
  color: var(--ink);
  box-shadow: 0 7px 24px #19382830;
  overflow: hidden;
}
.atlas-picker:popover-open, .atlas-picker[open] { display: flex; flex-direction: column; }
.atlas-picker::backdrop { background: transparent; }
.atlas-picker:modal {
  inset: auto 0 0;
  width: 100%;
  max-width: none;
  max-height: min(80dvh, 620px);
  padding: 12px 15px max(16px, env(safe-area-inset-bottom));
  border-radius: 16px 16px 0 0;
}
.atlas-picker:modal::backdrop { background: #19382e65; }
html:has(.atlas-picker:modal) { overflow: hidden; }
.atlas-picker-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.atlas-picker-head strong { font-size: 1.15rem; }
.atlas-picker-head button { width: 44px; height: 44px; font-size: 1.5rem; }
.atlas-picker-search { position: relative; margin: 3px 3px 6px; }
.atlas-picker-search svg {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; fill: none; stroke: var(--muted); stroke-width: 1.7; pointer-events: none;
}
.atlas-picker-search input {
  width: 100%; min-height: 40px; padding: 6px 10px 6px 34px;
  border: 1px solid var(--line); border-radius: 5px; background: #faf9f1; color: inherit; font: inherit;
}
.atlas-picker-list { min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #b7c2b1 transparent; }
.atlas-picker:modal .atlas-picker-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 2px; max-height: 48dvh; }
.atlas-picker-option {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  padding: 8px 10px; min-height: 38px; border-radius: 4px; line-height: 1.25; overflow-wrap: anywhere; cursor: pointer;
}
.atlas-picker-option[aria-selected=true] { background: #dfebdc; color: #174d3e; font-weight: 650; }
.atlas-picker-option[aria-selected=true]::after { content: ""; width: 6px; height: 11px; flex: none; border: solid currentColor; border-width: 0 2px 2px 0; transform: translateY(-2px) rotate(45deg); }
.atlas-picker-option[aria-disabled=true] { opacity: .55; cursor: default; }
@media (hover: hover) { .atlas-picker-option:hover:not([aria-selected=true]):not([aria-disabled=true]) { background: #eff2e8; } }
.atlas-picker-list:focus { outline: none; }
.atlas-picker-option.is-active { outline: 2px solid #aa6a37; outline-offset: -2px; }
.atlas-picker-empty { margin: 5px 10px 8px; color: var(--muted); }
@media (max-width: 600px) { .atlas-picker-option { min-height: 44px; } }

.atlas-select-trigger { cursor: pointer; min-width: 0; max-width: 100%; }
.atlas-select-trigger:not(.registry-inline-picker,.axis-control) { display: inline-grid; }
.atlas-select-trigger:has(> select[hidden]) { display: none; }
.atlas-select-trigger > select { pointer-events: none; }
.atlas-select-trigger:focus-visible { outline: 3px solid #ca8138; outline-offset: 2px; border-radius: 4px; }
.atlas-select-trigger[aria-disabled=true] { cursor: default; }
.pair-heading .atlas-select-trigger { max-width: 48%; }
.pair-heading .atlas-select-trigger select { max-width: 100%; }
#feedback-form .note-heading .atlas-select-trigger { max-width: 52%; }
#feedback-form .note-heading .atlas-select-trigger select { max-width: 100%; }
@media (max-width:760px) {
  #compare .pair-heading .atlas-select-trigger { max-width: none; }
}
.atlas-picker:modal { height: min(68dvh, 620px); box-sizing: border-box; }
.atlas-picker:modal .atlas-picker-list { max-height: none; align-content: start; }
.atlas-picker-head, .atlas-picker-search { flex-shrink: 0; }

@media (orientation: landscape) and (max-height: 500px) and (pointer: coarse) {
  .atlas-picker:modal {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    align-items: center;
    gap: 4px 12px;
    height: 90dvh;
    padding: 4px max(12px, env(safe-area-inset-right)) max(4px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  }
  .atlas-picker:modal .atlas-picker-head,
  .atlas-picker:modal .atlas-picker-search { margin: 0; }
  .atlas-picker:modal .atlas-picker-list,
  .atlas-picker:modal .atlas-picker-empty { grid-column: 1 / -1; grid-row: 2; }
  .atlas-picker:modal .atlas-picker-list { align-self: stretch; }
  .atlas-picker:modal .atlas-picker-option { min-height: 44px; }
}

@media (max-width: 760px) {
  #compare-card .compare-selects {
    display: flex;
    flex-wrap: wrap;
  }
  #compare-card .compare-selects label {
    display: grid;
    flex: 1 1 max-content;
    max-width: 100%;
  }
  #compare-card .compare-selects .atlas-select-trigger {
    position: relative;
    min-height: 41px;
    margin-top: 4px;
  }
  /* Reserve the width of the selected name plus the native arrow and padding. */
  #compare-card .compare-selects .atlas-select-trigger::after {
    content: attr(data-selected-label);
    grid-area: 1 / 1;
    visibility: hidden;
    white-space: nowrap;
    font: 510 1rem var(--typeface);
    padding-inline: 1.4rem;
  }
  #compare-card .compare-selects .atlas-select-trigger > select {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding-inline: 9px 12px;
  }
}
