@import url("https://fonts.googleapis.com/css2?family=Fredoka:wght@500;600;700&family=Hanken+Grotesk:ital,wght@0,400;0,500;0,600;0,700;0,800;1,500&family=Space+Mono:wght@400;700&display=swap");

:root {
  color-scheme: light;
  --blaze: #ff5c3c;
  --blaze-deep: #e8431f;
  --lagoon: #11c2b0;
  --cobalt: #2d5bff;
  --sun: #ffc02e;
  --berry: #ff5c9d;
  --grape: #7a5cff;
  --pine: #1fa971;
  --sky: #34c3ff;
  --ink: #181a2e;
  --ink-2: #3b3e58;
  --ink-3: #6e7191;
  --ink-4: #a9abc4;
  --canvas: #fbf7ef;
  --surface: #ffffff;
  --surface-2: #f3eee3;
  --surface-3: #ece6d8;
  --line: #e7e0d1;
  --line-strong: #d8cfbc;
  --night: #14162a;
  --night-2: #1e2140;
  --night-3: #2a2e54;
  --night-line: #343a66;
  --night-ink: #f4f2ff;
  --night-ink-2: #b9bde6;
  --success: var(--pine);
  --danger: #ff4d4d;
  --wash-blaze: #ffeee9;
  --wash-lagoon: #e2f8f5;
  --wash-cobalt: #e7ecff;
  --wash-grape: #efeaff;
  --wash-berry: #ffe9f2;
  --wash-sun: #fff4db;
  --wash-pine: #e2f5ec;
  --font-display: "Fredoka", system-ui, sans-serif;
  --font-body: "Hanken Grotesk", system-ui, sans-serif;
  --font-mono: "Space Mono", ui-monospace, monospace;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --radius-pill: 999px;
  --shadow-sm: 0 2px 6px rgba(24, 26, 46, 0.06), 0 1px 2px rgba(24, 26, 46, 0.08);
  --shadow-md: 0 8px 20px rgba(24, 26, 46, 0.08), 0 2px 6px rgba(24, 26, 46, 0.06);
  --shadow-lg: 0 20px 48px rgba(24, 26, 46, 0.12), 0 6px 14px rgba(24, 26, 46, 0.07);
  --shadow-chunky: 4px 4px 0 0 var(--ink);
  --shadow-chunky-lg: 6px 6px 0 0 var(--ink);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --content-gutter: max(clamp(20px, 4vw, 52px), calc((100vw - 1980px) / 2 + 52px));
  --queue-gutter: max(24px, calc((100vw - 1980px) / 2 + 24px));
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 192, 46, 0.22), transparent 28rem),
    radial-gradient(circle at 94% 12%, rgba(17, 194, 176, 0.16), transparent 25rem),
    var(--canvas);
  color: var(--ink);
  font-family: var(--font-body);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: url("/static/assets/topo-lines.svg");
  background-size: 520px auto;
  background-repeat: repeat;
  color: var(--blaze);
  opacity: 0.08;
  mix-blend-mode: multiply;
}

body.modal-open {
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.shell {
  position: relative;
  width: min(940px, calc(100vw - var(--content-gutter) - 270px));
  min-height: 100vh;
  margin: 0 0 0 var(--content-gutter);
  padding: 32px 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
}

.topbar {
  min-height: 54px;
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 46px;
}

.composer {
  display: grid;
  grid-template-columns: minmax(300px, 430px) minmax(360px, 430px);
  column-gap: 32px;
  align-items: start;
  align-content: start;
}

.copy-column {
  display: grid;
  align-content: start;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: block;
  filter: drop-shadow(3px 3px 0 var(--ink));
}

.brand-word {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 28px;
  letter-spacing: -0.04em;
}

.brand-word span {
  color: var(--blaze);
}

.intro {
  padding: 0 0 4px;
}

.eyebrow {
  margin: 0;
  color: var(--pine);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-display);
}

h1 {
  max-width: 11ch;
  font-size: clamp(2.7rem, 5.4vw, 4.8rem);
  font-weight: 700;
  line-height: 0.96;
  letter-spacing: -1.5px;
}

h2 {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.3px;
}

.lede {
  max-width: 32rem;
  margin: 12px 0 0;
  color: var(--ink-2);
  font-size: 17px;
  line-height: 1.45;
}

.panel {
  position: relative;
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 2px solid var(--ink);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-chunky);
}

.panel::before {
  content: none;
}

.stage-header {
  position: relative;
  display: grid;
  gap: 12px;
  padding-top: 12px;
}

.stage-pill {
  position: absolute;
  top: -32px;
  left: var(--stage-pill-left, 12.5%);
  z-index: 1;
  min-width: 92px;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: var(--radius-pill);
  background: var(--sun);
  box-shadow: 3px 3px 0 0 var(--ink);
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  transform: translateX(-50%);
  transition: left 220ms var(--ease-out);
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.stage-pill.dragging {
  cursor: grabbing;
  transition: none;
}

.wizard-progress {
  --wizard-progress-fill: 0%;
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
}

.wizard-progress::before,
.wizard-progress::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 12.5%;
  height: 10px;
  border-radius: var(--radius-pill);
  transform: translateY(-50%);
}

.wizard-progress::before {
  right: 12.5%;
  background: var(--line-strong);
}

.wizard-progress::after {
  width: var(--wizard-progress-fill);
  background: var(--blaze);
  transition: width 220ms var(--ease-out);
}

.wizard-progress li {
  position: relative;
  z-index: 1;
  min-width: 0;
  height: 10px;
  color: transparent;
  background: transparent;
  cursor: pointer;
}

.wizard-progress li::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 1;
  width: 16px;
  height: 16px;
  border: 2px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface-3);
  transform: translate(-50%, -50%);
}

.wizard-progress li:first-child {
  border-radius: var(--radius-pill) 0 0 var(--radius-pill);
}

.wizard-progress li:last-child {
  border-radius: 0 var(--radius-pill) var(--radius-pill) 0;
}

.wizard-progress li span {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  border: 0;
  white-space: nowrap;
}

.wizard-progress li.done::before,
.wizard-progress li.active::before {
  border-color: var(--ink);
  background: var(--blaze);
  box-shadow: 2px 2px 0 0 var(--ink);
}

.wizard-step {
  display: grid;
  gap: 16px;
  min-width: 0;
  margin: 0;
  padding: 6px 0 0;
  border: 0;
}

.wizard-step[hidden] {
  display: none;
}

.wizard-step legend {
  display: grid;
  gap: 5px;
  margin: 0 0 10px;
  padding: 0;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 21px;
  font-weight: 800;
  line-height: 1.18;
}

.wizard-step legend span {
  color: var(--pine);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.wizard-actions {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
}

.wizard-actions button:last-child {
  min-width: 132px;
}

.wizard-actions .secondary-button {
  min-width: 132px;
}

.wizard-actions .form-status {
  grid-column: 2;
}

.wizard-actions .secondary-button {
  grid-column: 1;
  grid-row: 1;
}

#wizard-next,
#submit {
  grid-column: 4;
}

#submit {
  background: var(--pine);
}

.wizard-actions button[hidden] {
  display: none;
}

.secondary-button {
  color: var(--ink);
  background: var(--surface);
  box-shadow: 3px 3px 0 0 var(--ink);
}

.review-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 0;
  padding: 14px;
  border: 2px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--wash-sun);
}

.review-list div {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  min-width: 0;
}

.review-list dt {
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.review-list dd {
  min-width: 0;
  margin: 0;
  color: var(--ink);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.dropzone {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 12px;
  row-gap: 3px;
  min-height: 104px;
  padding: 16px;
  align-content: center;
  border: 2px dashed var(--ink);
  border-radius: var(--radius-md);
  background: var(--wash-lagoon);
  cursor: pointer;
  transition: transform 160ms var(--ease-spring), box-shadow 160ms var(--ease-out), background 160ms var(--ease-out);
}

.dropzone:hover {
  transform: translateY(-2px);
  box-shadow: 4px 4px 0 0 var(--ink);
  background: var(--wash-sun);
}

.route-source-row {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: stretch;
}

.route-source-row .dropzone,
.route-source-row .strava-source {
  min-height: 104px;
}

.route-or {
  position: absolute;
  top: calc(104px + 7px);
  left: 50%;
  z-index: 3;
  width: 48px;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: var(--radius-pill);
  background: var(--sun);
  box-shadow: 2px 2px 0 0 var(--ink);
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
  transform: translate(-50%, -50%) rotate(-4deg);
}

.strava-source {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  align-content: center;
  gap: 10px;
  min-height: 70px;
  padding: 12px 14px;
  border: 2px dashed var(--ink);
  border-radius: var(--radius-md);
  background: var(--wash-lagoon);
}

.strava-link-field {
  height: 40px;
  min-width: 0;
  padding: 0 12px;
  font-size: 14px;
}

.strava-button {
  width: auto;
  min-height: 40px;
  padding: 0 14px;
  justify-content: center;
  background: var(--pine);
  color: white;
}

.strava-button:disabled {
  cursor: not-allowed;
  filter: grayscale(0.4);
  opacity: 0.72;
}

.dropzone.subtle {
  min-height: 78px;
  background: var(--wash-cobalt);
}

.dropzone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.drop-icon {
  grid-row: span 2;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: white;
  background: var(--blaze);
  border: 2px solid var(--ink);
  border-radius: 13px;
  box-shadow: 2px 2px 0 0 var(--ink);
}

.drop-icon svg,
button svg,
.download svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.2;
}

.gpx-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
}

.strava-icon svg {
  width: 25px;
  height: 25px;
  fill: currentColor;
  stroke: none;
}

.drop-title {
  align-self: end;
  min-width: 0;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 700;
  line-height: 1.05;
}

.drop-subtitle,
label span,
.form-status,
.meta,
.logline {
  color: var(--ink-3);
}

label {
  display: grid;
  gap: 8px;
  min-width: 0;
}

label > span:not(.drop-title):not(.drop-subtitle):not(.drop-icon) {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

label > span strong {
  float: right;
  color: var(--blaze);
  font-family: var(--font-mono);
  font-size: 11px;
  font-style: normal;
}

input:not([type="file"]),
select {
  width: 100%;
  height: 42px;
  border: 2px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  padding: 0 12px;
  outline: none;
  transition: border 140ms var(--ease-out), box-shadow 140ms var(--ease-out), background 140ms var(--ease-out);
}

input:not([type="file"]):focus,
select:focus {
  border-color: var(--blaze);
  box-shadow: 0 0 0 3px rgba(255, 92, 60, 0.16);
}

input::placeholder {
  color: var(--ink-4);
}

.grid {
  display: grid;
  gap: 12px;
}

.grid.two {
  grid-template-columns: 1fr 1fr;
}

.grid.three {
  grid-template-columns: 1fr 1fr 1fr;
}

.grid.two > span {
  display: block;
}

.orientation-field,
.duration-field {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.orientation-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.orientation-picker label {
  display: block;
}

.orientation-picker input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.orientation-card {
  min-height: 74px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  color: var(--ink-2);
  border: 2px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
  cursor: pointer;
  transition: transform 140ms var(--ease-spring), border 140ms var(--ease-out), box-shadow 140ms var(--ease-out), background 140ms var(--ease-out);
}

.orientation-card:hover {
  transform: translateY(-2px);
  background: var(--wash-sun);
}

.orientation-picker input:checked + .orientation-card {
  color: var(--ink);
  border-color: var(--ink);
  background: var(--wash-lagoon);
  box-shadow: 3px 3px 0 0 var(--ink);
}

.orientation-picker input:focus-visible + .orientation-card {
  box-shadow: 0 0 0 3px rgba(255, 92, 60, 0.2), 3px 3px 0 0 var(--ink);
}

.orientation-icon {
  width: 34px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--ink);
  border-radius: 9px;
  background: var(--surface);
  box-shadow: 2px 2px 0 0 var(--ink);
}

.orientation-icon::before {
  content: "";
  width: 18px;
  height: 28px;
  border: 2px solid var(--blaze);
  border-radius: 5px;
  background: var(--wash-blaze);
}

.orientation-icon.landscape {
  width: 50px;
  height: 34px;
}

.orientation-icon.landscape::before {
  width: 30px;
  height: 16px;
}

.orientation-card strong {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
}

.toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.toggles label:last-child {
  margin-left: auto;
}

.toggles label {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 12px;
  gap: 8px;
  border: 2px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--ink-2);
  font-weight: 700;
}

.toggles input {
  width: 18px;
  height: 18px;
  accent-color: var(--pine);
}

button,
.download {
  min-height: 44px;
  border: 2px solid var(--ink);
  border-radius: 13px;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  transition: transform 120ms var(--ease-spring), box-shadow 120ms var(--ease-out), background 120ms var(--ease-out);
}

button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #fff;
  background: var(--blaze);
  box-shadow: var(--shadow-chunky);
}

button:hover,
.download:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-chunky-lg);
}

button:active,
.download:active {
  transform: translate(4px, 4px);
  box-shadow: none;
}

button:disabled {
  opacity: 0.6;
  cursor: progress;
}

.ghost {
  min-height: 38px;
  padding: 0 14px;
  color: var(--night-ink);
  background: transparent;
  border-color: var(--night-line);
  box-shadow: none;
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: lowercase;
}

.ghost.icon-only {
  width: 38px;
  padding: 0;
}

.ghost:hover {
  background: var(--night-2);
  box-shadow: none;
}

.form-status {
  min-height: 20px;
  margin: 0;
  margin-right: auto;
  font-size: 0.92rem;
  font-weight: 700;
}

.form-status.error {
  color: var(--danger);
}

.soundtrack-panel {
  display: grid;
  gap: 12px;
  padding: 13px;
  border: 2px solid var(--ink);
  border-radius: var(--radius-md);
  background:
    linear-gradient(135deg, rgba(255, 192, 46, 0.22), transparent 44%),
    var(--wash-grape);
  box-shadow: 3px 3px 0 0 var(--ink);
}

.soundtrack-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: end;
}

.soundtrack-icon {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: white;
  border: 2px solid var(--ink);
  border-radius: 13px;
  background: var(--grape);
  box-shadow: 2px 2px 0 0 var(--ink);
}

.soundtrack-icon svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.2;
}

.soundtrack-preview {
  width: 100%;
  height: 38px;
  border-radius: var(--radius-sm);
  color: var(--ink);
}

.soundtrack-preview[aria-disabled="true"] {
  opacity: 0.48;
  pointer-events: none;
}

.segment-control {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 46px;
  gap: 10px;
  align-items: center;
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
}

.segment-control span:last-child {
  text-align: right;
}

.segment-slider {
  --segment-left: 0%;
  --segment-width: 100%;
  position: relative;
  height: 30px;
  border-radius: var(--radius-pill);
}

.segment-track,
.segment-window,
.segment-slider input[type="range"] {
  position: absolute;
  inset: 0;
}

.segment-track {
  top: 9px;
  bottom: 9px;
  border: 2px solid var(--ink);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.72);
}

.segment-window {
  left: var(--segment-left);
  width: var(--segment-width);
  border: 2px solid var(--ink);
  border-radius: var(--radius-pill);
  background: var(--blaze);
  box-shadow: 2px 2px 0 0 var(--ink);
  pointer-events: none;
  transition: left 80ms var(--ease-out), width 80ms var(--ease-out);
}

.segment-window::before,
.segment-window::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 2px;
  height: 12px;
  background: rgba(255, 255, 255, 0.8);
  transform: translateY(-50%);
}

.segment-window::before {
  left: 8px;
}

.segment-window::after {
  right: 8px;
}

.segment-slider input[type="range"] {
  width: 100%;
  height: 30px;
  opacity: 0;
  cursor: grab;
}

.segment-slider input[type="range"]:active {
  cursor: grabbing;
}

.segment-slider input[type="range"]:disabled {
  cursor: default;
}

input[type="range"] {
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  accent-color: var(--blaze);
  cursor: pointer;
}

input[type="range"]:focus {
  box-shadow: none;
}

.segment-caption {
  min-height: 18px;
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.35;
  text-align: center;
}

.advanced {
  border: 2px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.advanced summary {
  min-height: 40px;
  padding: 10px 12px;
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  text-transform: lowercase;
  cursor: pointer;
}

.advanced[open] summary {
  border-bottom: 2px solid var(--line-strong);
}

.advanced-body {
  display: grid;
  gap: 12px;
  padding: 12px;
}

.queue-dock {
  position: fixed;
  top: 32px;
  right: var(--queue-gutter);
  z-index: 2147483000;
  display: inline-flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto;
  min-height: 46px;
  padding: 0 12px;
  gap: 9px;
  color: var(--night-ink);
  border-color: var(--ink);
  border-radius: var(--radius-pill);
  background: var(--night);
  box-shadow: 4px 4px 0 0 var(--sun);
}

.queue-dock.active {
  background:
    linear-gradient(90deg, rgba(255, 192, 46, 0.18), transparent 48%),
    var(--night);
}

.queue-dock.active .queue-work {
  display: inline-block;
}

.queue-dock.active #queue-state {
  display: inline;
}

.queue-dock.ready #queue-state,
.queue-dock.failed #queue-state {
  display: inline;
}

.queue-work {
  display: none;
  width: 15px;
  height: 15px;
  border: 3px solid rgba(255, 255, 255, 0.25);
  border-top-color: var(--sun);
  border-radius: 50%;
  animation: queue-spin 800ms linear infinite;
}

#queue-state {
  display: none;
  color: var(--sun);
  font-family: var(--font-mono);
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.queue-dock.ready #queue-state {
  color: var(--lagoon);
}

.queue-dock.failed #queue-state {
  color: var(--danger);
}

@keyframes queue-spin {
  to {
    transform: rotate(360deg);
  }
}

.queue-dock strong {
  min-width: 25px;
  height: 25px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: var(--radius-pill);
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: 12px;
}

.queue-dock.ready strong {
  color: #fff;
  background: var(--pine);
}

.queue-dock.active strong {
  background: var(--sun);
}

.queue-dock.failed strong {
  color: #fff;
  background: var(--danger);
}

.queue-tip {
  position: fixed;
  top: 88px;
  right: var(--queue-gutter);
  z-index: 74;
  max-width: 220px;
  padding: 9px 12px;
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: var(--radius-sm);
  background: var(--wash-pine);
  box-shadow: 3px 3px 0 0 var(--ink);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
}

.queue-tip::before {
  content: "";
  position: absolute;
  top: -9px;
  right: 28px;
  width: 14px;
  height: 14px;
  border-top: 2px solid var(--ink);
  border-left: 2px solid var(--ink);
  background: var(--wash-pine);
  transform: rotate(45deg);
}

.jobs {
  position: fixed;
  top: 92px;
  right: var(--queue-gutter);
  bottom: 24px;
  z-index: 70;
  width: min(430px, calc(100vw - 48px));
  min-height: 0;
  padding: 26px 22px 22px;
  overflow: auto;
  overflow-x: hidden;
  border: 2px solid var(--ink);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(135deg, rgba(52, 195, 255, 0.1), transparent 34%),
    linear-gradient(315deg, rgba(255, 92, 60, 0.12), transparent 38%),
    var(--night);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transform: translateX(calc(100% + 36px));
  transition: transform 220ms var(--ease-out), opacity 180ms var(--ease-out);
}

.jobs.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.jobs::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: url("/static/assets/topo-lines.svg");
  background-size: 520px auto;
  opacity: 0.09;
  filter: invert(1);
}

.jobs > * {
  position: relative;
}

.jobs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.queue-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

#queue-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 40px;
  min-height: 40px;
  padding: 0;
  color: var(--ink);
  border-color: var(--ink);
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 3px 3px 0 0 var(--sun);
}

#queue-close:hover {
  background: var(--wash-sun);
  box-shadow: 4px 4px 0 0 var(--sun);
}

#queue-close svg {
  width: 18px;
  height: 18px;
  stroke-width: 3;
}

.jobs h2 {
  color: var(--night-ink);
}

.jobs .eyebrow {
  color: var(--lagoon);
  margin-bottom: 8px;
}

.job-list {
  display: grid;
  gap: 12px;
}

.empty {
  display: grid;
  min-height: 180px;
  align-content: center;
  padding: 28px;
  color: var(--night-ink-2);
  border: 2px dashed var(--night-line);
  border-radius: var(--radius-lg);
  text-align: center;
  background: rgba(255, 255, 255, 0.04);
}

.job {
  display: grid;
  gap: 13px;
  min-width: 0;
  padding: 16px;
  background: rgba(255, 255, 255, 0.96);
  border: 2px solid var(--ink);
  border-radius: var(--radius-md);
  box-shadow: 4px 4px 0 0 rgba(255, 192, 46, 0.95);
  transform: translateX(var(--swipe-x, 0));
  transition: transform 180ms var(--ease-out), box-shadow 140ms var(--ease-out);
}

.job.completed {
  cursor: grab;
  touch-action: pan-y;
}

.job.completed.swiping {
  cursor: grabbing;
  transition: none;
  box-shadow: 0 0 0 3px rgba(255, 92, 60, 0.2), 4px 4px 0 0 rgba(255, 192, 46, 0.95);
}

.job.swipe-return {
  transition: transform 180ms var(--ease-spring);
}

.job-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 14px;
  min-width: 0;
}

.job-top > div {
  min-width: 0;
}

.job-state {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  justify-self: end;
  align-self: start;
}

.job-name {
  margin: 0 0 4px;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.meta,
.logline {
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.job-progress {
  min-width: 0;
}

.job-progress-track {
  --job-progress: 0%;
  position: relative;
  min-height: 38px;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(52px, auto) 1fr;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  border: 2px solid var(--ink);
  border-radius: var(--radius-pill);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(229, 233, 239, 0.9)),
    var(--surface);
  box-shadow:
    4px 4px 0 0 var(--ink),
    inset 0 3px 0 rgba(255, 255, 255, 0.95),
    inset 0 -4px 0 rgba(19, 22, 48, 0.16);
  color: var(--ink);
  isolation: isolate;
}

.job-progress-track::before {
  content: "";
  position: absolute;
  inset: 4px auto 4px 4px;
  width: var(--job-progress);
  min-width: 0;
  max-width: calc(100% - 8px);
  border-radius: var(--radius-pill);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.38), rgba(255, 255, 255, 0) 48%),
    linear-gradient(90deg, var(--sun), var(--blaze));
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.56),
    inset 0 -3px 0 rgba(19, 22, 48, 0.18);
  transition: width 520ms var(--ease-out);
  z-index: 0;
}

.job-progress-track span {
  position: absolute;
  inset: 5px;
  border-radius: var(--radius-pill);
  background: linear-gradient(110deg, transparent 0 34%, rgba(255, 255, 255, 0.42) 44%, transparent 56% 100%);
  background-size: 200% 100%;
  opacity: 0.55;
  animation: job-progress-sheen 1.7s linear infinite;
  pointer-events: none;
  z-index: 1;
}

.job-progress.done .job-progress-track::before {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0) 48%),
    linear-gradient(90deg, #35d487, var(--pine));
}

.job-progress.done .job-progress-track span {
  animation: none;
  opacity: 0;
}

.job-progress-track strong,
.job-progress-track em {
  position: relative;
  z-index: 2;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}

.job-progress-track strong {
  font-family: var(--font-display);
  font-size: 18px;
  font-style: normal;
  font-weight: 700;
  line-height: 1;
}

.job-progress-track em {
  min-width: 0;
  justify-self: end;
  font-family: var(--font-mono);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@keyframes job-progress-sheen {
  from {
    background-position: 130% 0;
  }
  to {
    background-position: -70% 0;
  }
}

.job-indicator {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 3px solid var(--ink);
  border-radius: 50%;
}

.job-indicator.running {
  width: 15px;
  height: 15px;
  align-self: center;
  border-color: rgba(20, 22, 42, 0.25);
  border-top-color: var(--sun);
  background: transparent;
  animation: queue-spin 800ms linear infinite;
}

.job-indicator.completed {
  border-color: var(--ink);
  color: #fff;
  background: var(--pine);
  box-shadow: 2px 2px 0 0 var(--ink);
}

.job-indicator.failed {
  border-color: var(--ink);
  color: #fff;
  background: var(--danger);
  box-shadow: 2px 2px 0 0 var(--ink);
}

.job-indicator svg {
  width: 17px;
  height: 17px;
  stroke-width: 3;
}

.job-delete {
  width: 32px;
  min-height: 32px;
  padding: 0;
  color: var(--ink);
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 2px 2px 0 0 var(--ink);
}

.job-delete svg {
  width: 16px;
  height: 16px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.share-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  padding-top: 6px;
}

.download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 36px;
  padding: 0 12px;
  gap: 7px;
  color: #fff;
  background: var(--pine);
  box-shadow: 3px 3px 0 0 var(--ink);
}

.download.secondary {
  color: var(--ink);
  background: var(--sun);
}

.share-button {
  width: 38px;
  height: 38px;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: #fff;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--blaze);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  transition: transform 120ms var(--ease-spring), box-shadow 120ms var(--ease-out), background 120ms var(--ease-out);
}

.share-button:hover {
  transform: translateY(-2px);
  box-shadow: 3px 3px 0 0 var(--ink);
}

.share-button.instagram {
  background: var(--blaze);
}

.share-button.youtube {
  background: var(--blaze);
}

.share-button.facebook {
  background: var(--blaze);
}

.share-button.x-twitter {
  color: #fff;
  background: var(--blaze);
}

.share-button svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.2;
}

.share-button .brand-icon {
  fill: currentColor;
  stroke: none;
}

.share-button .instagram-icon {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.error {
  max-width: 100%;
  min-width: 0;
  color: var(--danger);
  font-weight: 700;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(20, 22, 42, 0.46);
  backdrop-filter: blur(4px);
}

.confirm-modal[hidden] {
  display: none;
}

.confirm-card {
  position: relative;
  width: min(390px, calc(100vw - 32px));
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  padding: 18px;
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, rgba(255, 192, 46, 0.28), transparent 42%),
    var(--surface);
  box-shadow: var(--shadow-chunky-lg);
}

.confirm-card::before {
  content: "";
  position: absolute;
  top: -2px;
  left: 28px;
  width: 78px;
  height: 16px;
  border: 2px solid var(--ink);
  border-top: 0;
  border-radius: 0 0 var(--radius-pill) var(--radius-pill);
  background: var(--sun);
}

.confirm-mark {
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  border: 2px solid var(--ink);
  border-radius: 14px;
  background: var(--blaze);
  box-shadow: 2px 2px 0 0 var(--ink);
}

.confirm-mark svg {
  width: 19px;
  height: 19px;
  stroke-width: 2.2;
}

.confirm-card h2 {
  margin: 4px 0 8px;
  font-size: 28px;
}

.confirm-card p:not(.eyebrow) {
  margin: 0;
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1.4;
}

.confirm-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 4px;
}

.danger-button {
  background: var(--danger);
}

@media (max-width: 920px) {
  .shell {
    grid-template-columns: 1fr;
    width: min(100% - 28px, 680px);
    margin: 0 auto;
    padding: 24px 0;
  }

  .topbar {
    margin-bottom: 28px;
  }

  .composer {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }

  h1 {
    max-width: 12ch;
  }

  .jobs {
    top: 84px;
    right: 14px;
    bottom: 14px;
    width: min(420px, calc(100vw - 28px));
  }

  .queue-dock {
    top: 20px;
    right: 14px;
  }

  .queue-tip {
    top: 76px;
    right: 14px;
  }
}

@media (hover: none) and (pointer: coarse) {
  .route-or,
  .strava-source {
    display: none;
  }

  .route-source-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .composer {
    gap: 34px;
  }

  .grid.two,
  .grid.three {
    grid-template-columns: 1fr;
  }

  .grid.two > span {
    display: none;
  }

  .route-source-row {
    grid-template-columns: 1fr;
  }

  .gpx-drop-title {
    font-size: 0;
  }

  .gpx-drop-title::before {
    content: attr(data-mobile-title);
    font-size: 21px;
  }

  .toggles label:last-child {
    margin-left: 0;
  }

  .panel {
    padding: 16px;
    border-radius: var(--radius-lg);
  }

  .strava-source {
    display: none;
  }

  .route-or {
    display: none;
  }

  .wizard-actions {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  #wizard-next,
  #submit {
    grid-column: 3;
  }

  .jobs {
    inset: auto 12px 12px;
    max-height: min(72vh, 620px);
    width: auto;
    padding: 16px;
    border-radius: var(--radius-lg);
    transform: translateY(calc(100% + 24px));
  }

  .jobs.open {
    transform: translateY(0);
  }

  .jobs-header,
  .job-top {
    align-items: stretch;
    flex-direction: column;
  }

  .brand-word {
    font-size: 24px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .queue-dock > span:not(.queue-work) {
    display: none;
  }
}
