:root {
  --mw-bg: #f4f7f7;
  --mw-surface: #ffffff;
  --mw-surface-2: #eef4f4;
  --mw-text: #173036;
  --mw-muted: #5c7378;
  --mw-border: #d7e2e4;
  --mw-primary: #0d6973;
  --mw-primary-hover: #0b5b63;
  --mw-accent: #d7263d;
  --mw-shadow: 0 12px 32px rgba(23,48,54,.08);
  --mw-radius-lg: 20px;
  --mw-radius-md: 14px;
  --mw-radius-sm: 10px;
}

body {
  margin: 0;
  background: linear-gradient(180deg,#f7f9f9 0%,#edf3f4 100%);
  color: var(--mw-text);
  font-family: 'Inter', system-ui, sans-serif;
}
.demo-shell { max-width: 1280px; margin: 0 auto; padding: 32px 20px 48px; }
.demo-hero  { margin-bottom: 22px; }
.demo-eyebrow { margin: 0 0 8px; color: var(--mw-primary); font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.demo-hero h1 { margin: 0; font-size: clamp(28px,5vw,46px); line-height: 1.05; }
.demo-intro   { max-width: 860px; margin: 12px 0 0; color: var(--mw-muted); font-size: 16px; line-height: 1.6; }

/* ── Widget shell ── */
.macc-widget, .macc-widget * { box-sizing: border-box; }
.macc-widget { display: grid; gap: 18px; }

/* ── Controls bar ── */
.mw-controls {
  background: rgba(255,255,255,.78);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,.85);
  border-radius: 24px;
  box-shadow: var(--mw-shadow);
  padding: 18px 22px;
}
.mw-controls-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

/* Filter pills */
.mw-filter-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.mw-filter-btn {
  border: 1.5px solid var(--mw-border);
  background: var(--mw-surface);
  color: var(--mw-muted);
  border-radius: 999px;
  height: 40px;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: .15s ease;
  white-space: nowrap;
}
.mw-filter-btn:hover { border-color: var(--mw-primary); color: var(--mw-primary); }
.mw-filter-btn.is-active {
  background: var(--mw-primary);
  border-color: var(--mw-primary);
  color: #fff;
}

/* Search group */
.mw-search-group {
  display: flex;
  gap: 8px;
  flex: 1 1 320px;
  min-width: 0;
}
.mw-search-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
}
.mw-search-input {
  width: 100%;
  height: 48px;
  padding: 0 16px 0 46px;
  border-radius: 14px;
  border: 1.5px solid var(--mw-border);
  background: var(--mw-surface);
  font-size: 15px;
  color: var(--mw-text);
  outline: none;
  transition: border-color .15s;
}
.mw-search-input:focus { border-color: var(--mw-primary); box-shadow: 0 0 0 3px rgba(13,105,115,.1); }
.mw-search-icon {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  color: var(--mw-muted); font-size: 18px; pointer-events: none;
}
/* 📍 geo button — sibling flex item */
.mw-geo-btn {
  border: 1.5px solid var(--mw-border);
  background: var(--mw-surface);
  color: var(--mw-primary);
  cursor: pointer;
  width: 48px; height: 48px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  transition: .15s;
  flex-shrink: 0;
}
.mw-geo-btn:hover {
  background: var(--mw-surface-2);
  border-color: var(--mw-primary);
  box-shadow: 0 0 0 3px rgba(13,105,115,.1);
}
.mw-geo-btn svg { display: block; }
.mw-search-btn {
  height: 48px;
  padding: 0 22px;
  border-radius: 14px;
  border: 1.5px solid var(--mw-primary);
  background: var(--mw-primary);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  transition: .15s;
}
.mw-search-btn:hover { background: var(--mw-primary-hover); }
.mw-search-btn.is-loading { opacity: .7; cursor: default; }

/* ── Main layout ── */
.mw-main {
  display: grid;
  grid-template-columns: minmax(360px, 1.1fr) minmax(360px, .9fr);
  gap: 18px;
  align-items: start;
}
.mw-left, .mw-right { min-width: 0; }

/* Context line */
.mw-context {
  font-size: 13px;
  color: var(--mw-muted);
  margin-bottom: 14px;
  line-height: 1.5;
}
.mw-context strong { color: var(--mw-text); }
.mw-link-btn {
  background: none; border: none; padding: 0;
  color: var(--mw-primary); font-size: 13px; font-weight: 700;
  cursor: pointer; text-decoration: underline;
}
.mw-fallback-note {
  font-size: 13px; color: var(--mw-muted);
  background: #fffbe6; border: 1px solid #f0e090;
  border-radius: 10px; padding: 10px 14px; margin-bottom: 12px;
}

/* ── Cards ── */
.mw-card-list { display: grid; gap: 12px; }
.mw-card {
  background: #fff;
  border: 1.5px solid var(--mw-border);
  border-radius: 18px;
  padding: 18px;
  display: grid;
  gap: 12px;
  cursor: pointer;
  transition: box-shadow .15s, border-color .15s;
}
.mw-card:hover { box-shadow: var(--mw-shadow); border-color: #b8ced2; }

.mw-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.mw-card-title-group { flex: 1; min-width: 0; }
.mw-card-title {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
  color: var(--mw-text);
}
.mw-card-address {
  margin-top: 3px;
  font-size: 12px;
  color: var(--mw-muted);
  line-height: 1.4;
}
.mw-card-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}
.mw-dist {
  font-size: 12px;
  color: var(--mw-muted);
  font-weight: 700;
  white-space: nowrap;
}
.mw-badges { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.mw-badge {
  display: inline-flex; align-items: center;
  height: 24px; padding: 0 10px; border-radius: 999px;
  font-size: 11px; font-weight: 800; letter-spacing: .02em;
}
.mw-badge--vaccin    { background: #e8f5f6; color: var(--mw-primary); }
.mw-badge--provtagning { background: #f0eeff; color: #5b45b0; }

/* Times block */
.mw-times {
  background: #f6fafb;
  border: 1px solid #ddebed;
  border-radius: 12px;
  padding: 12px 14px;
}
.mw-times--empty { background: #fafafa; border-color: var(--mw-border); }
.mw-times-label {
  display: block; margin-bottom: 5px;
  font-size: 10px; font-weight: 800; letter-spacing: .08em;
  text-transform: uppercase; color: var(--mw-muted);
}
.mw-time { font-size: 15px; font-weight: 800; line-height: 1.4; }
.mw-time--dim  { font-size: 13px; font-weight: 600; color: var(--mw-muted); margin-top: 2px; }
.mw-time--none { font-size: 14px; font-weight: 600; color: #aab8ba; }

/* Actions */
.mw-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.mw-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 40px; padding: 0 16px; border-radius: 10px;
  font-size: 13px; font-weight: 800; text-decoration: none;
  border: 1.5px solid transparent; cursor: pointer;
  transition: .15s;
}
.mw-btn--primary  { background: var(--mw-primary); color: #fff; border-color: var(--mw-primary); }
.mw-btn--primary:hover { background: var(--mw-primary-hover); }
.mw-btn--outline  { background: #fff; color: var(--mw-primary); border-color: var(--mw-primary); }
.mw-btn--outline:hover { background: var(--mw-surface-2); }
.mw-btn--ghost    { background: #fff; color: var(--mw-muted); border-color: var(--mw-border); }
.mw-btn--ghost:hover { border-color: #b8ced2; color: var(--mw-text); }

/* Empty state */
.mw-empty {
  border: 1.5px dashed var(--mw-border);
  border-radius: 14px; padding: 20px;
  color: var(--mw-muted); background: #fff;
  font-size: 14px;
}

/* ── Map ── */
.mw-right { display: flex; flex-direction: column; position: sticky; top: 18px; align-self: start; }
.mw-map-hint {
  font-size: 12px; color: var(--mw-muted);
  text-align: center; margin-bottom: 8px;
  letter-spacing: .01em;
}
.mw-map-shell { position: sticky; top: 18px; }
.mw-map {
  height: 620px;
  border-radius: 18px;
  overflow: hidden;
  border: 1.5px solid var(--mw-border);
  box-shadow: 0 8px 24px rgba(23,48,54,.07);
}

/* Popup */
.mw-popup-title { font-weight: 800; font-size: 15px; margin-bottom: 4px; }
.mw-popup-addr  { font-size: 12px; color: var(--mw-muted); margin-bottom: 4px; }
.mw-popup-next  { font-size: 13px; font-weight: 700; margin-bottom: 10px; }
.mw-popup-actions { display: flex; gap: 7px; flex-wrap: wrap; }
.mw-popup-actions a {
  text-decoration: none; padding: 7px 11px; border-radius: 9px;
  font-size: 12px; font-weight: 800;
  border: 1.5px solid var(--mw-border);
}
.mw-popup-actions a:first-child { background: var(--mw-primary); color: #fff; border-color: var(--mw-primary); }
.mw-popup-actions a:last-child  { background: #fff; color: var(--mw-primary); }


/* ── Map markers ── */
.mw-marker-wrap {
  position: relative;
  width: 28px;
  height: 36px;
  filter: drop-shadow(0 3px 6px rgba(0,0,0,.28));
}
.mw-marker-wrap svg { display: block; }
.mw-marker-pulse {
  position: absolute;
  top: 3px; left: 50%;
  transform: translateX(-50%);
  width: 28px; height: 28px;
  border-radius: 50%;
  opacity: 0;
  animation: mw-pulse 2.2s ease-out infinite;
}
@keyframes mw-pulse {
  0%   { transform: translateX(-50%) scale(.6); opacity: .55; }
  70%  { transform: translateX(-50%) scale(2);  opacity: 0; }
  100% { transform: translateX(-50%) scale(2);  opacity: 0; }
}


/* ── Autocomplete dropdown ── */
.mw-autocomplete {
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  z-index: 1000;
  margin: 0; padding: 6px;
  list-style: none;
  background: #fff;
  border: 1.5px solid var(--mw-border);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(23,48,54,.13);
  overflow: hidden;
}
.mw-autocomplete[hidden] { display: none; }
.mw-autocomplete-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 9px;
  cursor: pointer;
  transition: background .1s;
}
.mw-autocomplete-item:hover,
.mw-autocomplete-item.is-active { background: var(--mw-surface-2); }
.mw-autocomplete-name {
  font-size: 14px; font-weight: 700; color: var(--mw-text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mw-autocomplete-city {
  font-size: 12px; color: var(--mw-muted);
  white-space: nowrap; flex-shrink: 0;
}

/* ── Responsive ── */
@media (max-width: 980px) {
  .mw-main { grid-template-columns: 1fr; }
  .mw-map-shell { position: static; }
  .mw-map { height: 420px; }
  .mw-right { order: -1; }
}
@media (max-width: 680px) {
  .demo-shell { padding: 16px 12px 32px; }
  .mw-controls { padding: 14px 16px; }
  .mw-controls-row { flex-direction: column; align-items: stretch; }
  .mw-filter-group { justify-content: flex-start; }
  .mw-search-group { flex-wrap: wrap; }
  .mw-search-wrap { flex: 1 1 0; min-width: 0; }
  .mw-search-btn { flex: 1 1 100%; width: 100%; }
  .mw-map { height: 300px; }
  .mw-actions { flex-direction: column; }
  .mw-btn { width: 100%; }
}


/* --- Card accordion / quick action tweaks --- */
.mw-card { padding: 0; overflow: hidden; cursor: default; gap: 0; }
.mw-card-toggle { display: block; width: 100%; border: 0; background: transparent; padding: 0; text-align: left; cursor: pointer; }
.mw-card-top { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; padding: 18px; align-items: start; }
.mw-card-title-wrap { min-width: 0; }
.mw-card-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.mw-card-meta-distance { color: var(--mw-primary); font-weight: 700; font-size: 13px; }
.mw-card-right { align-items: flex-end; max-width: 220px; }
.mw-next { background: #f6fafb; border: 1px solid #ddebed; border-radius: 12px; padding: 10px 12px; min-width: 180px; }
.mw-next--empty { background: #fafafa; border-color: var(--mw-border); }
.mw-next-label { font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--mw-muted); margin-bottom: 5px; }
.mw-next-main { font-size: 15px; font-weight: 800; line-height: 1.3; }
.mw-next-sub { font-size: 13px; color: var(--mw-muted); font-weight: 600; margin-top: 2px; }
.mw-accordion-cta { margin-top: 8px; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: 13px; font-weight: 800; color: var(--mw-primary); }
.mw-accordion-count { font-size: 11px; color: var(--mw-muted); font-weight: 700; }
.mw-card-inline-actions { padding: 0 18px 18px; }
.mw-card-details { border-top: 1px solid var(--mw-border); background: #fff; }
.mw-card-details-inner { padding: 16px 18px 18px; display: grid; gap: 14px; }
.mw-upcoming-title { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--mw-muted); margin-bottom: 8px; }
.mw-upcoming-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.mw-upcoming-item { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; background: #f7fafb; border: 1px solid #e5eef0; border-radius: 10px; padding: 10px 12px; }
.mw-upcoming-item--empty { color: var(--mw-muted); }
.mw-upcoming-date { font-weight: 700; }
.mw-upcoming-time { color: var(--mw-muted); font-weight: 600; }
.mw-popup-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.mw-popup-actions button, .mw-popup-actions a { appearance: none; border: 1px solid var(--mw-border); background: #fff; color: var(--mw-primary); padding: 8px 10px; border-radius: 8px; text-decoration: none; font-weight: 700; font-size: 13px; cursor: pointer; }
.mw-popup-actions a:first-child { background: var(--mw-primary); color: #fff; border-color: var(--mw-primary); }
@media (max-width: 980px) { .mw-card-right { max-width: none; width: 100%; align-items: stretch; } }
@media (max-width: 680px) {
  .mw-card-top { grid-template-columns: 1fr; }
  .mw-card-right { width: 100%; }
  .mw-next { min-width: 0; }
  .mw-accordion-cta { align-items: flex-start; }
  .mw-upcoming-item { flex-direction: column; gap: 2px; }
}
