:root {
  color-scheme: dark;
  font-family: ui-rounded, "SF Pro Rounded", system-ui, sans-serif;
  background: #0d1712;
  color: #f6f4e8;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

* { box-sizing: border-box; }

html, body { margin: 0; height: 100%; overflow: hidden; }

body {
  background:
    radial-gradient(circle at 85% 5%, #315a42 0, transparent 32rem),
    linear-gradient(160deg, #17281f, #0d1712 60%);
}

button, input, select { font: inherit; }
button { cursor: pointer; }

.app {
  width: min(100%, 36rem);
  height: 100dvh;
  margin: 0 auto;
  padding: max(env(safe-area-inset-top), 1rem) 1rem max(env(safe-area-inset-bottom), 1rem);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

header, .section-heading { display: flex; justify-content: space-between; align-items: center; }
.header-actions { display: flex; align-items: center; gap: .75rem; }
h1, h2, p { margin: 0; }
h1 { font-size: 1.55rem; letter-spacing: -.04em; }
h2 { font-size: 1rem; }
.eyebrow { color: #a9c7b3; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.total { display: flex; align-items: baseline; gap: .35rem; color: #bfd5c5; }
.total strong { color: #f8d55f; font-size: 2rem; line-height: 1; }
.install-button {
  border: 1px solid #f8d55f66;
  border-radius: 2rem;
  padding: .55rem .75rem;
  background: #f8d55f14;
  color: #f8d55f;
  font-size: .75rem;
  font-weight: 800;
}

.logger {
  padding: 1rem;
  border: 1px solid #ffffff14;
  border-radius: 1.35rem;
  background: #ffffff0a;
  box-shadow: 0 1rem 3rem #0004;
}

.logger h2 { margin-bottom: .8rem; }
label { display: block; margin: .75rem 0 .35rem; color: #bfd5c5; font-size: .78rem; font-weight: 700; }
input, select {
  width: 100%;
  min-height: 3rem;
  border: 1px solid #ffffff1f;
  border-radius: .8rem;
  padding: 0 .85rem;
  background: #08110caa;
  color: inherit;
  -webkit-user-select: text;
  user-select: text;
}
input:focus { outline: 2px solid #f8d55f; outline-offset: 2px; }
select:focus { outline: 2px solid #f8d55f; outline-offset: 2px; }
select:disabled { opacity: .55; }
.catalog-status { margin-top: .4rem; color: #91ab99; font-size: .72rem; }

.ride-button {
  width: 100%;
  min-height: 5rem;
  margin-top: 1rem;
  border: 0;
  border-radius: 1rem;
  background: #f8d55f;
  color: #172014;
  font-weight: 900;
  box-shadow: 0 .35rem 0 #aa8a22;
}
.ride-button:active { transform: translateY(.2rem); box-shadow: 0 .15rem 0 #aa8a22; }
.ride-button:disabled { opacity: .5; cursor: default; }
.ride-button span, .ride-button small { display: block; }
.ride-button span { font-size: 1.35rem; }
.ride-button small { margin-top: .15rem; font-size: .75rem; font-weight: 700; opacity: .7; }

.quick-list { display: flex; gap: .45rem; overflow-x: auto; margin-top: .85rem; scrollbar-width: none; }
.quick-list:empty { display: none; }
.quick-list button, .text-button {
  border: 0;
  color: #cfe2d4;
  background: transparent;
}
.quick-list button { flex: 0 0 auto; padding: .55rem .75rem; border-radius: 2rem; background: #ffffff12; }
.text-button { padding: .5rem; font-size: .78rem; }

.history { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.section-heading { margin-bottom: .4rem; }
#ride-list { margin: 0; padding: 0; overflow-y: auto; list-style: none; }
.ride { display: grid; grid-template-columns: 1fr auto auto; gap: .7rem; align-items: center; padding: .8rem .2rem; border-bottom: 1px solid #ffffff10; }
.ride-name { font-weight: 800; }
.ride-meta { margin-top: .15rem; color: #91ab99; font-size: .75rem; }
.badge { padding: .25rem .45rem; border-radius: 1rem; background: #ffffff12; color: #bad1c0; font-size: .68rem; }
.undo { border: 0; padding: .55rem; background: transparent; color: #f0b4a8; }
.empty { margin: auto; color: #819488; text-align: center; }
.toast { position: fixed; left: 50%; bottom: max(env(safe-area-inset-bottom), 1rem); translate: -50% 1rem; opacity: 0; padding: .65rem .9rem; border-radius: 2rem; background: #f6f4e8; color: #172014; transition: .2s; pointer-events: none; }
.toast.show { translate: -50% 0; opacity: 1; }
.update { position: fixed; left: 50%; bottom: max(env(safe-area-inset-bottom), 1rem); translate: -50%; border: 0; border-radius: 2rem; padding: .8rem 1rem; background: #f8d55f; color: #172014; font-weight: 800; }

@media (max-height: 650px) {
  .app { gap: .65rem; }
  .logger { padding: .75rem; }
  .logger h2, label { margin-top: .35rem; margin-bottom: .2rem; }
  input { min-height: 2.5rem; }
  .ride-button { min-height: 3.5rem; margin-top: .65rem; }
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
