/* Pickup Window Route — Product App styling on the shared Gloss Tools
   tokens (TOOL-DESIGN-BASELINE.md). Local system fonts only; no remote
   assets. Single column below 48rem; form and results side by side
   at 48rem and up, with the work area keeping at least half the width.
   The travel matrix scrolls internally on narrow screens and can be
   filtered to one origin row with the source select. */

:root {
  color-scheme: light;
  --gq-color-ink: #111410;
  --gq-color-paper: #f3f0e8;
  --gq-color-paper-subtle: #e7e4dc;
  --gq-color-surface: #ffffff;
  --gq-color-acid: #c8f56a;
  --gq-color-text: #111410;
  --gq-color-text-muted: #55594f;
  --gq-color-separator: #b8bbb2;
  --gq-color-control-border: #60645c;
  --gq-color-border-strong: #111410;
  --gq-color-danger-text: #8f2119;
  --gq-color-danger-surface: #ffe6e1;
  --gq-color-success-text: #245c16;
  --gq-color-success-surface: #e8f8c7;
  --gq-color-info-surface: #e6f1fa;
  --gq-font-ui: system-ui, "Segoe UI", sans-serif;
  --gq-font-data: ui-monospace, "Cascadia Mono", monospace;
  --gq-radius-control: 0.375rem;
  --gq-radius-panel: 0.625rem;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--gq-color-paper);
  color: var(--gq-color-text);
  font-family: var(--gq-font-ui);
  font-size: 1rem;
  line-height: 1.5;
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  align-items: baseline;
  justify-content: space-between;
  max-width: 90rem;
  margin: 0 auto;
  padding: 1rem 1rem 0;
}

.home-link {
  color: var(--gq-color-text);
  font-weight: 600;
}

.lang-switch {
  margin: 0;
  font-size: 0.875rem;
}

.lang-note {
  color: var(--gq-color-text-muted);
}

main {
  max-width: 90rem;
  margin: 0 auto;
  padding: 1rem;
}

h1 {
  font-size: 1.75rem;
  line-height: 1.2;
  margin: 0.5rem 0;
}

.intro {
  max-width: 72ch;
  margin: 0 0 1.5rem;
}

.workspace {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  align-items: start;
}

@media (min-width: 48rem) {
  .workspace {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  main {
    padding: 1.5rem;
  }
}

fieldset {
  border: 1px solid var(--gq-color-separator);
  border-radius: var(--gq-radius-panel);
  background: var(--gq-color-surface);
  margin: 0 0 1rem;
  padding: 1rem;
}

legend {
  font-weight: 700;
  padding: 0 0.25rem;
}

.help {
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
  color: var(--gq-color-text-muted);
}

.rows {
  display: grid;
  gap: 0.75rem;
}

.stop-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem 0.75rem;
  align-items: end;
  padding: 0.75rem;
  border: 1px solid var(--gq-color-separator);
  border-radius: var(--gq-radius-control);
  background: var(--gq-color-paper);
}

@media (min-width: 48rem) {
  .stop-row {
    grid-template-columns: 1.5fr 1fr 1fr 1fr auto;
  }
}

.field-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.field-row .field {
  flex: 1 1 10rem;
}

.field {
  display: grid;
  gap: 0.25rem;
  min-width: 0;
}

.field-time input,
.field-narrow input {
  font-family: var(--gq-font-data);
}

label {
  font-size: 0.875rem;
  font-weight: 600;
}

input[type="text"],
select {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.5rem;
  border: 1px solid var(--gq-color-control-border);
  border-radius: var(--gq-radius-control);
  background: var(--gq-color-surface);
  color: var(--gq-color-text);
  font: inherit;
}

input[aria-invalid="true"],
select[aria-invalid="true"] {
  border-color: var(--gq-color-danger-text);
  outline: 2px solid var(--gq-color-danger-text);
  outline-offset: 0;
}

input:disabled {
  background: var(--gq-color-paper-subtle);
  color: var(--gq-color-text-muted);
}

button {
  font: inherit;
  min-height: 2.75rem;
  padding: 0.5rem 1rem;
  border-radius: var(--gq-radius-control);
  border: 1px solid var(--gq-color-control-border);
  background: var(--gq-color-surface);
  color: var(--gq-color-text);
  cursor: pointer;
}

button.primary {
  background: var(--gq-color-ink);
  border-color: var(--gq-color-ink);
  color: #f7f5ef;
  font-weight: 700;
}

button.secondary {
  background: var(--gq-color-surface);
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

button.remove-row {
  min-height: 2.75rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
}

a {
  color: var(--gq-color-text);
}

:focus-visible {
  outline: 2px solid var(--gq-color-ink);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px var(--gq-color-acid);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 0.75rem;
}

.sample-note,
.notice-inline {
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
  color: var(--gq-color-text-muted);
}

.status {
  margin: 0 0 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--gq-radius-panel);
  background: var(--gq-color-info-surface);
  font-weight: 600;
}

.error-list {
  margin: 0 0 1rem;
}

.error-item {
  padding: 0.75rem 1rem;
  border: 1px solid var(--gq-color-danger-text);
  border-radius: var(--gq-radius-panel);
  background: var(--gq-color-danger-surface);
  color: var(--gq-color-danger-text);
}

.error-item p {
  margin: 0 0 0.5rem;
}

.error-item code {
  font-family: var(--gq-font-data);
  font-weight: 700;
}

.error-goto {
  min-height: 2.75rem;
}

#results h2 {
  font-size: 1.25rem;
  margin: 0 0 0.75rem;
}

.notice {
  padding: 0.75rem 1rem;
  border: 1px solid var(--gq-color-separator);
  border-radius: var(--gq-radius-panel);
  background: var(--gq-color-surface);
}

.notice h2 {
  margin: 0 0 0.5rem;
}

.notice p {
  margin: 0 0 0.5rem;
}

/* Travel matrix: the table itself may scroll horizontally inside its
   wrapper on narrow screens; the source select offers a one-row view. */
.matrix-wrap {
  overflow-x: auto;
  max-width: 100%;
}

.matrix-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.875rem;
}

.matrix-table th,
.matrix-table td {
  border: 1px solid var(--gq-color-separator);
  padding: 0.375rem;
  text-align: left;
  vertical-align: middle;
}

.matrix-table thead th {
  background: var(--gq-color-paper-subtle);
}

.matrix-table tbody th {
  background: var(--gq-color-paper-subtle);
  white-space: nowrap;
}

.matrix-table td input[type="text"] {
  width: 4.5rem;
  min-height: 2.75rem;
  font-family: var(--gq-font-data);
}

.matrix-table td input[type="checkbox"] {
  width: 1.25rem;
  height: 1.25rem;
  accent-color: var(--gq-color-ink);
  vertical-align: middle;
}

.matrix-table label.nodirect {
  font-size: 0.8125rem;
  font-weight: 400;
  margin-left: 0.25rem;
  white-space: nowrap;
}

.matrix-table .diag {
  font-family: var(--gq-font-data);
  color: var(--gq-color-text-muted);
}

.matrix-row-hidden {
  display: none;
}

/* Result table: real table, times in HH:MM, waits and service in minutes. */
.result-table {
  border-collapse: collapse;
  width: 100%;
  background: var(--gq-color-surface);
  font-size: 0.9375rem;
}

.result-table th,
.result-table td {
  border: 1px solid var(--gq-color-separator);
  padding: 0.5rem 0.625rem;
  text-align: left;
}

.result-table thead th {
  background: var(--gq-color-paper-subtle);
}

.result-table td {
  font-family: var(--gq-font-data);
}

.return-line {
  margin: 0.75rem 0 0;
  font-weight: 700;
}

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