body {
  margin: 0;
  font-family: 'Courier New', Courier, monospace;
  font-size: 14px;
}

/* Form controls don't inherit fonts by default */
button, input, select { font: inherit; }

/* MapLibre's attribution text in the corner */
.maplibregl-map { font-family: inherit; }
#map { width: 100vw; height: 100vh; }


/* Panel + bag photos share one row along the top that scrolls sideways,
   so scrolling right slides the panel off to the left */
#strip {
  position: absolute;
  top: 16px;
  left: 0;
  right: 0;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  overflow-x: auto;
  padding: 0 16px 10px;
  pointer-events: none;   /* the empty part of the row lets you drag the map */
}

#strip > * { pointer-events: auto; }

#strip.scrolls { pointer-events: auto; }

/* An always-visible scrollbar under the row (Chrome, Safari, Edge) */
#strip::-webkit-scrollbar { height: 8px; }
#strip::-webkit-scrollbar-track { background: rgba(27, 27, 27, 0.15); border-radius: 4px; margin: 0 16px; }
#strip::-webkit-scrollbar-thumb { background: #1b1b1b; border-radius: 4px; }

/* Firefox has no ::-webkit-scrollbar, so it gets the standard properties */
@supports not selector(::-webkit-scrollbar) {
  #strip { scrollbar-width: thin; scrollbar-color: #1b1b1b rgba(27, 27, 27, 0.15); }
}

#bags { display: flex; gap: 8px; }

#bags[hidden] { display: none; }

#bags .seat { flex-shrink: 0; }

.bag {
  display: block;
  height: var(--card-height, 205px);   /* set from the panel's height in script.js */
  width: auto;
  aspect-ratio: 5 / 4;
  object-fit: cover;
  background: #fff;
}

/* Empty seats are square images with their own margin */
.bag.empty { aspect-ratio: 1 / 1; border-radius: 0; background: none; }

#transfer-dialog {
  border: none;
  border-radius: 12px;
  padding: 20px;
  max-width: 360px;
}

#transfer-dialog:focus { outline: none; }

#transfer-dialog::backdrop { background: rgba(0, 0, 0, 0.4); }

.info {
  border: none;
  border-radius: 12px;
  padding: 24px;
  max-width: 380px;
  line-height: 1.4;
}

.info::backdrop { background: rgba(0, 0, 0, 0.4); }

.info h2 { margin: 0 32px 12px 0; font-size: 18px; }

.info h2 ~ h2 { margin-top: 20px; }

.info ul { margin: 0 0 12px; padding-left: 18px; font-size: 14px; color: #333; }

.info li + li { margin-top: 8px; }

.info p { margin: 0 0 12px; font-size: 14px; color: #333; }

.info .intro-label { margin-bottom: 6px; font-weight: bold; color: #090909; }

.info a { color: #090909; }

.info .close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  padding: 0;
  border: none;
  border-radius: 2px;
  background: none;
  font-size: 24px;
  line-height: 1;
  color: #666;
  cursor: pointer;
}

/* keyboard users still see where they are, as a neat square */
.info .close:focus-visible { outline: 2px solid #090909; outline-offset: 0; }

/* the window itself takes focus when it opens, so it needs no ring */
.info:focus { outline: none; }

/* long text (the about window) scrolls inside the window */
.info { max-height: 85vh; overflow-y: auto; }

.info .proceed {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 10px;
  border: none;
  border-radius: 8px;
  background: #090909;
  color: #fff;
  font-weight: bold;
  cursor: pointer;
}

.question { margin: 0 0 12px; font-size: 18px; font-weight: bold; }

#transfer-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

#transfer-options button {
  text-align: left;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 8px;
  background: #fff;
  font: inherit;
  cursor: pointer;
}


/* Each bag looks like an old torn sticker: the piece's shape cuts the tile,
   and its creases and paper fibres are blended onto the photo */
.seat {
  position: relative;
  --sticker: var(--wide);
  -webkit-mask: var(--sticker) 0 0 / 100% 100% no-repeat;
  mask: var(--sticker) 0 0 / 100% 100% no-repeat;
}

.seat:has(.empty) { --sticker: var(--square); }

.seat::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--sticker) 0 0 / 100% 100% no-repeat;
  mix-blend-mode: hard-light;
  pointer-events: none;
}

.report {
  position: absolute;
  z-index: 1;
  top: 14px;
  right: 14px;
  width: 18px;
  height: 18px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 11px;
  line-height: 18px;
  cursor: pointer;
  opacity: 0;
}

.seat:hover .report,
.report:focus { opacity: 1; }

@media (hover: none) {
  .report { opacity: 1; }
}



#transfer-options button:hover { border-color: #ff3b8b; }

.cancel { background: none; border: none; color: #666; cursor: pointer; }

/* ---- Ride panel: textured amber card with a cut top-left corner ---- */

#panel {
  flex-shrink: 0;
  width: 283px;
  box-sizing: border-box;
  padding: 25px 3px 19px 3px;
  background: #ffb000 url(assets/card-yellow.jpg) 0 0 / 100% 100% no-repeat;
  border-radius: 10px;
  clip-path: polygon(46px 0, 100% 0, 100% 100%, 0 100%, 0 46px);
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 12px;
  font-weight: bold;
  color: #090909;
}

/* label (ends at x118, right-aligned) + field (148 x 19 at x124) */
#panel .row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 22px;
}

#panel .row label { width: 93px; text-align: right; white-space: nowrap; }

#panel input:not([type=file]),
#panel select {
  width: 148px;
  height: 19px;
  box-sizing: border-box;
  border: 0;
  border-radius: 2px;
  padding: 0 4px;
  background: #fff;
  font: inherit;
  color: #090909;
  outline: none;
}

#panel select {
  appearance: none;
  padding-right: 14px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='7' height='4'%3E%3Cpath d='M0 0h7L3.5 4z'/%3E%3C/svg%3E") right 4px center no-repeat;
  text-overflow: ellipsis;
}

#panel input:focus, #panel select:focus { box-shadow: inset 0 0 0 1px #090909; }
#panel input:disabled, #panel select:disabled { color: #777; cursor: default; }

/* bag label (ends at x118) + blue photo button (87 x 25 at x124) */
.bag-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: -1px 0 0 5px;
}

#bag-label { width: 110px; text-align: right; }

.picture {
  width: 87px;
  height: 25px;
  display: grid;
  place-items: center;
  border-radius: 2px;
  background: #0046cd;
  color: #fff;
  cursor: pointer;
}

.picture:hover { opacity: .88; }
.picture:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
.picture input { display: none; }

/* three black buttons, 39 tall: forget (70) + save + new (~100 each) */
.buttons { display: flex; align-items: center; margin-top: 11px; }

.buttons button {
  width: 100px;
  height: 39px;
  border: 0;
  border-radius: 2px;
  padding: 0;
  background: #090909;
  color: #fff;
  font: inherit;
  cursor: pointer;
}

.buttons button:hover { opacity: .88; }
.buttons button:disabled { opacity: .4; cursor: default; }
.buttons button:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
#save { margin-left: 3px; width: 101px; }
#new { margin-left: 3px; }

/* "forget me on this browser": small black button with 8px text in the top-left */
.buttons .link {
  width: 70px;
  padding: 0 5px;
  font-size: 8px;
  line-height: 9px;
  text-align: left;
}

/* messages and the transfer plan line up under the fields */
.note, .message { margin: 0 0 0 121px; width: 148px; font-size: 12px; }
.note { color: #5a4000; }
.note:empty { display: none; }
.message { color: #b00020; }
.message:empty { display: none; }
#save-message { margin-left: 73px; width: 204px; }

/* Opens the about window; bottom-left, styled like the panel buttons */
#about {
  position: absolute;
  left: 16px;
  bottom: 16px;
  z-index: 1;
  height: 25px;
  padding: 0 10px;
  border: 0;
  border-radius: 2px;
  background: #090909;
  color: #fff;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
}

#about:hover { opacity: .88; }
