:root {
  color-scheme: light;
  --bg: #eef1eb;
  --panel: #fbfcf8;
  --panel-strong: #ffffff;
  --ink: #1b221d;
  --ink-soft: #536054;
  --line: #cfd8cd;
  --accent: #265c4b;
  --accent-strong: #14352b;
  --accent-soft: #dae8e2;
  --warn: #9d4b25;
  --shadow: 0 12px 28px rgba(25, 44, 33, 0.07);
  --radius: 18px;
  --radius-sm: 12px;
  --font: "IBM Plex Sans", "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: #f4f6f1;
  color: var(--ink);
  font-family: var(--font);
}

body {
  min-height: 100vh;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  padding: 0.8rem 1rem 1.2rem;
}

.drop-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(244, 246, 241, 0.72);
  backdrop-filter: blur(3px);
}

.drop-overlay-card {
  padding: 1rem 1.2rem;
  border: 1px solid rgba(38, 92, 75, 0.22);
  background: var(--panel-strong);
  box-shadow: var(--shadow);
  color: var(--accent-strong);
  font-size: 1rem;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  padding: 0.2rem 0 0.55rem;
  border-bottom: 1px solid rgba(207, 216, 205, 0.9);
}

.brand-block h1,
.pane-header h2,
.entry-card h3,
.inventory-card h3,
.dialog-header h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: -0.03em;
}

.brand-block h1 {
  font-size: clamp(1.2rem, 2.1vw, 1.8rem);
}

.eyebrow {
  margin: 0 0 0.15rem;
  color: var(--ink-soft);
  text-transform: uppercase;
  font-size: 0.65rem;
  letter-spacing: 0.18em;
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.75rem;
  align-items: end;
}

.preset-cluster {
  display: flex;
  gap: 0.55rem;
  align-items: end;
  flex-wrap: wrap;
}

.preset-menu-wrap {
  position: relative;
}

.preset-menu-panel {
  position: absolute;
  top: calc(100% + 0.55rem);
  right: 0;
  width: min(26rem, calc(100vw - 3rem));
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-strong);
  box-shadow: var(--shadow);
  z-index: 20;
}

.preset-menu-header {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.preset-menu-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  align-items: end;
  gap: 0.7rem;
  margin-bottom: 0.85rem;
}

.direction-field {
  min-width: 21rem;
}

.direction-arrow-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  min-height: 2.5rem;
  flex-wrap: wrap;
}

.direction-inline-label {
  color: var(--ink-soft);
  font-size: 0.78rem;
  white-space: nowrap;
}

.direction-arrow-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 4rem;
  height: 2.3rem;
  padding: 0;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid rgba(38, 92, 75, 0.28);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.9), 0 1px 2px rgba(25, 44, 33, 0.08);
  transition: border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

.direction-arrow-button:hover,
.direction-arrow-button:focus-visible {
  border-color: rgba(38, 92, 75, 0.42);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.96), 0 2px 4px rgba(25, 44, 33, 0.12);
}

.direction-arrow-icon {
  width: 2.3rem;
  height: 1.15rem;
  stroke: var(--accent);
  stroke-width: 2.3;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  transition: transform 150ms ease;
}

.direction-arrow-button.is-destinations-to-home .direction-arrow-icon {
  transform: rotate(180deg);
}

.direction-endpoint-label {
  color: var(--ink);
  font-size: 0.94rem;
  white-space: nowrap;
}

.compact-list {
  gap: 0.5rem;
  margin-top: 0;
  max-height: 17rem;
  overflow: auto;
}

.field {
  display: grid;
  gap: 0.35rem;
}

.field span {
  font-size: 0.78rem;
  color: var(--ink-soft);
}

.field > span:empty,
.composer-help:empty {
  display: none;
}

.compact-field {
  min-width: 9rem;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
  background: var(--panel-strong);
  color: var(--ink);
}

.field textarea,
textarea {
  resize: vertical;
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

.primary-button,
.secondary-button,
.toggle-button,
.chip-button {
  border-radius: 999px;
  padding: 0.62rem 0.92rem;
  border: 1px solid transparent;
  transition: transform 120ms ease, background-color 120ms ease, color 120ms ease, border-color 120ms ease;
}

.primary-button:hover,
.secondary-button:hover,
.toggle-button:hover,
.chip-button:hover {
  transform: translateY(-1px);
}

.primary-button {
  background: var(--accent);
  color: #f8fffc;
}

.secondary-button,
.toggle-button {
  background: var(--panel-strong);
  color: var(--ink);
  border-color: var(--line);
}

.toggle-button.is-active {
  background: var(--accent-soft);
  color: var(--accent-strong);
  border-color: rgba(38, 92, 75, 0.24);
}

.chip-button {
  background: transparent;
  border-color: var(--line);
  color: var(--ink-soft);
  padding: 0.38rem 0.75rem;
  font-size: 0.82rem;
}

.chip-button.is-danger {
  color: #7c2f1b;
  border-color: rgba(157, 75, 37, 0.35);
}

.workspace {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
  margin-top: 0.65rem;
  align-items: start;
  min-width: 0;
}

.map-pane {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 0.5rem;
  min-width: 0;
}

.comparison-toolbar {
  position: relative;
  margin-bottom: 0.9rem;
}

.location-composer {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  z-index: 18;
  width: fit-content;
  max-width: min(100%, 52rem);
  border: 1px solid rgba(207, 216, 205, 0.95);
  background: var(--panel-strong);
  box-shadow: var(--shadow);
  padding: 0.95rem 1rem;
}

.location-composer-body {
  min-height: 0;
  padding: 0;
}

.location-composer-launchers {
  display: flex;
  flex-direction: row;
  gap: 0.55rem;
  flex-wrap: wrap;
  align-items: center;
  flex: 0 0 auto;
  margin-right: 0.5rem;
}

.location-composer-launchers .secondary-button.is-active {
  background: var(--accent-soft);
  color: var(--accent-strong);
  border-color: rgba(38, 92, 75, 0.24);
}

.composer-empty-state {
  display: none;
}

.composer-edit-panel {
  display: grid;
  gap: 0.55rem;
}

.composer-help {
  color: var(--ink-soft);
  font-size: 0.83rem;
  line-height: 1.35;
}

.composer-edit-grid {
  display: grid;
  grid-template-columns: minmax(10rem, 11rem) minmax(11rem, 14rem) minmax(8rem, 9rem) minmax(8.5rem, 9.5rem);
  gap: 0.75rem;
  align-items: end;
  justify-content: start;
}

.composer-kind-field,
.composer-count-field,
.composer-name-field {
  min-width: 0;
}

.composer-input-field {
  min-width: 0;
  grid-column: 2;
}

.composer-name-field {
  grid-column: 3;
}

.composer-inline-actions {
  display: flex;
  gap: 0.55rem;
  flex-wrap: nowrap;
  align-items: center;
  grid-column: 4;
}

.composer-kind-field {
  grid-column: 1;
}

.composer-count-field {
  grid-column: 4;
  position: relative;
}

.composer-count-field > span {
  position: absolute;
  top: calc(100% + 0.22rem);
  left: 0;
  max-width: 100%;
  white-space: pre-line;
  line-height: 1.2;
}

.composer-edit-panel.is-home .composer-edit-grid {
  grid-template-columns: minmax(18rem, 22rem) minmax(8rem, 9rem) minmax(8.5rem, 9.5rem);
}

.composer-edit-panel.is-home .composer-input-field {
  grid-column: 1;
}

.composer-edit-panel.is-home .composer-name-field {
  grid-column: 2;
}

.composer-edit-panel.is-home .composer-inline-actions {
  grid-column: 3;
}

.composer-edit-panel.is-destination-fixed .composer-edit-grid {
  grid-template-columns: minmax(10rem, 11rem) minmax(13rem, 16rem) minmax(8rem, 9rem) minmax(8.5rem, 9.5rem);
}

.composer-edit-panel.is-destination-fixed .composer-inline-actions {
  grid-column: 4;
}

.composer-submit-actions {
  display: flex;
  gap: 0.55rem;
  justify-content: flex-start;
  flex-wrap: wrap;
}

.composer-map-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.9rem;
  flex-wrap: wrap;
  min-height: 5.25rem;
  padding: 0.8rem 1rem;
  border: 1px solid rgba(38, 92, 75, 0.34);
  border-left: 4px solid var(--accent);
  background: #e7f3ec;
  box-shadow: 0 6px 18px rgba(20, 53, 43, 0.1);
}

.composer-map-copy {
  display: grid;
  gap: 0.2rem;
  min-width: min(100%, 20rem);
}

.composer-map-copy strong {
  color: var(--accent-strong);
  font-size: 0.96rem;
}

.composer-map-detail {
  color: #395246;
  font-size: 0.9rem;
  line-height: 1.35;
}

.comparison-pane {
  padding: 0;
  min-width: 0;
}

.comparison-controls {
  display: flex;
  justify-content: flex-start;
  align-items: end;
  gap: 1rem;
  margin-bottom: 0;
}

.comparison-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 0.9rem;
  align-items: end;
}

.pane-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.muted,
.dialog-note {
  margin: 0.25rem 0 0;
  color: var(--ink-soft);
  font-size: 0.93rem;
  line-height: 1.45;
}

.dialog-note--required {
  margin-top: 0;
  padding: 0.65rem 0.8rem;
  border: 1px solid rgba(38, 92, 75, 0.18);
  background: rgba(38, 92, 75, 0.06);
  color: var(--accent-strong);
}

.map-status,
.comparison-status,
.message-bar,
.import-banner {
  padding: 0.75rem 0.95rem;
  font-size: 0.95rem;
}

.message-bar {
  margin-top: 0.85rem;
  border: 1px solid transparent;
  border-radius: 0;
  min-height: 3rem;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.68);
}

.message-bar.is-warning {
  border-color: rgba(157, 75, 37, 0.25);
  color: var(--warn);
}

.message-bar.is-error {
  border-color: rgba(157, 75, 37, 0.35);
  color: #7c2f1b;
  background: #fff4ef;
}

.import-banner {
  margin-top: 0.85rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  border: 1px solid rgba(207, 216, 205, 0.9);
  background: rgba(255, 255, 255, 0.72);
}

.is-hidden {
  display: none !important;
}

.map-canvas {
  width: 100%;
  max-width: 100%;
  min-height: 26rem;
  border-radius: 0;
  overflow: hidden;
  border: 1px solid rgba(207, 216, 205, 0.9);
  background:
    linear-gradient(45deg, rgba(38, 92, 75, 0.06), rgba(38, 92, 75, 0)),
    linear-gradient(135deg, #edf3ec, #dfe8df);
}

.inline-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.search-results {
  list-style: none;
  margin: -0.15rem 0 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-strong);
  overflow: hidden;
}

.search-results li + li {
  border-top: 1px solid rgba(207, 216, 205, 0.7);
}

.search-results button {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  padding: 0.7rem 0.8rem;
  color: var(--ink);
}

.search-results button:hover,
.search-results button:focus-visible {
  background: #f1f6f2;
  outline: none;
}

.search-result-title {
  font-weight: 600;
}

.search-result-subtitle {
  margin-top: 0.2rem;
  color: var(--ink-soft);
  font-size: 0.84rem;
}

.search-result-empty {
  padding: 0.85rem 0.9rem;
  color: var(--ink-soft);
  font-size: 0.88rem;
  line-height: 1.4;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.6rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.85rem;
}

.item-list {
  list-style: none;
  margin: 0.85rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}

.item-list li {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.7rem 0.8rem;
  background: var(--panel-strong);
}

.item-head {
  display: flex;
  justify-content: space-between;
  gap: 0.65rem;
  align-items: flex-start;
}

.item-title {
  font-weight: 600;
}

.item-subtitle {
  color: var(--ink-soft);
  font-size: 0.86rem;
  margin-top: 0.2rem;
  line-height: 1.35;
}

.item-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.comparison-table-container {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  position: relative;
}

.comparison-graph-container {
  margin-top: 1.15rem;
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 56rem;
}

.comparison-table th,
.comparison-table td {
  border-bottom: 1px solid var(--line);
  border-right: 1px solid rgba(207, 216, 205, 0.6);
  padding: 0.5rem 0.6rem;
  vertical-align: top;
}

.comparison-table th:first-child,
.comparison-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 3;
}

.comparison-table thead th {
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 2;
  text-align: left;
  overflow: visible;
}

.comparison-table thead th.is-popout-open,
.comparison-table th:first-child.is-popout-open {
  z-index: 30;
}

.comparison-row-header.is-table-focused,
.comparison-column-header.is-table-focused {
  box-shadow: inset 0 0 0 2px rgba(25, 82, 61, 0.44);
}

.comparison-column-header {
  background-clip: padding-box;
}

.comparison-column-header--destination {
  background: #fff;
}

.comparison-column-header--dynamic {
  background: #fff;
}

.comparison-table thead .comparison-column-header--destination {
  background: #fff;
}

.comparison-table thead .comparison-column-header--dynamic {
  background: #fff;
}

.comparison-cell {
  position: relative;
  display: grid;
  gap: 0.25rem;
  min-width: 10rem;
}

.comparison-cell-hitarea {
  position: absolute;
  inset: 0;
  z-index: 1;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.comparison-cell-content {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 0.25rem;
  pointer-events: none;
}

.cell-duration-row {
  display: inline-flex;
  align-items: baseline;
  justify-self: start;
  gap: 0.04rem;
  max-width: 100%;
}

.cell-duration {
  font-weight: 700;
}

.duration-display {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
}

.duration-markers {
  display: inline-flex;
  gap: 0.18rem;
  align-items: center;
}

.duration-marker {
  width: 1.08rem;
  height: 1.08rem;
  flex: 0 0 auto;
  display: block;
}

.duration-marker-base {
  fill: rgba(0, 0, 0, 0.06);
  stroke: rgba(0, 0, 0, 0.22);
  stroke-width: 1;
}

.duration-marker-fill {
  fill: #111;
}

.duration-label {
  white-space: nowrap;
}

.cell-external-link {
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #7e8a84;
}

.cell-external-link svg {
  width: 0.95rem;
  height: 0.95rem;
  fill: currentColor;
}

.cell-external-link:hover,
.cell-external-link:focus-visible {
  color: #3f4b45;
}

.cell-distance,
.cell-detail,
.graph-meta,
.route-note {
  color: var(--ink-soft);
  font-size: 0.85rem;
}

.graph-meta {
  margin: 0;
  line-height: 1.35;
}

.cell-detail-row {
  display: block;
}

.cell-detail-text {
  color: var(--ink-soft);
  font-size: 0.85rem;
  display: inline;
}

.cell-detail-link {
  color: #66736d;
  font-size: 0.85rem;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.08em;
  pointer-events: auto;
}

.cell-detail-link:hover,
.cell-detail-link:focus-visible {
  color: #4a5751;
}

.cell-detail-link--dynamic {
  display: -webkit-inline-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  max-width: 100%;
}

.cell-duration-row .cell-external-link,
.cell-detail-row .cell-external-link {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  margin-left: 0;
  pointer-events: auto;
}

.comparison-cell.is-highlighted {
  outline: 2px solid rgba(25, 82, 61, 0.48);
  outline-offset: 6px;
  border-radius: 10px;
  background: rgba(25, 82, 61, 0.08);
}

.comparison-home-row > th,
.comparison-home-row > td {
  background: var(--home-row-bg);
}

.comparison-row-focus > th,
.comparison-row-focus > td {
  background: var(--home-row-focus-bg);
}

.comparison-column-focus {
  background: rgba(25, 82, 61, 0.1);
}

.marker-legend {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  background: var(--accent);
  color: white;
  font-size: 0.75rem;
}

.app-dialog {
  width: min(42rem, calc(100vw - 2rem));
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 0;
  box-shadow: var(--shadow);
}

.app-dialog::backdrop {
  background: rgba(24, 30, 26, 0.48);
}

@supports ((-webkit-backdrop-filter: blur(12px)) or (backdrop-filter: blur(12px))) {
  .topbar,
  .import-banner {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

@supports (-moz-appearance: none) {
  html,
  body {
    background: #f4f6f1;
  }

  .primary-button,
  .secondary-button,
  .toggle-button,
  .chip-button {
    transition: none;
  }
}

.dialog-content {
  display: grid;
  gap: 0.9rem;
  padding: 1.15rem;
}

.dialog-mode-fields {
  display: grid;
  gap: 0.8rem;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.dialog-actions--top {
  justify-content: flex-start;
  margin-bottom: 0.1rem;
}

.dialog-icon-button {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.dialog-icon-button svg {
  width: 0.95rem;
  height: 0.95rem;
  fill: currentColor;
  flex: 0 0 auto;
}

code {
  font-family: var(--font-mono);
}

.table-axis-label {
  display: none;
  color: var(--ink-soft);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 0.25rem;
}

.table-heading-title {
  min-width: 0;
}

.corner-axis-hint {
  display: grid;
  gap: 0.08rem;
}

.corner-axis-line {
  color: var(--ink-soft);
  font-size: 0.76rem;
  line-height: 1.2;
}

.corner-axis-line:first-child {
  color: var(--ink);
  font-weight: 600;
}

.table-heading-topline {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.65rem;
}

.table-heading-subtitle {
  margin-top: 0.2rem;
  color: #7f8c84;
  font-size: 0.76rem;
  line-height: 1.25;
  font-weight: 400;
  text-align: left;
}

.table-heading-actions {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-top: 0.55rem;
}

.table-heading-actions--inline {
  margin-top: 0;
  flex: 0 0 auto;
  position: relative;
  z-index: 1;
}

.table-mini-button,
.table-icon-button,
.table-add-button {
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.table-mini-button {
  padding: 0.18rem 0.55rem;
  font-size: 0.74rem;
}

.table-mini-button--danger {
  color: #7c2f1b;
  border-color: rgba(157, 75, 37, 0.34);
}

.table-icon-button {
  width: 1.6rem;
  height: 1.6rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: #95a39a;
}

.table-icon-button svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: currentColor;
}

.table-icon-button--edit {
  color: #8aa3a0;
}

.table-add-button {
  width: auto;
  min-height: 2.5rem;
  padding: 0.55rem 0.8rem;
  border-style: dashed;
  color: var(--accent-strong);
  background: #f7fbf8;
  font-weight: 600;
}

.table-add-button:hover,
.table-mini-button:hover,
.table-icon-button:hover {
  background: #eef6f1;
}

.table-icon-button:hover,
.table-icon-button:focus-visible {
  color: #7e8e84;
  background: transparent;
}

.table-delete-control {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.table-delete-control.is-open {
  z-index: 12;
}

.table-delete-popout {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.4rem;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  box-shadow: 0 8px 18px rgba(25, 44, 33, 0.12);
  white-space: nowrap;
  z-index: 20;
}

.table-delete-popout span {
  color: var(--ink-soft);
  font-size: 0.74rem;
}

.comparison-row-header {
  min-width: 13.75rem;
}

.comparison-empty-cell {
  background: #f8faf7;
}

.comparison-footer {
  margin-top: 0.35rem;
  text-align: center;
}

.comparison-footnote {
  display: block;
  color: rgba(95, 108, 100, 0.68);
  font-size: 0.68rem;
  line-height: 1.25;
}

.comparison-graph-block {
  --graph-axis-width: 4.15rem;
  --graph-axis-gap: 0.55rem;
  border-top: 1px solid rgba(207, 216, 205, 0.8);
  padding-top: 1rem;
  display: grid;
  gap: 0.55rem;
}

.graph-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  margin-top: 0;
  align-items: center;
}

.graph-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.88rem;
}

.graph-legend-swatch {
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 999px;
  flex: 0 0 auto;
}

.graph-legend-title {
  color: var(--ink-soft);
  font-size: 0.88rem;
  font-weight: 600;
}

.comparison-graph-frame {
  display: grid;
  grid-template-columns: var(--graph-axis-width) minmax(0, 1fr);
  gap: var(--graph-axis-gap);
  align-items: start;
}

.graph-y-axis {
  position: relative;
  height: 13rem;
}

.graph-y-tick {
  position: absolute;
  left: 0;
  width: 100%;
  transform: translateY(50%);
  color: var(--ink-soft);
  font-size: 0.78rem;
  line-height: 1;
  text-align: left;
}

.graph-y-tick.is-top {
  transform: translateY(0);
}

.graph-y-tick.is-bottom {
  transform: translateY(-100%);
}

.comparison-graph-scroll {
  overflow-x: auto;
  padding-bottom: 0.25rem;
}

.comparison-graph-plot {
  display: flex;
  align-items: start;
  gap: 1rem;
  min-width: max-content;
  min-height: 16.5rem;
  padding: 0;
  position: relative;
  isolation: isolate;
}

.graph-group {
  width: var(--graph-group-width, 8rem);
  display: grid;
  grid-template-rows: 13rem auto;
}

.graph-bars {
  height: 13rem;
  display: flex;
  align-items: end;
  justify-content: center;
  gap: var(--graph-bar-gap, 0.35rem);
  padding: 0 0.25rem;
  border-bottom: 1px solid rgba(207, 216, 205, 0.7);
  position: relative;
  z-index: 1;
}

.graph-bar-button {
  width: var(--graph-bar-width, 1.2rem);
  min-width: var(--graph-bar-width, 1.2rem);
  height: 100%;
  display: flex;
  align-items: end;
  justify-content: center;
  padding: 0;
  border: 0;
  background: transparent;
}

.graph-bar-button.is-highlighted {
  outline: 2px solid rgba(38, 92, 75, 0.32);
  outline-offset: 2px;
  border-radius: 10px;
}

.graph-bar {
  width: 100%;
  min-height: 0.25rem;
  border-radius: 0;
}

.graph-group-label {
  margin-top: 0.55rem;
  font-size: 0.82rem;
  color: var(--ink-soft);
  line-height: 1.35;
  text-align: center;
  min-height: 2.4rem;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 0 0.25rem;
}

.graph-grid-lines {
  position: absolute;
  inset: 0 0 2.95rem 0;
  pointer-events: none;
}

.graph-grid-line {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1px solid rgba(207, 216, 205, 0.55);
}

.graph-grid-line--thirty {
  border-top-width: 2px;
  border-top-color: rgba(156, 170, 154, 0.82);
}

.graph-grid-line--sixty {
  border-top-width: 2px;
  border-top-color: rgba(186, 120, 120, 0.8);
}

.map-marker-pill {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 0.28rem 0.72rem;
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.map-marker-pill {
  cursor: pointer;
  box-shadow: 0 5px 14px rgba(25, 44, 33, 0.18);
  min-width: 1.35rem;
  justify-content: center;
  padding: 0.18rem 0.42rem;
  font-weight: 700;
}

.map-marker-pill--draft {
  box-shadow: 0 0 0 2px rgba(20, 53, 43, 0.16), 0 6px 16px rgba(25, 44, 33, 0.22);
}

.map-marker-pill--home {
  background: var(--home-fill, #c9deff);
  border-color: var(--home-border, #6d9fe6);
  color: var(--home-ink, #0f4590);
}

.map-marker-pill--destination {
  background: #d2d7dc;
  border-color: #9ca6b0;
  color: #39424b;
}

.map-marker-pill--dynamic {
  background: #ebeef1;
  border-color: #c2cad2;
  color: #5c6771;
}

.graph-legend-swatch,
.graph-bar {
  background: var(--home-graph-bar, #6f97c2);
}

.table-heading-link {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-weight: 700;
  font-size: 0.84rem;
  line-height: 1.2;
  text-align: left;
}

.table-heading-link--home {
  color: var(--home-ink, var(--ink));
}

.table-heading-link--destination,
.table-heading-link--dynamic {
  color: var(--ink);
}

@media (max-width: 1080px) {
  .preset-menu-form {
    grid-template-columns: 1fr;
  }

  .topbar,
  .topbar-actions,
  .import-banner,
  .comparison-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .comparison-filters {
    align-items: stretch;
  }

  .location-composer-launchers {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .location-composer {
    position: static;
    width: 100%;
    margin-top: 0.65rem;
  }

  .composer-edit-grid {
    grid-template-columns: 1fr;
  }

  .composer-map-panel {
    align-items: stretch;
  }

  .direction-field {
    min-width: 0;
  }

  .comparison-table {
    min-width: 40rem;
  }

  .comparison-graph-block {
    --graph-axis-width: 3.55rem;
  }

  .comparison-graph-frame {
    grid-template-columns: var(--graph-axis-width) minmax(0, 1fr);
  }

  .preset-cluster {
    flex-direction: column;
    align-items: stretch;
  }

  .preset-menu-panel {
    left: 0;
    right: auto;
    width: min(28rem, calc(100vw - 3rem));
  }
}
