.l34d-opening-chip,
.pickup-only-chip {
  --launch-ink: #f5cb80;
  --launch-edge: #9f753b;
  --launch-plate: #261c11;
  --launch-highlight: #c291514d;
  position: absolute;
  z-index: 2;
  left: var(--l34d-launch-x, 50%);
  top: var(--l34d-launch-y, 50%);
  translate: -50% -50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: max-content;
  min-height: 27px;
  margin: 0;
  padding: 2px 12px;
  border: 1px solid var(--launch-edge);
  border-radius: 4px;
  background: var(--launch-plate);
  box-shadow: inset 0 1px var(--launch-highlight);
  color: var(--launch-ink);
  font: 700 13px/1.2 system-ui, sans-serif;
  white-space: nowrap;
  pointer-events: none;
}

.pickup-only-chip {
  --launch-ink: #a8eeea;
  --launch-edge: #5c9996;
  --launch-plate: #102626;
  --launch-highlight: #8ad4cd55;
}

.l34d-opening-chip[data-l34d-launch-clear="false"],
.pickup-only-chip[data-l34d-launch-clear="false"] {
  visibility: hidden;
}

header[data-l34d-launch-anchor] {
  position: relative;
}

header a.l34d-header-search {
  display: inline-flex;
  flex: 0 0 34px;
  min-width: 34px;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 5px;
  color: inherit;
  text-decoration: none;
}

header a.l34d-header-search:hover,
header a.l34d-header-search:focus-visible {
  background: #8090a324;
}

.aimee-pet-root :is(.aimee-pet-settings-button, .aimee-pet-settings) {
  translate: 0 var(--l34d-droid-clearance, 0px);
}

.aimee-pet-root[data-l34d-droid-clearance] .aimee-pet-settings {
  max-height: max(100px, calc(100dvh - var(--l34d-droid-dialog-top) - 8px)) !important;
}

body:has(.aimee-pet-settings-button) .readiness-ribbon-anchor:not([data-placement="card"]) .readiness-tooltip {
  right: 40px;
  max-width: calc(100vw - 52px);
}

.l34d-readiness-band {
  display: flex;
  justify-content: flex-end;
  position: relative;
  min-height: 36px;
  background: #0b0b0f;
}

.l34d-readiness-band .readiness-ribbon-anchor { position: relative; z-index: 20; }
.l34d-readiness-band .readiness-ribbon {
  display: grid;
  grid-template-columns: repeat(2, minmax(56px, auto));
  min-height: 36px;
  padding: 0;
  border: 1px solid var(--readiness-accent);
  border-radius: 0 0 0 4px;
  background: #101014;
  color: white;
  font: 700 13px/1 system-ui, sans-serif;
  cursor: pointer;
}
.l34d-readiness-band .readiness-ribbon > span { display: grid; place-items: center; padding-inline: 6px; }
.l34d-readiness-band .readiness-ribbon > span + span { color: var(--readiness-accent); border-left: 1px solid var(--readiness-accent); }
.l34d-readiness-band .readiness-ribbon:focus-visible { outline: 2px solid white; outline-offset: -3px; }
.l34d-readiness-band .readiness-tooltip {
  position: absolute;
  top: calc(100% + 6px);
  right: 8px;
  width: min(280px, calc(100vw - 24px));
  padding: 9px 11px;
  border: 1px solid var(--readiness-accent);
  border-radius: 4px;
  background: #101014;
  color: #e5dfe7;
  font: 12px/1.45 system-ui, sans-serif;
  visibility: hidden;
  pointer-events: none;
}
.l34d-readiness-band .readiness-ribbon:is(:hover, :focus-visible, [aria-expanded="true"]) + .readiness-tooltip {
  visibility: visible;
}

header a.l34d-header-search:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: -2px;
}

.l34d-manual-header > .l34d-manual-controls:not([hidden]) {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

@media screen and (max-width: 640px) {
  header.l34d-manual-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 0;
    align-items: center;
    gap: 4px 6px;
    padding: 6px 10px;
  }

  .l34d-manual-header > :is(strong, .brand) {
    min-width: 0;
    grid-area: 1 / 1;
  }

  .l34d-manual-header > strong > a {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 32px;
  }

  .l34d-manual-header > :is(strong, .brand) { font-size: 13px; }
  .l34d-manual-header > :is(strong, .brand) img { width: 24px; height: 24px; }
  .l34d-manual-header > strong img { vertical-align: middle; margin-inline-end: 4px; }
  .l34d-manual-header > .brand > span { overflow: hidden; text-overflow: ellipsis; }

  header.l34d-manual-header > a.l34d-header-search {
    grid-area: 1 / 2;
    justify-self: end;
    min-height: 34px;
  }

  .l34d-manual-header > .l34d-header-droid { display: none; }

  .l34d-manual-header > .l34d-manual-controls:not([hidden]) {
    display: grid;
    grid-area: 2 / 1 / auto / -1;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 4px;
  }

  .l34d-manual-controls > label:has(input, select) {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    font-size: 13px;
  }

  .l34d-manual-controls :is(button, input, select) {
    box-sizing: border-box;
    min-block-size: 34px;
    margin: 0;
  }

  .l34d-manual-controls :is(input, select) {
    width: 100%;
    min-width: 0;
    font-size: 16px;
  }

  .l34d-manual-controls :is(#pageSelect, #choose-chapter) { max-width: 100%; }
  .l34d-manual-controls button { padding: 3px 8px; white-space: nowrap; font-size: 13px; }
  .l34d-manual-controls .manual-print-extra { display: none; }
}

@media (max-width: 560px) {
  .l34d-opening-chip,
  .pickup-only-chip {
    min-height: 25px;
    padding-inline: 9px;
    font-size: 11px;
  }
}
