/* CW-WEB-9-A — Fieldwork geographic demonstration.
   Real basemap centrepiece; canonical palette only:
   deep purple #300950 · vivid purple #7540F5 · persimmon #ED6942 · bone #F7F4ED. */

.fwd-body { background: var(--cw-bone); color: var(--ink); }
.fwd-inner { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

/* ---- intro band: full-width vivid purple, text inner max 1440 ---- */
.fwd-hero { background: var(--cw-purple); color: var(--cw-bone); }
.fwd-hero-inner {
  max-width: 1440px; margin: 0 auto;
  padding: 28px clamp(20px, 4vw, 72px);
  display: flex; align-items: center; gap: 32px;
}
.fwd-hero-copy { flex: 1; min-width: 0; }
.fwd-demo-label {
  display: inline-block; font-size: 12px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
  padding: 3px 12px; border-radius: 999px;
  background: rgba(48, 9, 80, .35); color: var(--cw-bone);
  margin: 0 0 10px;
}
.fwd-title {
  font-family: var(--serif); font-weight: 700;
  font-size: clamp(30px, 3.4vw, 46px); line-height: 1.08;
  margin: 0 0 8px; color: var(--cw-bone);
}
.fwd-sub { font-size: clamp(15px, 1.4vw, 18px); margin: 0; opacity: .92; }
.fwd-hero-cta { flex: none; }
.fwd-cta {
  font-size: 16px; padding: 14px 26px; border-radius: 12px;
  background: var(--cw-persimmon); color: #fff; font-weight: 700;
  text-decoration: none; display: inline-block;
}
.fwd-cta:hover { filter: brightness(1.06); }
.fwd-cta:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

/* ---- steps strip (existing presentation, quiet) ---- */
.fwd-steps { background: var(--cw-violet); color: var(--cw-bone); }
.fwd-steps-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
  padding-top: 20px; padding-bottom: 20px;
}
.fwd-step {
  background: rgba(247, 244, 237, .06);
  border: 1px solid rgba(247, 244, 237, .16);
  border-radius: 12px; padding: 14px 16px;
}
.fwd-step h2 { font-family: var(--sans); font-size: 15px; margin: 8px 0 4px; color: var(--cw-bone); }
.fwd-step p { font-size: 13px; margin: 0; color: rgba(247, 244, 237, .82); line-height: 1.45; }
.fwd-step-num {
  display: inline-grid; place-items: center; width: 24px; height: 24px;
  border-radius: 50%; background: var(--cw-persimmon); color: #fff;
  font-size: 12.5px; font-weight: 700;
}

/* ---- toolbar: white, full-width ---- */
.fwd-toolbar {
  background: #fff; border-bottom: 1px solid var(--bone-line, #e3ddd1);
  min-height: 64px; display: flex; align-items: center;
}
.fwd-toolbar-inner {
  max-width: 1440px; margin: 0 auto; width: 100%;
  padding: 10px clamp(20px, 4vw, 72px);
  display: flex; align-items: center; gap: 20px;
}
.fwd-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.fwd-toolbar-mid { margin-left: auto; }
.fwd-toolbar-right { display: flex; }
.fwd-chip {
  font: inherit; font-size: 14px; font-weight: 600;
  padding: 7px 15px; border-radius: 999px; cursor: pointer;
  border: 1.5px solid var(--cw-violet); background: #fff; color: var(--cw-violet);
}
.fwd-chip:hover { background: rgba(117, 64, 245, .08); }
.fwd-chip.is-on { background: var(--cw-violet); color: var(--cw-bone); }
.fwd-chip:focus-visible { outline: 3px solid var(--cw-persimmon); outline-offset: 2px; }
.fwd-toggle[aria-pressed="true"]::before { content: "✓ "; }

/* ---- map region: full-bleed ---- */
.fwd-mapregion {
  position: relative; width: 100%;
  height: max(560px, calc(100dvh - 300px));
  background: #dce5da;
}
#fw-map { position: absolute; inset: 0; width: 100%; height: 100%; }
.fwd-mapregion.is-placing #fw-map { cursor: crosshair; }

/* legend card — bottom-left, above map, clear of attribution */
.fwd-legend {
  position: absolute; left: 14px; bottom: 14px; z-index: 800;
  background: #fff; border: 1px solid var(--bone-line, #e3ddd1);
  border-radius: 12px; padding: 12px 14px;
  max-width: 240px; box-shadow: 0 4px 18px rgba(48, 9, 80, .18);
  font-size: 12.5px;
}
.fwd-legend h2 { font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; margin: 0 0 8px; color: var(--cw-violet); }
.fwd-leg { display: flex; align-items: center; gap: 8px; padding: 2px 0; }
.fwd-leg .fw-m { flex: none; }
.fwd-leg-count { margin-left: auto; color: var(--muted); font-weight: 600; }
.fwd-leg-lines { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--bone-line, #eee7d8); color: var(--muted); }
.fwd-leg-line { display: flex; align-items: center; gap: 8px; padding: 2px 0; }
.fw-line { display: inline-block; width: 26px; height: 0; border-top: 3px solid #4A1FD0; opacity: .55; flex: none; }
.fw-line-maybe { border-top-style: dashed; border-top-color: var(--cw-persimmon); opacity: .9; }

/* marker shapes — kind distinguished by shape AND colour */
.fw-mk { display: block; width: 26px; height: 26px; }
.fw-mk svg { display: block; width: 100%; height: 100%; filter: drop-shadow(0 1px 2px rgba(48,9,80,.35)); }
.fw-mk:focus-visible { outline: 3px solid var(--cw-persimmon); border-radius: 50%; }
.leaflet-marker-icon.fw-leaflet-mk { background: transparent; border: none; }
.fw-leaflet-mk .fw-mk { border-radius: 50%; }
.fw-mk.is-new { animation: fwd-pop .5s ease-out; }
@keyframes fwd-pop { from { transform: scale(.3); opacity: .2; } to { transform: scale(1); opacity: 1; } }
.fw-mk-new { display: block; width: 26px; height: 26px; }
.fw-mk-new svg { filter: drop-shadow(0 0 0 transparent); }

/* pending draft marker */
.fw-draft { display: block; width: 30px; height: 30px; }

/* drawer — 420px right overlay */
.fwd-drawer {
  position: absolute; top: 0; right: 0; bottom: 0; z-index: 900;
  width: 420px; max-width: 92vw; display: none;
}
.fwd-drawer.open { display: block; }
.fwd-drawer-inner {
  height: 100%; background: #fff;
  border-left: 1px solid var(--bone-line, #e3ddd1);
  box-shadow: -6px 0 24px rgba(48, 9, 80, .22);
  padding: 22px 24px; overflow-y: auto;
  animation: fwd-drawer-in .22s ease-out;
}
@keyframes fwd-drawer-in { from { transform: translateX(48px); opacity: 0; } to { transform: none; opacity: 1; } }
.fwd-drawer-close {
  position: absolute; top: 14px; right: 14px;
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--bone-line, #e3ddd1); background: #fff;
  font-size: 20px; line-height: 1; cursor: pointer; color: var(--cw-violet);
}
.fwd-drawer-close:hover { background: var(--cw-bone); }
.fwd-kind-chip {
  display: inline-block; font-size: 12px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
  padding: 4px 12px; border-radius: 999px;
  background: var(--cw-violet); color: var(--cw-bone);
}
.fwd-drawer h3 {
  font-family: var(--serif); font-size: 26px; line-height: 1.15;
  color: var(--cw-violet); margin: 12px 0 4px; padding-right: 30px;
}
.fwd-drawer-street { font-size: 13.5px; color: var(--muted); margin: 0 0 14px; }
.fwd-drawer-note { font-size: 15px; line-height: 1.6; margin: 0 0 14px; }
.fwd-drawer-relcount {
  font-size: 13.5px; font-weight: 700; color: var(--cw-violet);
  border-top: 1px solid var(--bone-line, #eee7d8); padding-top: 12px;
  margin: 0 0 6px;
}
.fwd-drawer-links { margin: 0 0 16px; padding: 0; list-style: none; }
.fwd-drawer-links li { font-size: 14px; line-height: 1.5; padding: 4px 0; }
.fwd-drawer-links em { color: var(--muted); font-size: 12.5px; }
.fwd-linkbtn {
  font: inherit; color: var(--cw-purple); font-weight: 600;
  background: none; border: none; padding: 0; cursor: pointer;
  text-decoration: underline; text-underline-offset: 2px;
}
.fwd-drawer-records {
  display: inline-block; font-weight: 700; font-size: 15px;
  color: var(--cw-purple); text-decoration: none;
  border-bottom: 2px solid var(--cw-persimmon); padding-bottom: 2px;
}
.fwd-drawer-records::after { content: " \2192"; }
.fwd-drawer-records:hover { color: var(--cw-violet); }

/* click-to-place hint bar over the map */
.fwd-place-hint {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
  z-index: 850; margin: 0; max-width: min(560px, 92vw);
  background: var(--cw-violet); color: var(--cw-bone);
  border-radius: 10px; padding: 10px 16px; font-size: 13.5px;
  box-shadow: 0 6px 20px rgba(48, 9, 80, .35);
  display: flex; align-items: center; gap: 12px;
}
.fwd-place-hint[hidden] { display: none; }
.fwd-hint-close {
  font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer;
  background: transparent; color: var(--cw-bone);
  border: 1px solid rgba(247, 244, 237, .5); border-radius: 6px; padding: 4px 10px;
}

/* quiet geography note under the map */
.fwd-geonote {
  margin: 0; padding: 10px 24px; text-align: center;
  font-size: 13px; color: var(--muted); background: var(--cw-bone);
}

/* ---- below-map content (existing presentation, unchanged behaviour) ---- */
.fwd-listwrap { padding: 40px 0 8px; }
.fwd-listwrap h3 { font-family: var(--display); font-size: 22px; margin: 0 0 4px; }
.fwd-list-note { font-size: 14px; color: var(--muted); margin: 0 0 16px; }
.fwd-list { list-style: none; margin: 0 0 28px; padding: 0; columns: 2; column-gap: 16px; }
.fwd-li { break-inside: avoid; margin-bottom: 8px; }
.fwd-li-btn {
  display: flex; align-items: baseline; gap: 10px; width: 100%;
  font: inherit; text-align: left; cursor: pointer;
  background: #fff; border: 1px solid var(--bone-line, #e3ddd1);
  border-radius: 10px; padding: 10px 14px;
}
.fwd-li-btn:hover { border-color: var(--cw-purple); }
.fwd-li-btn.is-selected { border-color: var(--cw-persimmon); box-shadow: 0 0 0 1px var(--cw-persimmon); }
.fwd-li-name { font-weight: 700; }
.fwd-li-meta { margin-left: auto; font-size: 12.5px; color: var(--muted); text-align: right; }
.fw-m { display: inline-block; width: 13px; height: 13px; flex: none; }
.fw-m-place { background: var(--cw-violet); border-radius: 3px; }
.fw-m-group { background: var(--cw-purple); border-radius: 50%; }
.fw-m-skill { background: var(--cw-persimmon); transform: rotate(45deg); border-radius: 2px; }
.fw-m-resource { background: var(--cw-bone); border: 2px solid var(--cw-violet); border-radius: 2px; clip-path: polygon(50% 0, 100% 100%, 0 100%); }

.fwd-panel {
  background: #fff; border: 1px solid var(--bone-line, #e3ddd1);
  border-radius: 16px; padding: 24px 26px;
}
.fwd-insights-wrap { margin-bottom: 40px; }
.fwd-insights { margin: 0; padding-left: 20px; }
.fwd-insights li { font-size: 14.5px; line-height: 1.6; margin-bottom: 8px; }

.fwd-flow { background: var(--cw-violet); padding: 48px 0; }
.fwd-flow-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.fwd-panel h2 { font-family: var(--serif); font-size: 26px; margin: 4px 0 10px; color: var(--cw-violet); }
.fwd-panel .eyebrow { color: var(--cw-purple); }
.fwd-note { font-size: 14.5px; line-height: 1.6; color: var(--muted); margin: 0 0 16px; }
.fwd-field { margin-bottom: 16px; border: none; padding: 0; }
.fwd-field label, .fwd-field-label { display: block; font-size: 14px; font-weight: 700; margin-bottom: 6px; }
.fwd-field input[type="text"], .fwd-field select, .fwd-field textarea {
  width: 100%; font: inherit; font-size: 14.5px;
  padding: 9px 12px; border: 1.5px solid var(--bone-line, #d8d0c0);
  border-radius: 8px; background: #fff;
}
.fwd-field input:focus-visible, .fwd-field select:focus-visible, .fwd-field textarea:focus-visible {
  outline: 3px solid rgba(117, 64, 245, .35); border-color: var(--cw-purple);
}
.fwd-where-row { display: flex; gap: 10px; }
.fwd-where-row select { flex: 1; }
.fwd-where-readout { font-size: 13px; color: var(--cw-purple); margin: 6px 0 0; min-height: 1.2em; }
.fwd-targets { max-height: 150px; overflow-y: auto; display: grid; gap: 4px; }
.fwd-target { font-size: 13.5px; display: flex; gap: 8px; align-items: baseline; }
.fwd-target-kind { color: var(--muted); font-size: 12px; }
.fwd-opt { color: var(--muted); font-weight: 400; }
.fwd-form-actions { margin-top: 8px; }
.fwd-form-note { font-size: 12.5px; color: var(--muted); margin: 10px 0 0; }
.fwd-empty { font-size: 14px; color: var(--muted); }
.fwd-qc { border: 1px solid var(--bone-line, #e3ddd1); border-radius: 12px; padding: 16px 18px; margin-bottom: 14px; }
.fwd-qc-status { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--cw-persimmon); margin: 0 0 4px; }
.fwd-qc-name { font-size: 18px; margin: 0 0 4px; color: var(--cw-violet); }
.fwd-qc-meta { font-size: 13px; color: var(--muted); margin: 0 0 8px; }
.fwd-qc-note { font-size: 14px; margin: 0 0 8px; }
.fwd-qc-links { font-size: 13.5px; margin: 0 0 12px; }
.fwd-qc-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.fwd-declined-h { font-size: 15px; margin: 16px 0 6px; }
.fwd-declined-list { margin: 0; padding-left: 18px; font-size: 13.5px; color: var(--muted); }

.fwd-outro { padding: 48px 0; }
.fwd-outro-card {
  background: #fff; border: 1px solid var(--bone-line, #e3ddd1);
  border-radius: 16px; padding: 30px 34px; max-width: 780px;
}
.fwd-outro-card h2 { font-family: var(--serif); font-size: 26px; margin: 0 0 10px; color: var(--cw-violet); }
.fwd-outro-card p { font-size: 15px; line-height: 1.65; }
.fwd-outro-actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 18px 0 6px; }
.fwd-limit { font-size: 13px; color: var(--muted); margin-bottom: 0; }

/* accessibility helpers already provided by styles.css (.sr-only, .skip-link) */

/* ---- tablet ---- */
@media (max-width: 1023px) {
  .fwd-hero-inner { padding-top: 22px; padding-bottom: 22px; }
  .fwd-steps-grid { grid-template-columns: repeat(2, 1fr); }
  .fwd-mapregion { height: max(480px, 62dvh); }
  .fwd-drawer { width: min(360px, 85vw); }
  .fwd-list { columns: 1; }
}

/* ---- mobile ---- */
@media (max-width: 619px) {
  .fwd-hero-inner { flex-direction: column; align-items: stretch; gap: 16px; padding-top: 20px; padding-bottom: 20px; }
  .fwd-cta { text-align: center; }
  .fwd-steps-grid { grid-template-columns: 1fr; }
  .fwd-toolbar-inner { gap: 10px; padding-top: 8px; padding-bottom: 8px; }
  .fwd-chips {
    flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none; max-width: 100%;
  }
  .fwd-chips::-webkit-scrollbar { display: none; }
  .fwd-chip { white-space: nowrap; }
  .fwd-toolbar-mid { margin-left: 0; }
  .fwd-toolbar-inner { flex-wrap: wrap; }
  .fwd-mapregion { height: max(380px, 56dvh); }
  .fwd-drawer {
    top: auto; left: 0; right: 0; bottom: 0;
    width: 100%; max-width: none; height: max(240px, 72dvh);
  }
  .fwd-drawer-inner {
    border-left: none; border-top: 1px solid var(--bone-line, #e3ddd1);
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -6px 24px rgba(48, 9, 80, .25);
    animation: fwd-sheet-in .22s ease-out;
  }
  @keyframes fwd-sheet-in { from { transform: translateY(48px); opacity: 0; } to { transform: none; opacity: 1; } }
  .fwd-legend { left: 10px; bottom: 10px; max-width: 200px; padding: 10px 12px; font-size: 11.5px; }
  .fwd-flow-grid { grid-template-columns: 1fr; }
}

/* respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .fwd-drawer-inner, .fw-mk.is-new { animation: none; }
}
