/* GPS Route Distance Calculator: the points textarea, the error list and the segments table. */

.route { display: flex; flex-direction: column; gap: 24px; }

.route-input {
  height: auto;
  min-height: 200px;
  padding: 14px 16px;
  font: 16px/1.6 var(--font-mono);
  background: var(--surface-2);
  resize: vertical;
}

.route-options { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }

/* "Add a second point" is a hint; unreadable lines are an error. */
.route-errors {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  background: var(--surface-2);
  border: 2px dashed var(--line-soft);
  border-radius: 12px;
}
.route-errors.is-error { background: #FEF3F2; border: 2px solid #B42318; }
.route-message { margin: 0; font-size: 15px; font-weight: 600; }
.route-errors.is-error .route-message { color: #B42318; }

.route-error-list { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; max-height: 240px; overflow: auto; }
.route-error-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font-size: 14px; }
.route-error-line {
  padding: 2px 8px;
  font: 700 13px var(--font-mono);
  color: var(--ink);
  background: var(--surface);
  border: var(--border);
  border-radius: 6px;
  cursor: pointer;
}
.route-error-line:hover { box-shadow: var(--shadow-sm); }
.route-error-list code { font: 13px var(--font-mono); overflow-wrap: anywhere; }
.route-error-list span { color: var(--ink-2); }

.route-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px 24px;
  margin: 0;
  padding: 16px 20px;
  background: var(--surface-2);
  border: var(--border);
  border-radius: 14px;
}
.route-facts div { display: flex; flex-direction: column; gap: 4px; }
.route-facts dt { font-size: 14px; color: var(--ink-2); }
.route-facts dd { margin: 0; font: 700 18px var(--font-mono); }
.route-method-note { margin: -12px 0 0; font-size: 13px; color: var(--ink-3); }

.route-table-wrap { display: flex; flex-direction: column; gap: 12px; }
.route-table-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.route-table-title { margin: 0; font: 700 22px var(--font-display); }
.route-table-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.route-table-actions .btn { min-height: 42px; padding: 0 16px; font-size: 15px; }

/* Long routes scroll inside the box, with the header row kept in view. */
.route-table-scroll { max-height: 560px; overflow: auto; border: var(--border); border-radius: 12px; background: var(--surface); }
.route-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.route-table th, .route-table td { padding: 10px 14px; text-align: left; white-space: nowrap; border-bottom: 1px solid #D6DEEE; }
.route-table thead th { position: sticky; top: 0; z-index: 1; font-size: 13px; color: var(--on-ink); background: var(--ink); }
.route-table tbody tr:nth-child(even) { background: var(--surface-2); }
.route-table .route-num { text-align: right; font-family: var(--font-mono); }
.route-table .route-point { font-family: var(--font-mono); }
.route-table tfoot th, .route-table tfoot td { position: sticky; bottom: 0; font-weight: 700; background: var(--accent); border-bottom: 0; border-top: var(--border); }
.route-table tfoot th { text-align: right; }

.route-table-note { margin: 0; font-size: 13px; color: var(--ink-3); }

@media (max-width: 640px) {
  .route-table th, .route-table td { padding: 8px 10px; font-size: 13px; }
  .route-table-actions { width: 100%; }
  .route-table-actions .btn { flex: 1 1 0; }
}
