:root {
  --md-porcelain: #f3f5f2;
  --md-paper: #ffffff;
  --md-ink: #132237;
  --md-ink-soft: #445164;
  --md-jade: #2f7069;
  --md-jade-deep: #1e514e;
  --md-mist: #dfe9e5;
  --md-vermilion: #c95243;
  --md-line: #d6dedb;
  --md-shadow: 0 24px 70px rgba(18, 34, 48, .09);
  --md-body: "Avenir Next", "Segoe UI", Helvetica, Arial, sans-serif;
  --md-display: "Avenir Next", "Segoe UI", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
.mad-directory-page { margin: 0; background: var(--md-porcelain); color: var(--md-ink); font-family: var(--md-body); line-height: 1.55; -webkit-font-smoothing: antialiased; }
.mad-directory-page img { max-width: 100%; }
.mad-directory-page a { color: inherit; }
.md-shell { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }

.md-nav { position: relative; z-index: 10; border-bottom: 1px solid var(--md-line); background: rgba(255,255,255,.96); }
.md-nav__inner { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 28px; }
.md-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.md-brand__seal { width: 46px; height: 46px; display: grid; place-items: center; flex: 0 0 46px; border-radius: 50% 50% 50% 12px; background: var(--md-ink); color: #fff; font-family: var(--md-display); font-size: 17px; font-weight: 800; letter-spacing: -.06em; transform: rotate(-4deg); }
.md-brand > span:last-child { display: grid; }
.md-brand strong { font-family: var(--md-display); font-size: 18px; font-weight: 800; letter-spacing: -.025em; }
.md-brand small { color: var(--md-ink-soft); font-size: 11px; letter-spacing: .025em; }
.md-nav nav { display: flex; gap: 24px; align-items: center; }
.md-nav nav a { position: relative; color: var(--md-ink-soft); font-size: 13px; font-weight: 750; text-decoration: none; }
.md-nav nav a::after { position: absolute; left: 0; right: 100%; bottom: -7px; height: 2px; background: var(--md-vermilion); content: ""; transition: right .18s ease; }
.md-nav nav a:hover::after, .md-nav nav a[aria-current="page"]::after { right: 0; }

.md-hero { overflow: hidden; background: linear-gradient(110deg, #f7f8f5 0 58%, #e7eeeb 58% 100%); }
.md-hero__grid { min-height: 650px; display: grid; grid-template-columns: minmax(0, 1.04fr) minmax(370px, .76fr); gap: 64px; align-items: center; padding-block: 72px; }
.md-hero__copy { animation: md-arrive .55s ease both; }
.md-eyebrow, .md-kicker { display: block; color: var(--md-vermilion); font-size: 11px; font-weight: 850; letter-spacing: .14em; text-transform: uppercase; }
.md-hero h1 { max-width: 780px; margin: 18px 0 22px; font-family: var(--md-display); font-size: clamp(52px, 6vw, 82px); font-weight: 800; letter-spacing: -.052em; line-height: .94; }
.md-hero__copy > p { max-width: 660px; margin: 0; color: var(--md-ink-soft); font-size: 18px; }
.md-search { max-width: 690px; margin-top: 32px; padding: 12px; border: 1px solid var(--md-line); border-radius: 18px; background: var(--md-paper); box-shadow: 0 16px 38px rgba(21, 44, 58, .08); }
.md-search label { display: block; padding: 0 4px 9px; color: var(--md-ink-soft); font-size: 11px; font-weight: 800; letter-spacing: .04em; }
.md-search > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.md-search input, .md-filter-panel input, .md-filter-panel select { width: 100%; min-height: 50px; border: 1px solid var(--md-line); border-radius: 11px; background: #f8faf8; color: var(--md-ink); font: inherit; }
.md-search input { padding: 0 15px; }
.md-search button, .md-filter-panel button { min-height: 50px; padding-inline: 20px; border: 0; border-radius: 11px; background: var(--md-jade); color: #fff; cursor: pointer; font: inherit; font-size: 13px; font-weight: 850; }
.md-search button:hover, .md-filter-panel button:hover { background: var(--md-jade-deep); }
.md-hero__links { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.md-hero__links span { margin-right: 4px; color: var(--md-ink-soft); font-size: 11px; font-weight: 750; }
.md-hero__links a { padding: 6px 10px; border: 1px solid var(--md-line); border-radius: 999px; background: rgba(255,255,255,.65); color: var(--md-jade-deep); font-size: 12px; font-weight: 750; text-decoration: none; }

.md-city-board { position: relative; overflow: hidden; min-height: 486px; padding: 28px 28px 22px; border-radius: 24px 5px 24px 24px; background: var(--md-ink); color: #fff; box-shadow: var(--md-shadow); animation: md-arrive .55s .12s ease both; }
.md-city-board::after { position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; border: 32px solid rgba(255,255,255,.04); border-radius: 50%; content: ""; }
.md-city-board__label { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding-bottom: 20px; border-bottom: 1px solid rgba(255,255,255,.14); }
.md-city-board__label span { color: #b9c9ca; font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.md-city-board__label strong { font-family: var(--md-display); font-size: 26px; letter-spacing: -.035em; }
.md-city-line { position: relative; display: grid; gap: 0; margin: 24px 0 18px; }
.md-city-line::before { position: absolute; left: 9px; top: 17px; bottom: 17px; width: 2px; background: rgba(255,255,255,.22); content: ""; }
.md-city-stop { position: relative; display: grid; grid-template-columns: 22px minmax(0, 1fr) 62px; gap: 12px; align-items: center; min-height: 106px; padding: 10px 0; color: #fff; text-decoration: none; }
.md-city-stop__dot { position: relative; z-index: 1; width: 20px; height: 20px; border: 6px solid var(--md-ink); border-radius: 50%; background: var(--md-vermilion); box-shadow: 0 0 0 2px rgba(255,255,255,.42); }
.md-city-stop > span:nth-child(2) { display: grid; min-width: 0; }
.md-city-stop small { color: #94aeae; font-size: 10px; font-style: normal; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.md-city-stop strong { overflow: hidden; margin: 2px 0; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.md-city-stop em { color: #cbd6d6; font-size: 11px; font-style: normal; }
.md-city-stop img { width: 62px; height: 62px; border-radius: 9px; object-fit: cover; }
.md-city-board__all { display: flex; justify-content: space-between; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.14); color: #fff; font-size: 12px; font-weight: 800; text-decoration: none; }
.md-city-board__all span { color: #f29a8d; }

.md-city-index { border-block: 1px solid var(--md-line); background: var(--md-paper); }
.md-city-index__inner { display: grid; grid-template-columns: .65fr 1.35fr; gap: 60px; align-items: center; padding-block: 30px; }
.md-city-index h2, .md-section h2, .md-owner h2, .md-archive h1 { font-family: var(--md-display); font-weight: 800; letter-spacing: -.04em; }
.md-city-index h2 { margin: 5px 0 0; font-size: 28px; line-height: 1.05; }
.md-city-index__links { display: flex; gap: 10px; overflow-x: auto; padding: 4px 0; }
.md-city-index__links a { min-width: 168px; display: grid; padding: 15px 16px; border-left: 3px solid var(--md-jade); background: var(--md-porcelain); text-decoration: none; }
.md-city-index__links strong { font-size: 13px; }
.md-city-index__links span { color: var(--md-ink-soft); font-size: 11px; }

.md-section { padding-block: 78px; }
.md-section__head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.md-section__head h2 { max-width: 760px; margin: 7px 0 0; font-size: clamp(34px, 4vw, 50px); line-height: .98; }
.md-section__head > a { color: var(--md-jade-deep); font-size: 13px; font-weight: 800; text-decoration: none; }
.md-card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.md-card { min-width: 0; overflow: hidden; border: 1px solid var(--md-line); border-radius: 16px; background: var(--md-paper); transition: transform .18s ease, box-shadow .18s ease; }
.md-card:hover { transform: translateY(-3px); box-shadow: 0 18px 44px rgba(22,39,53,.1); }
.md-card__image { position: relative; display: block; overflow: hidden; aspect-ratio: 4 / 3; background: var(--md-mist); }
.md-card__image img { width: 100%; height: 100%; display: block; object-fit: cover; transition: transform .25s ease; }
.md-card:hover .md-card__image img { transform: scale(1.025); }
.md-card__image > span { position: absolute; left: 12px; bottom: 12px; padding: 6px 9px; border-radius: 7px; background: rgba(19,34,55,.9); color: #fff; font-size: 10px; font-weight: 850; }
.md-card__body { padding: 20px; }
.md-card__meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.md-card__meta span { color: var(--md-jade-deep); font-size: 10px; font-weight: 850; text-transform: uppercase; }
.md-card__meta small { color: var(--md-ink-soft); font-size: 10px; }
.md-card h3 { margin: 11px 0 7px; font-family: var(--md-display); font-size: 25px; line-height: 1.02; letter-spacing: -.035em; }
.md-card h3 a { text-decoration: none; }
.md-card__body > p { min-height: 44px; margin: 0; color: var(--md-ink-soft); font-size: 12px; }
.md-card__tags { display: flex; gap: 6px; flex-wrap: wrap; min-height: 26px; margin-top: 14px; }
.md-card__tags span { padding: 5px 7px; border-radius: 6px; background: var(--md-mist); color: var(--md-jade-deep); font-size: 9px; font-weight: 750; }
.md-card__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 17px; }
.md-card__actions a { min-height: 40px; display: grid; place-items: center; border: 1px solid var(--md-line); border-radius: 9px; color: var(--md-jade-deep); font-size: 11px; font-weight: 850; text-decoration: none; }
.md-card__actions a:first-child { border-color: var(--md-jade); background: var(--md-jade); color: #fff; }

.md-help { display: grid; grid-template-columns: .9fr 1.1fr; gap: 68px; margin-bottom: 78px; padding: 46px; border-radius: 24px; background: var(--md-ink); color: #fff; }
.md-help h2 { margin: 8px 0 16px; font-size: clamp(36px, 4vw, 50px); line-height: .98; }
.md-help__intro > p, .md-help__items p { color: #c1cbd2; }
.md-help__items { display: grid; }
.md-help__items article { padding: 18px 0 18px 36px; border-bottom: 1px solid rgba(255,255,255,.14); }
.md-help__items article:first-child { padding-top: 0; }
.md-help__items article:last-child { border-bottom: 0; }
.md-help__items strong { font-size: 15px; }
.md-help__items p { margin: 5px 0 0; font-size: 12px; }

.md-service-strip { padding-block: 48px; border-block: 1px solid var(--md-line); background: var(--md-paper); }
.md-service-strip .md-shell > div { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.md-service-strip a { display: flex; min-width: 220px; flex: 1; justify-content: space-between; padding: 16px; border: 1px solid var(--md-line); color: var(--md-ink); font-size: 13px; font-weight: 800; text-decoration: none; }
.md-service-strip a span { color: var(--md-vermilion); }
.md-owner { padding-block: 72px; background: var(--md-jade); color: #fff; }
.md-owner__inner { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 48px; align-items: center; }
.md-owner .md-kicker { color: #ffd2cb; }
.md-owner h2 { max-width: 800px; margin: 8px 0 0; font-size: clamp(34px, 4vw, 52px); line-height: .98; }
.md-owner a { min-height: 52px; display: grid; place-items: center; padding: 0 20px; border-radius: 10px; background: #fff; color: var(--md-jade-deep); font-size: 12px; font-weight: 850; text-decoration: none; }
.md-footer { padding-block: 28px; background: #0c1727; color: #fff; }
.md-footer .md-shell { display: flex; justify-content: space-between; gap: 20px; }
.md-footer div > div { display: grid; }
.md-footer span { color: #aab6c4; font-size: 11px; }
.md-footer a { color: #dbe3ea; font-size: 12px; text-decoration: none; }
.md-footer nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px 20px; }
.md-footer nav a:hover { color: #fff; text-decoration: underline; text-underline-offset: 4px; }

.md-legal { min-height: 70vh; padding-block: 56px 82px; }
.md-legal article { max-width: 820px; padding: clamp(26px, 5vw, 56px); border: 1px solid var(--md-line); border-radius: 20px; background: var(--md-paper); box-shadow: var(--md-shadow); }
.md-legal h1, .md-legal h2 { font-family: var(--md-display); font-weight: 800; letter-spacing: -.04em; }
.md-legal h1 { max-width: 740px; margin: 0 0 28px; font-size: clamp(42px, 6vw, 68px); line-height: .95; }
.md-legal h2 { margin: 34px 0 8px; font-size: 24px; line-height: 1.05; }
.md-legal p, .md-legal li { color: var(--md-ink-soft); font-size: 14px; }
.md-legal a { color: var(--md-jade-deep); font-weight: 750; }

.md-form-page { min-height: 70vh; padding-block: 58px 82px; }
.md-form-page > .md-shell { display: grid; grid-template-columns: minmax(260px, .65fr) minmax(0, 1.35fr); gap: 56px; align-items: start; }
.md-form-intro { position: sticky; top: 28px; }
.md-form-intro h1 { margin: 12px 0 18px; font-family: var(--md-display); font-size: clamp(42px, 5vw, 64px); font-weight: 800; letter-spacing: -.05em; line-height: .94; }
.md-form-intro p { color: var(--md-ink-soft); }
.md-contribution-form, .md-form-notice { grid-column: 2; padding: 30px; border: 1px solid var(--md-line); border-radius: 18px; background: var(--md-paper); box-shadow: var(--md-shadow); }
.md-form-notice { margin-bottom: -34px; border-left: 5px solid var(--md-vermilion); box-shadow: none; }
.md-form-notice--success { border-left-color: var(--md-jade); }
.md-form-notice p { margin-bottom: 0; color: var(--md-ink-soft); }
.md-contribution-form fieldset { margin: 0 0 26px; padding: 0; border: 0; }
.md-contribution-form legend { width: 100%; margin-bottom: 16px; padding-bottom: 9px; border-bottom: 1px solid var(--md-line); font-family: var(--md-display); font-size: 22px; font-weight: 800; }
.md-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.md-form-grid label { display: grid; gap: 6px; }
.md-form-grid label > span { color: var(--md-ink-soft); font-size: 11px; font-weight: 800; }
.md-form-grid input, .md-form-grid textarea, .md-form-grid select { width: 100%; min-height: 48px; padding: 11px 12px; border: 1px solid var(--md-line); border-radius: 9px; background: #f8faf8; color: var(--md-ink); font: inherit; font-size: 13px; }
.md-form-grid textarea { resize: vertical; }
.md-form-wide { grid-column: 1 / -1; }
.md-form-consent { display: flex; gap: 10px; align-items: flex-start; color: var(--md-ink-soft); font-size: 12px; }
.md-form-consent input { margin-top: 3px; accent-color: var(--md-jade); }
.md-form-consent a { color: var(--md-jade-deep); font-weight: 750; }
.md-form-submit { width: 100%; min-height: 52px; margin-top: 20px; border: 0; border-radius: 10px; background: var(--md-jade); color: #fff; cursor: pointer; font: 850 13px/1 var(--md-body); }
.md-form-submit:hover { background: var(--md-jade-deep); }
.md-hp { position: absolute !important; left: -9999px !important; }

.md-archive { min-height: 70vh; }
.md-archive-hero { padding-block: 54px 84px; background: var(--md-ink); color: #fff; }
.md-breadcrumb { display: flex; gap: 8px; color: #aebac5; font-size: 11px; }
.md-breadcrumb a { text-decoration: none; }
.md-archive h1 { max-width: 880px; margin: 17px 0 16px; font-size: clamp(48px, 6vw, 78px); line-height: .91; }
.md-archive-hero p { max-width: 680px; margin: 0; color: #bdc8d1; font-size: 16px; }
.md-filter-panel { position: relative; z-index: 2; margin-top: -40px; padding: 20px; border: 1px solid var(--md-line); border-radius: 16px; background: var(--md-paper); box-shadow: var(--md-shadow); }
.md-filter-panel form { display: grid; grid-template-columns: 1.15fr .9fr .9fr auto; gap: 12px; align-items: end; }
.md-filter-panel label span { display: block; margin-bottom: 7px; color: var(--md-ink-soft); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.md-filter-panel input, .md-filter-panel select { padding-inline: 12px; font-size: 12px; }
.md-filter-panel button { white-space: nowrap; }
.md-results { padding-block: 64px 84px; }
.md-card-grid--archive { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.md-empty { padding: 50px; border: 1px dashed #acbab5; border-radius: 16px; background: rgba(255,255,255,.5); text-align: center; }
.md-empty strong { font-family: var(--md-display); font-size: 28px; }
.md-empty p { color: var(--md-ink-soft); }
.md-empty a { color: var(--md-jade-deep); font-weight: 800; }
.md-pagination { display: flex; justify-content: center; gap: 8px; margin-top: 36px; }
.md-pagination .page-numbers { min-width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--md-line); border-radius: 8px; background: #fff; text-decoration: none; }
.md-pagination .current { border-color: var(--md-jade); background: var(--md-jade); color: #fff; }

.mad-directory-page :focus-visible { outline: 3px solid var(--md-vermilion); outline-offset: 3px; }
@keyframes md-arrive { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

@media (max-width: 940px) {
  .md-hero__grid { grid-template-columns: 1fr; gap: 36px; }
  .md-city-board { min-height: 0; }
  .md-card-grid, .md-card-grid--archive { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .md-help { grid-template-columns: 1fr; gap: 34px; }
  .md-filter-panel form { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .md-shell { width: min(100% - 24px, 1180px); }
  .md-nav__inner { min-height: 68px; }
  .md-brand__seal { width: 40px; height: 40px; flex-basis: 40px; }
  .md-brand strong { font-size: 16px; }
  .md-brand small, .md-nav nav a:first-child { display: none; }
  .md-nav nav { gap: 0; }
  .md-hero { background: linear-gradient(180deg, #f7f8f5 0 68%, #e7eeeb 68% 100%); }
  .md-hero__grid { min-height: 0; padding-block: 44px; }
  .md-hero h1 { margin-top: 14px; font-size: 52px; line-height: .91; }
  .md-hero__copy > p { font-size: 16px; }
  .md-search { margin-top: 24px; padding: 9px; }
  .md-search > div { grid-template-columns: 1fr; }
  .md-search button { width: 100%; }
  .md-city-board { padding: 22px 20px; border-radius: 20px 5px 20px 20px; }
  .md-city-stop { grid-template-columns: 22px minmax(0, 1fr) 54px; }
  .md-city-stop img { width: 54px; height: 54px; }
  .md-city-index__inner { grid-template-columns: 1fr; gap: 18px; }
  .md-city-index__links { margin-right: -12px; }
  .md-section { padding-block: 52px; }
  .md-section__head { align-items: start; flex-direction: column; }
  .md-section__head h2 { font-size: 38px; }
  .md-card-grid, .md-card-grid--archive { grid-template-columns: 1fr; }
  .md-card h3 { font-size: 27px; }
  .md-help { margin-bottom: 52px; padding: 28px 22px; border-radius: 18px; }
  .md-help__items article { padding-left: 0; }
  .md-owner__inner { grid-template-columns: 1fr; gap: 26px; }
  .md-owner a { width: 100%; }
  .md-footer .md-shell { flex-direction: column; }
  .md-footer nav { justify-content: flex-start; }
  .md-legal { padding-block: 28px 52px; }
  .md-legal article { padding: 25px 20px; border-radius: 16px; }
  .md-form-page { padding-block: 36px 58px; }
  .md-form-page > .md-shell { grid-template-columns: 1fr; gap: 28px; }
  .md-form-intro { position: static; }
  .md-contribution-form, .md-form-notice { grid-column: 1; padding: 22px 18px; }
  .md-form-notice { margin-bottom: -12px; }
  .md-form-grid { grid-template-columns: 1fr; }
  .md-form-wide { grid-column: 1; }
  .md-archive-hero { padding-block: 34px 74px; }
  .md-archive h1 { font-size: 48px; }
  .md-filter-panel { margin-top: -30px; padding: 14px; }
  .md-filter-panel form { grid-template-columns: 1fr; }
  .md-results { padding-block: 48px 64px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
