:root {
  --ink: #1c1917;
  --muted: #57534e;
  --line: #d6d3d1;
  --paper: #fafaf9;
  --panel: #ffffff;
  --accent: #1f6f5c;
  --error: #b91c1c;
}

* { box-sizing: border-box; }
/* A class with a display value must not show a hidden element (#202). */
[hidden] { display: none !important; }

body {
  margin: 0;
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

.site-header { padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--panel); }
.site-header a { color: var(--ink); font-weight: 600; text-decoration: none; }
/* #172: the privacy link */
.site-footer { padding: 12px 16px; border-top: 1px solid var(--line); }

.notice { margin: 0; padding: 6px 16px; background: #fef3c7; font-size: 14px; }

main { padding: 16px; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 20px; }
.panel.narrow { max-width: 560px; margin: 24px auto; }
.panel h1 { margin: 0 0 8px; font-size: 24px; line-height: 1.2; }

.configure { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; }
/* The map stays in view while the panel scrolls (#202): "Put the area here"
   puts the box at the centre of the map, so the whole map must be on the
   screen. Without this the map is as tall as the panel. */
.map {
  position: sticky; top: 16px; align-self: start; height: calc(100vh - 32px);
  border: 1px solid var(--line); border-radius: 8px;
}

/* A corner handle of the area box (#184): a 44 px hit area for a finger,
   with a small dot in the middle. touch-action stops the browser's own
   pan and zoom while a finger is on the handle. */
.area-handle {
  width: 44px; height: 44px; cursor: nwse-resize; touch-action: none;
  display: flex; align-items: center; justify-content: center;
}
.area-handle::after {
  content: ""; width: 14px; height: 14px; border-radius: 50%;
  background: var(--panel); border: 3px solid var(--accent);
}

@media (max-width: 800px) {
  .configure { grid-template-columns: minmax(0, 1fr); }
  /* One column: the map is above the panel and scrolls with the page. */
  .map { position: static; height: 50vh; }
}

label { display: block; margin-top: 12px; font-weight: 600; }
label.option { font-weight: 400; margin-top: 6px; }
fieldset { border: 0; padding: 0; margin: 16px 0 0; }
legend { padding: 0; font-weight: 600; }
input[type="file"] { display: block; width: 100%; margin-top: 6px; }

button {
  margin-top: 16px; padding: 10px 18px; font: inherit; font-weight: 600;
  color: #fff; background: var(--accent); border: 0; border-radius: 6px; cursor: pointer;
}

button.secondary {
  margin-top: 10px; padding: 6px 12px; font-weight: 400;
  color: var(--accent); background: transparent; border: 1px solid var(--accent);
}

/* The GPX upload control (#202) */
.route { padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.route-file { margin-top: 10px; overflow-wrap: anywhere; }
.route-file button.secondary { margin: 0 0 0 8px; padding: 2px 8px; font-size: 14px; }

.quote { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.price { margin: 0; font-size: 32px; font-weight: 700; }
.ships { margin: 4px 0 0; }
.small { font-size: 14px; color: var(--muted); }
.error { color: var(--error); font-weight: 600; }

/* The 3D preview (#171) */
.preview-panel { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.preview-view { width: 100%; margin-top: 10px; }
.preview-view canvas { display: block; width: 100%; height: auto; border-radius: 4px; touch-action: none; }
#preview-progress { margin: 8px 0 0; }

/* Places (#170) */
.place-panel { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.place-panel h2 { margin: 0 0 4px; font-size: 18px; }
.place-panel input[type="text"] { display: block; width: 100%; margin-top: 6px; padding: 6px 8px; font: inherit; }
.place-form + .place-form { margin-top: 12px; }
.place-list { margin: 8px 0 0; padding-left: 24px; }
.place-list li { margin-top: 6px; overflow-wrap: anywhere; }
.place-list form { display: inline; }
.place-list button.secondary { margin: 0 0 0 8px; padding: 2px 8px; font-size: 14px; }
.place-marker {
  width: 24px; height: 24px; border-radius: 50%; border: 2px solid #fff;
  background: var(--accent); color: #fff; font: 600 13px/20px system-ui, sans-serif;
  text-align: center; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}
