/* Mobile first. Colors meet WCAG AA contrast on white. */
:root {
    color-scheme: light;
    --ink: #1a1a1a;
    --muted: #4b5563;
    --accent: #4c1d95;
    --accent-soft: #ede9fe;
    --line: #d1d5db;
    --badge-bg: #fef3c7;
    --badge-ink: #78350f;
    --good: #065f46;
    --bad: #991b1b;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    line-height: 1.5;
    color: var(--ink);
    background: #fff;
}

* { box-sizing: border-box; }

body { margin: 0; }

a { color: var(--accent); }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.skip-link {
    position: absolute;
    left: 0.5rem;
    top: -3rem;
    background: var(--accent);
    color: #fff;
    padding: 0.5rem 0.75rem;
    z-index: 10;
}

.skip-link:focus { top: 0.5rem; }

.site-header {
    background: var(--accent);
    color: #fff;
    padding: 0.5rem 1rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 1rem;
}

.site-header a { color: #fff; }

.brand {
    font-weight: 700;
    font-size: 1.25rem;
    text-decoration: none;
    margin-right: auto;
}

.brand img { vertical-align: middle; margin-right: 0.4rem; }

.site-nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; }

.site-nav a { text-decoration: none; padding: 0.25rem 0; }

.site-nav a.active { text-decoration: underline; text-underline-offset: 0.3rem; }

main {
    max-width: 56rem;
    margin: 0 auto;
    padding: 1rem;
}

h1 { font-size: 1.5rem; margin: 0.5rem 0; }

h1:focus { outline: none; }

h2 { font-size: 1.25rem; margin: 1.5rem 0 0.5rem; }

.muted { color: var(--muted); }

.cards {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
    display: grid;
    gap: 0.75rem;
}

.card {
    display: block;
    border: 1px solid var(--line);
    border-radius: 0.5rem;
    padding: 0.875rem 1rem;
}

a.card { text-decoration: none; color: var(--ink); }

a.card strong { color: var(--accent); font-size: 1.125rem; }

.card h2, .card h3 { font-size: 1.125rem; margin: 0 0 0.25rem; }

.card p { margin: 0; }

.badge {
    display: inline-block;
    background: var(--badge-bg);
    color: var(--badge-ink);
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 0 0.5rem;
    border-radius: 999px;
    vertical-align: middle;
}

.badge.promoted { background: var(--accent-soft); color: var(--accent); }

.row { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }

button, .button {
    font: inherit;
    border: 1px solid var(--accent);
    background: #fff;
    color: var(--accent);
    border-radius: 0.375rem;
    padding: 0.375rem 0.875rem;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

button.primary, .button.primary { background: var(--accent); color: #fff; }

button[aria-pressed="true"] { background: var(--accent); color: #fff; }

.link-button {
    background: none;
    border: none;
    padding: 0;
    color: var(--accent);
    text-decoration: underline;
}

label { display: block; font-weight: 600; margin-top: 0.75rem; }

input, select, textarea {
    font: inherit;
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #6b7280;
    border-radius: 0.375rem;
    margin-top: 0.25rem;
}

input[type="checkbox"], input[type="radio"] { width: auto; }

.error { color: var(--bad); }

.ok { color: var(--good); }

table { border-collapse: collapse; width: 100%; }

th, td { text-align: left; padding: 0.375rem 0.5rem; border-bottom: 1px solid var(--line); vertical-align: top; }

dl { display: grid; gap: 0.25rem 1rem; grid-template-columns: max-content 1fr; }

dt { font-weight: 600; }

dd { margin: 0; }

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.account-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
    align-items: center;
    padding: 0.375rem 1rem;
    background: var(--accent-soft);
    font-size: 0.9375rem;
}

.account-nav a.active, .site-nav a.active { font-weight: 700; }

.small { font-size: 0.875rem; }

.note {
    margin-top: 0.5rem !important;
    padding: 0.375rem 0.625rem;
    border-left: 4px solid var(--badge-ink);
    background: var(--badge-bg);
    color: var(--badge-ink);
}

.reason { color: var(--accent); font-weight: 600; }

.panel {
    border: 1px solid var(--line);
    border-radius: 0.5rem;
    padding: 1rem;
    margin: 1rem 0;
}

.filters { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: end; }

.filters label { margin-top: 0; }

.filters select, .filters input { width: auto; min-width: 10rem; }

fieldset { border: 1px solid var(--line); border-radius: 0.375rem; margin: 0.75rem 0; }

.stars { display: flex; gap: 0.75rem; flex-wrap: wrap; }

.star-option { display: inline-flex; gap: 0.25rem; align-items: center; font-weight: 400; margin: 0; }

.compare { display: grid; gap: 1rem; grid-template-columns: 1fr; }

.bar-row { display: grid; grid-template-columns: 7rem 1fr 3rem; gap: 0.5rem; align-items: center; margin: 0.25rem 0; }

.bar { height: 0.875rem; background: var(--accent); border-radius: 0.25rem; }

.bar.alt { background: #0f766e; }

.bar.mid { background: #9a3412; }

.bar.small { background: #6d28d9; }

.stat { border: 1px solid var(--line); border-radius: 0.5rem; padding: 0.5rem 0.75rem; }
.stat strong { display: block; font-size: 1.4rem; color: var(--accent); }
ul.row { list-style: none; padding: 0; }

.tabs { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1rem 0; }

.tabs button[aria-selected="true"] { background: var(--accent); color: #fff; }

.map { margin: 1rem 0; }

.claim summary { cursor: pointer; color: var(--accent); margin: 1rem 0 0.5rem; }

.post { border-bottom: 1px solid var(--line); padding: 0.75rem 0; }

.post p { margin: 0.25rem 0; }

.warning { color: var(--bad); font-weight: 600; }

.scroll { overflow-x: auto; }

.dev-users { display: grid; gap: 0.5rem; }

@media (min-width: 64rem) {
    .compare { grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
}

@media (min-width: 48rem) {
    main { padding: 1.5rem; }
    h1 { font-size: 2rem; }
}

#blazor-error-ui {
    background: #fef3c7;
    color: var(--ink);
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 3rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    position: absolute;
    right: 0.75rem;
    top: 0.25rem;
    border: none;
    font-size: 1.5rem;
}

.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto;
}

.loading-progress circle {
    fill: none;
    stroke: #e5e7eb;
    stroke-width: 0.6rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}

.loading-progress circle:last-child {
    stroke: var(--accent);
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

.loading-progress-text:after {
    content: var(--blazor-load-percentage-text, "Loading");
}

/* Checkboxes next to their labels, and plain lists. */
.check { display: flex; align-items: center; gap: 0.5rem; }
.check input { width: auto; margin: 0; }
.plain { list-style: none; padding: 0; }
.button.primary, button.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.bar.alt { background: #0f766e; }
fieldset { border: 1px solid var(--line); border-radius: 0.5rem; margin: 0.75rem 0; }

/* Migration map: status colors that hold contrast on the light land color. */
.map svg { width: 100%; height: auto; border: 1px solid var(--line); border-radius: 0.5rem; }
.map-land { fill: #f1f5f9; }
.map-route { stroke: #64748b; stroke-width: 2; stroke-dasharray: 6 6; }
.map-end { fill: var(--ink); }
.map-label { font-size: 18px; fill: var(--ink); }
.map-dot { fill-opacity: 0.75; stroke: #fff; stroke-width: 1; }
.s-home { fill: #6b7280; background: #6b7280; }
.s-early { fill: #b45309; background: #b45309; }
.s-road { fill: #1d4ed8; background: #1d4ed8; }
.s-there { fill: #047857; background: #047857; }
.dot { display: inline-block; width: 0.8rem; height: 0.8rem; border-radius: 50%; vertical-align: middle; }
.filters > .check { flex-direction: row; align-items: center; align-self: flex-end; padding-bottom: 0.5rem; }
.filters > .check label { margin: 0; }
.filters input[type="checkbox"], .check input[type="checkbox"] { min-width: 0; width: 1.1rem; height: 1.1rem; }

/* Trust badges: who vouches for a listing. Text carries the meaning; color is a second cue. */
.badge.trust-owner { background: #dcfce7; color: #14532d; }
.badge.trust-official { background: #dbeafe; color: #1e3a8a; }
.badge.trust-fans { background: #f3e8ff; color: #581c87; }
.badge.trust-report { background: #fee2e2; color: #7f1d1d; }
.trust p { margin: 0.25rem 0; }

/* The "More" menu keeps the first screen short. */
.nav-more { position: relative; display: inline-block; }
.nav-more summary { cursor: pointer; color: inherit; }
.nav-more ul { position: absolute; right: 0; z-index: 10; list-style: none; margin: 0.25rem 0 0; padding: 0.5rem; background: var(--accent); border-radius: 0.5rem; min-width: 9rem; }
.nav-more li { margin: 0.25rem 0; }
.locate { display: grid; gap: 0.75rem; max-width: 32rem; }
.account-nav .nav-more ul { background: #fff; border: 1px solid var(--line); }
.stack { display: grid; gap: 0.5rem; max-width: 36rem; }
.small-heading { font-size: 1.125rem; margin: 0 0 0.25rem; }
.panel h4 { margin: 0 0 0.25rem; }

/* The Desk's own frame, darker so owners can tell it apart from the fan side. */
.desk-header { background: #1f2937; }

/* The first question: four big, easy targets. */
.choices { list-style: none; padding: 0; display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); margin: 1rem 0 1.5rem; }
.choice { display: flex; flex-direction: column; gap: 0.25rem; padding: 1rem 1.25rem; border: 2px solid var(--accent); border-radius: 0.75rem; text-decoration: none; color: var(--ink); min-height: 4.5rem; }
.choice strong { font-size: 1.25rem; color: var(--accent); }
.choice:hover, .choice:focus-visible { background: var(--accent-soft); }
.badge.ok-badge { background: #dcfce7; color: #14532d; }
button[aria-pressed="true"] { background: var(--accent); color: #fff; }

/* A wedding's guest site: calm and centered, no site navigation. */
.guest-site { max-width: 40rem; margin: 0 auto; padding: 2rem 1rem; }
.guest-site h1 { font-size: 2.25rem; text-align: center; margin-bottom: 0.25rem; }
.guest-date { text-align: center; font-size: 1.125rem; color: var(--muted); margin-top: 0; }
.guest-footer, .site-footer { text-align: center; padding: 2rem 1rem; }

/* Fundraiser progress toward the goal. */
.goal { margin: 1rem 0; }
.goal progress { width: 100%; height: 0.9rem; accent-color: var(--accent); }
.goal-numbers { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem; }

/* Matching a calendar's place name to a venue: long venue names must not push past a phone's screen. */
.match select { width: 100%; max-width: 100%; }
.match, .match > div { min-width: 0; }

/* P20: maps. The map makes its own layer so Leaflet's panes stay under the site's menus. */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.map { position: relative; z-index: 0; height: 60vh; min-height: 18rem; border: 1px solid var(--line); border-radius: 0.5rem; margin: 0.75rem 0; }
.map.map-small { height: 14rem; min-height: 0; }
.map-cross::after { content: ""; position: absolute; left: 50%; top: 50%; width: 1.5rem; height: 1.5rem; margin: -0.75rem 0 0 -0.75rem; z-index: 500; pointer-events: none;
    background: linear-gradient(var(--ink), var(--ink)) center / 2px 100% no-repeat, linear-gradient(var(--ink), var(--ink)) center / 100% 2px no-repeat; }
.checks { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; }
.checks legend { font-weight: 600; }
/* Leaflet places markers with transform; translate is applied on top, so the pin sits centered above its spot. */
.pin-anchor { width: auto !important; height: auto !important; translate: -50% -100%; }
.pin { display: inline-block; white-space: nowrap; padding: 0.1rem 0.45rem; border-radius: 0.75rem;
    background: var(--accent); color: #fff; font: 600 0.8rem/1.4 system-ui, sans-serif; border: 2px solid #fff; box-shadow: 0 1px 3px rgb(0 0 0 / 0.4); cursor: pointer; }
.pin.pin-town { background: #1e3a8a; font-size: 0.9rem; }
.pin.pin-selected { background: #b45309; }
.pin.pin-stage { background: #7c2d12; }
.pin.pin-spot { background: #065f46; font-weight: 500; }
.pin.pin-closed { background: #4b5563; text-decoration: line-through; }
.pin-anchor:focus-visible { outline: none; }
.pin-anchor:focus-visible .pin { outline: 3px solid #f59e0b; outline-offset: 2px; }
.plan { width: 100%; height: auto; border: 1px solid var(--line); border-radius: 0.5rem; background: #f0fdf4; margin: 0.75rem 0; }
.plan text { font: 600 11px system-ui, sans-serif; }
.offline { background: #fef3c7; color: #78350f; padding: 0.5rem 0.75rem; border-radius: 0.375rem; }
