:root {
    --accent: #b5313a;
    --accent-dark: #8f252d;
    --teal: #0b6b68;
    --teal-dark: #075654;
    --ink: #222426;
    --muted: #676c70;
    --line: #ded8cc;
    --surface: #ffffff;
    --surface-soft: #f5f3ee;
    --shadow: 0 12px 34px rgba(34, 36, 38, 0.12);
}

* {
    box-sizing: border-box;
}

html {
    color: var(--ink);
    background: var(--surface-soft);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
}

body {
    min-width: 320px;
    margin: 0;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

button {
    font: inherit;
}

a:focus-visible,
button:focus-visible {
    outline: 3px solid #e5a92d;
    outline-offset: 3px;
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 64px;
    padding: 10px max(20px, calc((100% - 1440px) / 2));
    border-bottom: 4px solid var(--accent);
    background: var(--ink);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ffffff;
    text-decoration: none;
}

.brand__mark {
    display: grid;
    width: 42px;
    height: 34px;
    place-items: center;
    border: 2px solid #ffffff;
    border-radius: 3px;
    font-size: 0.78rem;
    font-weight: 900;
}

.brand__text {
    font-size: 1rem;
    font-weight: 850;
}

.calendar-link {
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.64);
    border-radius: 3px;
    color: #ffffff;
    font-size: 0.86rem;
    font-weight: 800;
    text-decoration: none;
}

.calendar-link:hover {
    background: #ffffff;
    color: var(--ink);
}

main {
    width: min(100%, 1600px);
    margin: 0 auto;
    background: var(--surface);
}

.page-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    padding: 24px 28px 20px;
    border-bottom: 1px solid var(--line);
}

.page-heading__kicker,
.page-heading__venue,
.restaurant-panel__eyebrow {
    margin: 0;
}

.page-heading__kicker {
    color: var(--accent);
    font-size: 0.82rem;
    font-weight: 900;
}

h1 {
    margin: 4px 0 5px;
    font-size: 1.82rem;
    line-height: 1.32;
    letter-spacing: 0;
}

.page-heading__venue {
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 700;
}

.summary {
    display: flex;
    flex: 0 0 auto;
    gap: 8px;
}

.summary span {
    min-width: 108px;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--surface-soft);
    font-size: 0.82rem;
    font-weight: 800;
    text-align: center;
}

.summary strong {
    margin-right: 2px;
    color: var(--accent);
    font-size: 1.08rem;
}

.map-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(340px, 430px);
    min-height: 650px;
    height: calc(100vh - 220px);
    max-height: 920px;
    overflow: hidden;
}

.map-panel {
    position: relative;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    min-width: 0;
    min-height: 0;
    border-right: 1px solid var(--line);
    background: #e9e5dc;
}

.map-status {
    position: absolute;
    z-index: 700;
    top: 66px;
    left: 50%;
    width: min(520px, calc(100% - 32px));
    margin: 0;
    padding: 10px 14px;
    border: 1px solid rgba(181, 49, 58, 0.38);
    border-radius: 4px;
    color: var(--accent-dark);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: var(--shadow);
    font-size: 0.82rem;
    font-weight: 850;
    text-align: center;
    transform: translateX(-50%);
}

.map-status[hidden] {
    display: none;
}

.map-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 50px;
    padding: 8px 14px;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
}

.map-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
}

.map-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.map-legend i {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.map-legend__venue {
    background: var(--teal);
}

.map-legend__restaurant {
    background: var(--accent);
}

.map-legend__convenience {
    background: #135bb8;
}

.reset-map-button {
    flex: 0 0 auto;
    min-height: 34px;
    padding: 7px 11px;
    border: 1px solid var(--teal);
    border-radius: 3px;
    color: var(--teal-dark);
    background: #ffffff;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 850;
}

.reset-map-button:hover {
    color: #ffffff;
    background: var(--teal);
}

.restaurant-map {
    width: 100%;
    height: 100%;
    min-height: 500px;
    touch-action: none;
}

.restaurant-map .leaflet-control-zoom a {
    color: var(--ink);
}

.restaurant-map .leaflet-control-attribution {
    font-size: 0.62rem;
}

.venue-marker-wrap,
.restaurant-marker-wrap {
    border: 0;
    background: transparent;
}

.venue-marker {
    display: grid;
    width: 54px;
    height: 30px;
    place-items: center;
    border: 3px solid #ffffff;
    border-radius: 4px 4px 4px 0;
    color: #ffffff;
    background: var(--teal);
    box-shadow: 0 4px 14px rgba(34, 36, 38, 0.35);
    font-size: 0.72rem;
    font-weight: 900;
}

.restaurant-marker {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border: 3px solid #ffffff;
    border-radius: 50% 50% 50% 6px;
    color: #ffffff;
    background: var(--accent);
    box-shadow: 0 4px 14px rgba(34, 36, 38, 0.35);
    font-weight: 900;
    transform: rotate(-45deg);
}

.restaurant-marker__content {
    display: grid;
    grid-template-rows: 19px 11px;
    place-items: center;
    line-height: 1;
    transform: rotate(45deg);
}

.restaurant-marker__image {
    display: block;
    width: 18px;
    height: 18px;
    filter: brightness(0) invert(1);
}

.restaurant-marker b {
    font-size: 0.62rem;
    line-height: 1;
}

.restaurant-marker--convenience {
    background: #135bb8;
}

.restaurant-popup {
    display: grid;
    gap: 5px;
    min-width: 190px;
    padding: 2px;
}

.restaurant-popup strong,
.restaurant-popup span {
    display: block;
}

.restaurant-popup a {
    width: max-content;
    color: var(--accent-dark);
    font-weight: 800;
}

.restaurant-panel {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    min-width: 0;
    min-height: 0;
    background: var(--surface);
}

.restaurant-panel__header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 20px 12px;
}

.restaurant-panel__eyebrow {
    color: var(--accent);
    font-size: 0.68rem;
    font-weight: 900;
}

.restaurant-panel h2 {
    margin: 3px 0 0;
    font-size: 1.28rem;
    letter-spacing: 0;
}

.result-count {
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 800;
}

.category-filters {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    margin: 0 20px 12px;
    border: 1px solid var(--line);
    border-radius: 4px;
    overflow: hidden;
}

.category-filters button {
    min-width: 0;
    min-height: 36px;
    padding: 6px 3px;
    border: 0;
    border-right: 1px solid var(--line);
    color: var(--muted);
    background: var(--surface);
    cursor: pointer;
    font-size: 0.72rem;
    font-weight: 800;
}

.category-filters button:last-child {
    border-right: 0;
}

.category-filters button.is-active {
    color: #ffffff;
    background: var(--ink);
}

.restaurant-list {
    display: grid;
    align-content: start;
    gap: 9px;
    margin: 0;
    padding: 0 14px 18px 20px;
    min-height: 0;
    overflow-y: auto;
    list-style: none;
    scrollbar-gutter: stable;
}

.restaurant-card {
    display: grid;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--line);
    border-left: 4px solid transparent;
    border-radius: 6px;
    background: #ffffff;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.restaurant-card:hover,
.restaurant-card.is-selected {
    border-left-color: var(--accent);
    box-shadow: 0 5px 16px rgba(34, 36, 38, 0.09);
}

.restaurant-card__heading {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
}

.restaurant-card__number {
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border-radius: 50%;
    color: #ffffff;
    background: var(--accent);
    font-size: 0.75rem;
    font-weight: 900;
}

.restaurant-card.is-convenience .restaurant-card__number {
    background: #135bb8;
}

.restaurant-card.is-convenience:hover,
.restaurant-card.is-convenience.is-selected {
    border-left-color: #135bb8;
}

.restaurant-card h3 {
    min-width: 0;
    margin: 0;
    font-size: 0.94rem;
    line-height: 1.38;
    letter-spacing: 0;
}

.restaurant-card__category {
    padding: 4px 6px;
    border-radius: 3px;
    color: var(--teal-dark);
    background: #e4f3f0;
    font-size: 0.64rem;
    font-weight: 850;
    white-space: nowrap;
}

.restaurant-card__details {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 10px;
    margin: 0 0 0 36px;
    color: var(--muted);
    font-size: 0.76rem;
    line-height: 1.45;
}

.restaurant-card__details strong {
    color: var(--accent-dark);
}

.restaurant-card__actions {
    display: flex;
    gap: 7px;
    margin-left: 36px;
}

.restaurant-card__actions button,
.restaurant-card__actions a {
    min-height: 32px;
    padding: 6px 10px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.72rem;
    font-weight: 850;
    text-decoration: none;
}

.restaurant-card__actions button {
    border: 1px solid var(--teal);
    color: var(--teal-dark);
    background: #ffffff;
}

.restaurant-card__actions a {
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--accent);
    color: #ffffff;
    background: var(--accent);
}

.restaurant-card__actions button:hover {
    color: #ffffff;
    background: var(--teal);
}

.restaurant-card__actions a:hover {
    background: var(--accent-dark);
}

.page-footer {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 13px 28px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    background: var(--surface-soft);
    font-size: 0.72rem;
    line-height: 1.5;
}

.page-footer p {
    margin: 0;
}

.page-footer a {
    color: var(--teal-dark);
}

@media (max-width: 900px) {
    .page-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 14px;
        padding: 20px;
    }

    h1 {
        font-size: 1.5rem;
    }

    .map-layout {
        display: block;
        height: auto;
        max-height: none;
        overflow: visible;
    }

    .map-panel {
        height: 58vh;
        min-height: 470px;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .restaurant-map {
        min-height: 410px;
    }

    .restaurant-panel {
        display: block;
        min-height: auto;
    }

    .restaurant-list {
        max-height: none;
        padding-right: 20px;
        overflow: visible;
    }
}

@media (max-width: 560px) {
    .site-header {
        min-height: 58px;
        padding: 8px 14px;
    }

    .brand__text {
        display: none;
    }

    .calendar-link {
        font-size: 0.78rem;
    }

    .page-heading {
        padding: 17px 16px;
    }

    h1 {
        font-size: 1.28rem;
    }

    .summary {
        width: 100%;
    }

    .summary span {
        flex: 1 1 0;
        min-width: 0;
    }

    .map-panel {
        height: 62vh;
        min-height: 430px;
    }

    .map-toolbar {
        gap: 8px;
        padding: 7px 10px;
    }

    .map-legend {
        gap: 8px;
        font-size: 0.68rem;
    }

    .reset-map-button {
        padding: 6px 8px;
        font-size: 0.68rem;
    }

    .restaurant-map {
        min-height: 370px;
    }

    .restaurant-panel__header {
        padding: 18px 16px 11px;
    }

    .category-filters {
        margin-right: 16px;
        margin-left: 16px;
    }

    .restaurant-list {
        padding-right: 16px;
        padding-left: 16px;
    }

    .restaurant-card__heading {
        grid-template-columns: 28px minmax(0, 1fr);
    }

    .restaurant-card__category {
        grid-column: 2;
        width: max-content;
    }

    .page-footer {
        flex-direction: column;
        padding: 14px 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
