/**
 * Restaurant Theme — component overrides (standalone, no Tailwind build required).
 * Typography: H1 26-28px, Section 18px, Card 16px, Body 14-15px, Labels 13-14px, Price 18px, Total 22px.
 * Buttons: Primary 48px / 12px radius, Secondary 40px, Small 36px. Focus: 2px ring.
 * Shared by default + restaurant themes for parity.
 */

/* --- Pre-header utility strip (address, tel, icons): readable on light bg for default + restaurant --- */
.site-header__utility-item,
.site-header__utility-phone {
    color: var(--theme-text, #334155) !important;
}
.site-header__utility-icon {
    color: var(--theme-text, #64748b) !important;
    opacity: 0.9;
}
.site-header__mobile-address {
    color: var(--theme-text, #334155) !important;
}

/* --- Typography scale --- */
.restaurant-theme-h1 {
    font-size: clamp(1.625rem, 4vw, 1.75rem);
    font-weight: 600;
    line-height: 1.3;
}
.restaurant-theme-section-title {
    font-size: 1.125rem;
    font-weight: 500;
}
.restaurant-theme-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--theme-text, #2D2926);
}
.restervation-summary-sidebar .restaurant-theme-card-title {
    color: var(--theme-heading, #1a1a1a);
    font-size: 1.0625rem;
}
.restaurant-theme-body { font-size: 0.9375rem; line-height: 1.6; }
.restaurant-theme-label {
    font-size: 0.8125rem;
    color: var(--theme-text, #2D2926);
    font-weight: 500;
}
.reservation-summary-sidebar .restaurant-theme-label {
    color: var(--theme-text, #4A4540);
}
.restaurant-theme-price,
.restaurant-menu-price { font-size: 1.125rem; font-weight: 700; color: #dc2626 !important; }
.restaurant-theme-total { font-size: 1.375rem; font-weight: 700; color: #dc2626 !important; }

/* --- Buttons: 48px primary, 12px radius, focus ring --- */
/* btn-lg: larger touch targets for reservation flow (user requirement) */
.btn-lg {
    min-height: 52px;
    padding: 14px 24px;
    font-size: 1rem;
}

.restaurant-btn-primary {
    min-height: 48px;
    padding: 12px 20px;
    font-size: 0.9375rem;
    font-weight: 600;
    border-radius: 12px;
    transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}
.restaurant-btn-primary.btn-lg {
    min-height: 52px;
    padding: 14px 24px;
    font-size: 1rem;
}
.restaurant-btn-primary:hover:not(:disabled) {
    background-color: var(--theme-button-primary-hover, #4A2323) !important;
    box-shadow: 0 4px 12px rgba(92, 45, 45, 0.2);
}
.restaurant-btn-primary:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px var(--theme-input-focus-shadow, rgba(92, 45, 45, 0.2));
}
.restaurant-btn-primary:active:not(:disabled) {
    transform: scale(0.98);
}
.restaurant-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.restaurant-btn-secondary {
    min-height: 40px;
    padding: 8px 16px;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 12px;
}

.restaurant-btn-small {
    min-height: 36px;
    padding: 6px 14px;
    font-size: 0.8125rem;
    border-radius: 10px;
}

/* --- Inputs: 44px height, focus ring --- */
.restaurant-input,
.restaurant-theme input[type="text"],
.restaurant-theme input[type="email"],
.restaurant-theme input[type="tel"],
.restaurant-theme select,
.restaurant-theme textarea {
    min-height: 44px;
    border-radius: 10px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.restaurant-theme input:focus,
.restaurant-theme select:focus,
.restaurant-theme textarea:focus {
    outline: none;
    border-color: var(--theme-primary, #5C2D2D) !important;
    box-shadow: 0 0 0 2px rgba(92, 45, 45, 0.15);
}

/* --- Summary panel: 24px padding, 16px row gap, total row tinted --- */
.reservation-summary-sidebar .reservation-summary-content {
    padding: 24px;
}
.reservation-summary-sidebar .res-summary-row {
    padding-top: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--theme-border, #E5E0DB);
}
.reservation-summary-sidebar .res-summary-row:last-child {
    border-bottom: none;
}
.reservation-summary-sidebar .res-summary-row:nth-last-child(2) {
    border-bottom: none !important;
}
.reservation-summary-total-row {
    background-color: rgba(92, 45, 45, 0.05) !important;
    border: 1px solid var(--theme-border, #E5E0DB);
    border-radius: 12px;
    padding: 20px !important;
}

/* ============================================
   RESERVATION FLOW STEP INDICATOR
   Premium restaurant-style: 日時・人数 → メニュー選択 → 確認
   Enterprise-level clarity, Japanese reservation site standard.
   ============================================ */
.reservation-flow-steps {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    padding: 0 0.5rem;
}
.reservation-flow-steps::before {
    content: '';
    position: absolute;
    top: 1.125rem;
    left: 2.5rem;
    right: 2.5rem;
    height: 2px;
    background: var(--theme-border, #E5E0DB);
    z-index: 0;
}
.reservation-flow-steps .reservation-flow-progress-wrap {
    position: absolute;
    top: 1.125rem;
    left: 2.5rem;
    right: 2.5rem;
    height: 2px;
    overflow: hidden;
    z-index: 1;
}
.reservation-flow-steps .reservation-flow-progress {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, var(--theme-primary, #5C2D2D), var(--theme-accent-gold, #C4A882));
    transform-origin: left;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.reservation-flow-step {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 0 0 auto;
    min-width: 5rem;
}
.reservation-flow-step__circle {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8125rem;
    font-weight: 700;
    font-family: var(--theme-font-secondary, 'Noto Sans JP'), sans-serif;
    letter-spacing: 0.02em;
    transition: all 0.3s ease;
    margin-bottom: 0.5rem;
}
.reservation-flow-step.active .reservation-flow-step__circle {
    background: var(--theme-primary, #5C2D2D);
    color: #fff;
    box-shadow: 0 2px 8px rgba(92, 45, 45, 0.25);
}
.reservation-flow-step.completed .reservation-flow-step__circle {
    background: var(--theme-primary, #5C2D2D);
    color: #fff;
}
.reservation-flow-step.completed .reservation-flow-step__circle i {
    font-size: 0.625rem;
}
@media (min-width: 640px) {
    .reservation-flow-step.completed .reservation-flow-step__circle i {
        font-size: 0.6875rem;
    }
}
.reservation-flow-step.pending .reservation-flow-step__circle {
    background: var(--theme-card-background, #FFFFFF);
    color: var(--theme-muted, #6b7280);
    border: 2px solid var(--theme-border, #E5E0DB);
}
.reservation-flow-step__label {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-align: center;
    line-height: 1.3;
    max-width: 6.5rem;
}
.reservation-flow-step.active .reservation-flow-step__label {
    color: var(--theme-text, #2D2926);
}
.reservation-flow-step.completed .reservation-flow-step__label,
.reservation-flow-step.pending .reservation-flow-step__label {
    color: var(--theme-muted, #6b7280);
}
@media (min-width: 640px) {
    .reservation-flow-steps {
        max-width: 480px;
    }
    .reservation-flow-step__circle {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 0.875rem;
    }
    .reservation-flow-step__label {
        font-size: 0.75rem;
        max-width: 5.5rem;
    }
}


.restaurant-menu-list .relative,
.restaurant-menu-list .restaurant-menu-card {
    border-radius: 12px;
    border: 1px solid var(--theme-border, #E5E0DB);
    background: var(--theme-card-background, #FFFFFF);
    box-shadow: 0 1px 3px rgba(45, 41, 38, 0.04);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.restaurant-menu-list .relative:hover,
.restaurant-menu-list .restaurant-menu-card:hover {
    border-color: var(--theme-border-hover, #C4BEB6);
    box-shadow: 0 4px 12px rgba(45, 41, 38, 0.06);
}
/* Selected card: green border + subtle tint for clear selected indication */
.restaurant-menu-list .restaurant-menu-card:has(.order-menus.selected),
.restaurant-menu-list .relative:has(.order-menus.selected) {
    border-color: var(--theme-success, #16a34a) !important;
    border-width: 2px;
    background-color: rgba(var(--theme-success-rgb, 22, 163, 74), 0.08) !important;
    box-shadow: 0 0 0 1px var(--theme-success, #16a34a);
}
/* Selected button: green for clear selected indication */
.restaurant-menu-list .order-menus.selected {
    border-color: var(--theme-success, #16a34a) !important;
    background-color: var(--theme-success, #16a34a) !important;
    color: #fff !important;
}

.reservation-summary-sidebar {
    border-radius: 12px;
    border: 1px solid var(--theme-border, #E5E0DB);
    background: var(--theme-card-background, #FFFFFF);
}

/* --- Inquiry card (special-request CTA) — palette-driven, no gradients --- */
.inquiry-card {
    border-radius: 12px;
    border: 1px solid var(--theme-border, #E5E0DB);
    background: var(--theme-card-background, #FFFFFF);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.inquiry-card:hover {
    border-color: var(--theme-border-hover, var(--theme-primary, #C4BEB6));
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}
.inquiry-card__badge {
    background: color-mix(in srgb, var(--theme-primary, #5C2D2D) 10%, transparent);
    color: var(--theme-primary, #5C2D2D);
    border: 1px solid color-mix(in srgb, var(--theme-primary, #5C2D2D) 20%, transparent);
}
.inquiry-card__media {
    background: var(--theme-background, #F7F5F3);
    border: 1px solid var(--theme-border, #E5E0DB);
}
.inquiry-card__title {
    color: var(--theme-heading, var(--theme-text, #2D2926));
}
.inquiry-card__desc {
    color: var(--theme-text-muted, #6b7280);
}
.inquiry-card__list span {
    color: var(--theme-text, #374151);
}
.inquiry-card__bullet {
    color: var(--theme-success, #16a34a);
}
.inquiry-card__action {
    border-top: 1px solid var(--theme-border, #E5E0DB);
}

/* Sticky sidebar offset — clears site-header (~108px).
   !important needed: Tailwind Play CDN injects .lg\:top-9 { top: 2.25rem }
   at runtime, often after stylesheet links → same specificity wins by source order. */
@media (min-width: 1024px) {
    .reservation-booking-card.lg\:top-9,
    .lg\:sticky.lg\:top-9 {
        top: 8rem !important;
    }
}


.sticky-action-area .sticky-wrapper { position: relative; }
@media (max-width: 639px) {
    .sticky-action-area {
        position: sticky;
        bottom: 0;
        z-index: 30;
        padding-bottom: env(safe-area-inset-bottom, 0);
    }
}

#timePickerModal .bg-white,
#guestPickerModal .bg-white { border-radius: 12px; }

#timeSlotsGrid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    max-height: 52vh;
    overflow-y: auto;
    scrollbar-gutter: stable;
}
@media (min-width: 470px) {
    #timeSlotsGrid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
    }
}
@media (min-width: 640px) {
    #timeSlotsGrid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
}
#timeSlotsGrid .time-slot-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-width: 0;
    border-radius: 8px;
    border: 1px solid var(--theme-border, #E5E0DB);
    padding: 8px 4px;
    min-height: 38px;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
    font-feature-settings: 'tnum' 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
@media (min-width: 480px) {
    #timeSlotsGrid .time-slot-btn { font-size: 12px; min-height: 40px; padding: 8px 6px; }
}
@media (min-width: 640px) {
    #timeSlotsGrid .time-slot-btn { font-size: 13px; min-height: 44px; padding: 10px 8px; }
}
#timeSlotsGrid .time-slot-btn:hover:not(.disabled) {
    border-color: var(--theme-primary, #5C2D2D);
    background-color: rgba(92, 45, 45, 0.04);
}
#timeSlotsGrid .time-slot-btn.selected {
    background-color: var(--theme-button-primary, var(--theme-primary));
    border-color: var(--theme-button-primary, var(--theme-primary));
    color: var(--theme-button-text, #fff);
}
#timeSlotsGrid .time-slot-btn.selected:hover:not(.disabled) {
    background-color: var(--theme-button-primary-hover, var(--theme-primary-hover));
    border-color: var(--theme-button-primary-hover, var(--theme-primary-hover));
    color: var(--theme-button-primary-text-hover, var(--theme-button-text, #fff));
}
#timeSlotsGrid .time-slot-btn.selected:active:not(.disabled) {
    background-color: var(--theme-button-primary-active, var(--theme-button-primary-hover));
    border-color: var(--theme-button-primary-active, var(--theme-button-primary-hover));
}
#timeSlotsGrid .time-slot-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px var(--theme-input-focus-shadow, rgba(92, 45, 45, 0.3));
}

#guestNumberGrid .guest-btn,
#guestNumberGrid .guest-number-btn {
    border-radius: 8px;
    border: 1px solid var(--theme-border, #E5E0DB);
    padding: 8px;
    font-size: 0.875rem;
    transition: all 0.15s ease;
}
#guestNumberGrid .guest-btn:hover,
#guestNumberGrid .guest-number-btn:hover { border-color: var(--theme-primary, #5C2D2D); }
#guestNumberGrid .guest-btn.selected,
#guestNumberGrid .guest-number-btn.selected,
#guestNumberGrid .guest-number-btn-selected {
    background-color: var(--theme-button-primary, var(--theme-primary));
    border-color: var(--theme-button-primary, var(--theme-primary));
    color: var(--theme-button-text, #fff);
}
#guestNumberGrid .guest-btn.selected:hover,
#guestNumberGrid .guest-number-btn.selected:hover,
#guestNumberGrid .guest-number-btn-selected:hover {
    background-color: var(--theme-button-primary-hover, var(--theme-primary-hover));
    border-color: var(--theme-button-primary-hover, var(--theme-primary-hover));
    color: var(--theme-button-primary-text-hover, var(--theme-button-text, #fff));
}
#guestNumberGrid .guest-btn.selected:active,
#guestNumberGrid .guest-number-btn.selected:active,
#guestNumberGrid .guest-number-btn-selected:active {
    background-color: var(--theme-button-primary-active, var(--theme-button-primary-hover));
    border-color: var(--theme-button-primary-active, var(--theme-button-primary-hover));
}

.datepicker {
    border-radius: 12px !important;
    border: 1px solid var(--theme-border, #E5E0DB) !important;
    box-shadow: 0 8px 24px rgba(45, 41, 38, 0.08) !important;
    font-family: var(--theme-font-secondary, 'Noto Sans JP'), sans-serif !important;
}
.datepicker table tr td.active,
.datepicker table tr td.active:hover,
.datepicker table tr td.active.highlighted {
    background-color: var(--theme-primary, #5C2D2D) !important;
    color: #fff !important;
}
.datepicker table tr td.today {
    background-color: rgba(92, 45, 45, 0.08) !important;
    color: var(--theme-primary, #5C2D2D) !important;
}
.datepicker table tr td:hover {
    background-color: var(--theme-background, #F7F5F3) !important;
}

#floatingSummaryBar,
#floatingActionBar {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.theme-alert-info {
    background: rgba(59, 111, 160, 0.05);
    border-left: 2px solid var(--theme-info, #3B6FA0);
}
.theme-alert-warning {
    background: rgba(192, 139, 48, 0.05);
    border-left: 2px solid var(--theme-warning, #C08B30);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
textarea,
select {
    font-family: var(--theme-font-secondary, 'Noto Sans JP'), sans-serif;
}

@keyframes pulse-subtle {
    0%, 100% { box-shadow: 0 0 0 0 rgba(92, 45, 45, 0.3); }
    50% { box-shadow: 0 0 0 6px rgba(92, 45, 45, 0); }
}
.animate-pulse-subtle {
    animation: pulse-subtle 2.5s ease-in-out infinite;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ============================================
   SHOP HEADER TEXT (dynamic from JSON)
   Long text handling + responsive for restaurant theme overlay
   ============================================ */
.reservation-hero-block .shop-header-text {
    min-width: 0;
    max-width: min(28rem, calc(100% - 2rem));
    overflow: visible;
}
.reservation-hero-block .shop-header-overlay-title,
.reservation-hero-block .shop-header-overlay-subtitle {
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
}
.reservation-hero-block .shop-header-overlay-title {
    max-width: 100%;
}
.reservation-hero-block .shop-header-overlay-subtitle {
    max-width: 100%;
}
@media (max-width: 479px) {
    .reservation-hero-block .shop-header-text {
        max-width: calc(100% - 1.5rem);
        padding: 0.75rem 1rem;
    }
    .reservation-hero-block .shop-header-overlay-title {
        font-size: clamp(0.875rem, 4vw, 1.0625rem);
    }
    .reservation-hero-block .shop-header-overlay-subtitle {
        font-size: clamp(0.6875rem, 2.5vw, 0.8125rem);
    }
}
@media (min-width: 480px) and (max-width: 639px) {
    .reservation-hero-block .shop-header-text {
        max-width: min(22rem, calc(100% - 1.5rem));
    }
}
@media (min-width: 1024px) {
    .reservation-hero-block .shop-header-text {
        max-width: min(30rem, calc(100% - 3rem));
    }
}

/* Fitts' Law: 44px min touch targets on mobile */
@media (max-width: 639px) {
    .reservation-content-outer button,
    .reservation-content-outer .theme-btn-primary,
    .reservation-content-outer a.btn,
    .reservation-form button[type="submit"],
    .reservation-form button[type="button"],
    #timeSlotsGrid .time-slot-btn,
    .guest-number-btn {
        min-height: 44px !important;
    }
}

/* QA: Desktop — 60/40 layout, step indicator primary, summary labels left/values right, total row tinted, CTA 48px.
 * QA: Tablet — 2-col or stacked, sticky CTA visible, no overflow.
 * QA: Mobile — stacked cards, sticky bar aligned container width, touch targets ≥44px, focus visible. */

/* Theme footer links — CSS hover (replaces inline onmouseover/onmouseout) */
.theme-footer-link {
    font-size: 0.875rem;
    color: var(--theme-footer-link, #C4A882);
    opacity: 0.8;
    transition: opacity 0.2s ease, color 0.2s ease;
}
.theme-footer-link:hover {
    opacity: 1;
    color: var(--theme-footer-link-hover, #FFFFFF);
}
.theme-footer-link:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px var(--theme-accent-gold, #C4A882);
}

/* ==============================================
   REFINEMENT PASS v2.1 — Typography, a11y, states, spacing
   Restrained, enterprise-grade: no gradients, no glassmorphism,
   minimal shadows, 1px borders, subtle hover tints only.
   Additive — does not override existing component rules.
   ============================================== */

/* --- Spacing rhythm tokens --- */
:root {
    --rt-space-section-y: 3rem;
    --rt-space-block-y: 1.5rem;
    --rt-space-stack: 0.75rem;
    --rt-radius-sm: 6px;
    --rt-radius-md: 8px;
    --rt-radius-lg: 12px;
    --rt-focus-ring: 0 0 0 2px var(--theme-background, #ffffff),
                     0 0 0 4px var(--theme-primary, #374151);
    --rt-focus-ring-error: 0 0 0 2px var(--theme-background, #ffffff),
                           0 0 0 4px var(--theme-error, #dc2626);
}
@media (min-width: 768px) {
    :root { --rt-space-section-y: 4rem; }
}

/* --- Typography hierarchy: default scale for h1-h6 across all pages --- */
/* Scoped to main content so admin-injected widgets are untouched. */
main h1, main h2, main h3, main h4, main h5, main h6 {
    color: var(--theme-text, #111827);
    letter-spacing: -0.01em;
    font-feature-settings: 'palt' 1;
}
main h1 { font-size: clamp(1.625rem, 3vw, 2rem); line-height: 1.25; font-weight: 600; }
main h2 { font-size: clamp(1.375rem, 2.4vw, 1.625rem); line-height: 1.3; font-weight: 600; }
main h3 { font-size: 1.25rem; line-height: 1.35; font-weight: 600; }
main h4 { font-size: 1.0625rem; line-height: 1.4; font-weight: 600; }
main h5 { font-size: 0.9375rem; line-height: 1.45; font-weight: 600; letter-spacing: 0; }
main h6 {
    font-size: 0.8125rem; line-height: 1.45; font-weight: 600;
    letter-spacing: 0.04em; text-transform: uppercase;
    color: var(--theme-secondary, #4b5563);
}
main p { line-height: 1.7; }
main small, main .text-xs { line-height: 1.5; }

/* --- Form labels: readable 13/14px instead of 12px text-xs --- */
main label,
.reservation-form label,
.reservation-content-outer label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--theme-text, #111827);
    line-height: 1.5;
    letter-spacing: 0;
}
@media (min-width: 640px) {
    main label,
    .reservation-form label,
    .reservation-content-outer label {
        font-size: 0.875rem;
    }
}

/* --- Numerals: tabular for prices/totals/counts/dates --- */
.tabular-nums,
.res-price,
.restaurant-menu-price,
.restaurant-theme-price,
.restaurant-theme-total,
#floatingTotal,
.floating-total-amount,
[class*="price"],
[class*="total"],
[class*="amount"] {
    font-variant-numeric: tabular-nums;
    font-feature-settings: 'tnum' 1;
}

/* --- Body Japanese proportional kerning + legibility --- */
body {
    font-feature-settings: 'palt' 1;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Strong inline emphasis: weight only, inherit color --- */
main strong,
main b {
    font-weight: 600;
    color: inherit;
}

/* --- Caption / micro text uniform leading --- */
main .text-xs,
main .text-\[10px\],
main .text-\[11px\],
main .text-\[12px\] {
    line-height: 1.5;
}

/* --- Link baseline (inline prose only; excludes lists/nav/breadcrumbs/buttons) --- */
main :where(p, dd, dt, blockquote, figcaption) >
    a:not(.btn):not([class*="btn-"]):not(.no-underline):not(.theme-footer-link):not([role="button"]):not([class*="inline-flex"]):not([class*="bg-"]):not([class*="rounded-"]) {
    color: var(--theme-link, var(--theme-primary, #374151));
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
    transition: color 0.15s ease;
}
main :where(p, dd, dt, blockquote, figcaption) >
    a:not(.btn):not([class*="btn-"]):not(.no-underline):not(.theme-footer-link):not([role="button"]):not([class*="inline-flex"]):not([class*="bg-"]):not([class*="rounded-"]):hover {
    color: var(--theme-link-hover, var(--theme-primary-hover, #1f2937));
    text-decoration-thickness: 2px;
}

/* --- Breadcrumb safeguard: always white on hero, regardless of cascade --- */
.page-hero .page-hero__breadcrumb a,
.page-hero__breadcrumb a,
nav[aria-label*="breadcrumb" i] a,
nav[aria-label*="パンくず"] a {
    color: var(--theme-text-on-primary, #ffffff) !important;
    text-decoration: none !important;
}
.page-hero .page-hero__breadcrumb a:hover,
.page-hero__breadcrumb a:hover,
nav[aria-label*="breadcrumb" i] a:hover,
nav[aria-label*="パンくず"] a:hover {
    color: var(--theme-text-on-primary, #ffffff) !important;
    text-decoration: underline !important;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}
.page-hero__breadcrumb [aria-current="page"] {
    color: var(--theme-text-on-primary, #ffffff) !important;
    opacity: 1 !important;
}

/* --- Global focus-visible ring (WCAG 2.1 AA: 3:1 against background) --- */
a:focus-visible,
button:focus-visible,
[role="button"]:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--theme-primary, #374151);
    outline-offset: 2px;
    border-radius: var(--rt-radius-sm);
}
/* Inputs already have border — use shadow ring instead of outline to avoid layout shift */
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--theme-input-focus-shadow, rgba(55, 65, 81, 0.18));
    border-color: var(--theme-input-focus-border, var(--theme-primary, #374151));
}

/* --- Skip-to-content (keyboard a11y) --- */
.rt-skip-link {
    position: absolute;
    top: -100px;
    left: 1rem;
    z-index: 100;
    padding: 0.625rem 1rem;
    background: var(--theme-primary, #374151);
    color: #fff;
    text-decoration: none;
    border-radius: var(--rt-radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    transition: top 0.15s ease;
}
.rt-skip-link:focus {
    top: 1rem;
}

/* --- Form: required indicator + invalid + helper text --- */
.rt-form-label,
label.required::after,
label[data-required]::after {
    /* Labels can opt-in to required marker via [data-required] */
}
label[data-required]::after,
.rt-label-required::after {
    content: " *";
    color: var(--theme-error, #dc2626);
    font-weight: 600;
    margin-left: 2px;
}
.rt-form-help {
    display: block;
    margin-top: 0.375rem;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: var(--theme-secondary, #6b7280);
}
.rt-form-error {
    display: block;
    margin-top: 0.375rem;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: var(--theme-error, #dc2626);
}
input.is-invalid,
select.is-invalid,
textarea.is-invalid,
input[aria-invalid="true"],
select[aria-invalid="true"],
textarea[aria-invalid="true"] {
    border-color: var(--theme-error, #dc2626) !important;
}
input.is-invalid:focus-visible,
select.is-invalid:focus-visible,
textarea.is-invalid:focus-visible,
input[aria-invalid="true"]:focus-visible,
select[aria-invalid="true"]:focus-visible,
textarea[aria-invalid="true"]:focus-visible {
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.18);
    border-color: var(--theme-error, #dc2626) !important;
}

/* --- Disabled state — consistent across inputs + buttons --- */
input:disabled,
select:disabled,
textarea:disabled,
button:disabled,
button[aria-disabled="true"],
.btn:disabled,
[class*="btn-"]:disabled {
    background-color: var(--theme-input-disabled-background, #f3f4f6);
    color: var(--theme-text-disabled, #9ca3af);
    cursor: not-allowed;
    opacity: 1;
}
button:disabled,
button[aria-disabled="true"],
.btn:disabled,
[class*="btn-"]:disabled {
    border-color: var(--theme-border, #e5e7eb);
    box-shadow: none;
    transform: none;
}

/* --- Empty state (lists, tables, content panels) --- */
.rt-empty-state {
    padding: 2rem 1.5rem;
    text-align: center;
    color: var(--theme-secondary, #6b7280);
    background: var(--theme-card-background, #ffffff);
    border: 1px solid var(--theme-border, #e5e7eb);
    border-radius: var(--rt-radius-lg);
}
.rt-empty-state__icon {
    color: var(--theme-text-disabled, #9ca3af);
    font-size: 2rem;
    margin-bottom: 0.75rem;
    line-height: 1;
}
.rt-empty-state__title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--theme-text, #111827);
    margin-bottom: 0.25rem;
}
.rt-empty-state__body {
    font-size: 0.875rem;
    line-height: 1.6;
    max-width: 32rem;
    margin: 0 auto;
}

/* --- Error banner (inline page-level error) --- */
.rt-error-banner {
    padding: 0.875rem 1rem;
    background: var(--theme-badge-error-bg, #fef2f2);
    border: 1px solid rgba(220, 38, 38, 0.25);
    border-left: 3px solid var(--theme-error, #dc2626);
    border-radius: var(--rt-radius-md);
    color: var(--theme-badge-error-text, #991b1b);
    font-size: 0.875rem;
    line-height: 1.5;
}
.rt-error-banner strong { font-weight: 600; }

/* --- Loading skeleton (flat, no shimmer in reduced-motion) --- */
.rt-skeleton {
    display: block;
    background: var(--theme-input-disabled-background, #f3f4f6);
    border-radius: var(--rt-radius-sm);
    position: relative;
    overflow: hidden;
}
.rt-skeleton::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent);
    transform: translateX(-100%);
    animation: rt-skeleton-shimmer 1.4s ease-in-out infinite;
}
.rt-skeleton--text { height: 0.875rem; margin: 0.375rem 0; }
.rt-skeleton--title { height: 1.25rem; margin: 0.5rem 0; }
.rt-skeleton--block { height: 6rem; }
@keyframes rt-skeleton-shimmer { to { transform: translateX(100%); } }

/* --- Refinement button primitives (explicit hover color lock) --- */
.rt-btn,
.rt-btn-primary,
.rt-btn-secondary,
.rt-btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    min-height: 40px;
    border-radius: var(--rt-radius-md);
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none !important;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.rt-btn-primary,
.rt-btn-primary:link,
.rt-btn-primary:visited {
    background-color: var(--theme-button-primary, var(--theme-primary, #374151));
    color: var(--theme-button-text, #ffffff) !important;
    border-color: var(--theme-button-primary, var(--theme-primary, #374151));
}
.rt-btn-primary:hover,
.rt-btn-primary:focus {
    background-color: var(--theme-button-primary-hover, var(--theme-primary-hover, #1f2937));
    border-color: var(--theme-button-primary-hover, var(--theme-primary-hover, #1f2937));
    color: var(--theme-button-primary-text-hover, var(--theme-button-text, #ffffff)) !important;
}
.rt-btn-primary:active {
    background-color: var(--theme-button-primary-active, #111827);
    border-color: var(--theme-button-primary-active, #111827);
}
.rt-btn-secondary,
.rt-btn-secondary:link,
.rt-btn-secondary:visited {
    background-color: transparent;
    color: var(--theme-primary, #374151) !important;
    border-color: var(--theme-border, #e5e7eb);
}
.rt-btn-secondary:hover,
.rt-btn-secondary:focus {
    background-color: var(--theme-card-hover-background, #f9fafb);
    border-color: var(--theme-border-hover, #d1d5db);
    color: var(--theme-primary, #374151) !important;
}
.rt-btn-ghost,
.rt-btn-ghost:link,
.rt-btn-ghost:visited {
    background-color: transparent;
    color: var(--theme-primary, #374151) !important;
    border-color: transparent;
    padding-inline: 0.5rem;
}
.rt-btn-ghost:hover,
.rt-btn-ghost:focus {
    color: var(--theme-primary-hover, #1f2937) !important;
    background-color: var(--theme-badge-info-bg, #f3f4f6);
}
.rt-btn-sm { min-height: 32px; padding: 0.375rem 0.875rem; font-size: 0.8125rem; }
.rt-btn-lg { min-height: 48px; padding: 0.75rem 1.5rem; font-size: 0.9375rem; }

/* --- Section rhythm utility --- */
.rt-section { padding-top: var(--rt-space-section-y); padding-bottom: var(--rt-space-section-y); }
.rt-section-tight { padding-top: var(--rt-space-block-y); padding-bottom: var(--rt-space-block-y); }
.rt-stack > * + * { margin-top: var(--rt-space-stack); }

/* --- Reduced-motion: kill non-essential animation --- */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
    .animate-pulse-subtle,
    .rt-skeleton::after {
        animation: none !important;
    }
    .reservation-flow-steps .reservation-flow-progress {
        transition: none !important;
    }
}

/* --- High-contrast windows mode preservation --- */
@media (forced-colors: active) {
    .btn,
    [class*="btn-"],
    .time-slot-btn,
    .guest-btn,
    .guest-number-btn {
        border: 1px solid ButtonText;
    }
    a:focus-visible,
    button:focus-visible {
        outline: 2px solid Highlight;
    }
}

/* --- Modal responsive utility: shared sizing across views --- */
.rt-modal,
[role="dialog"][aria-modal="true"] > .rt-modal-panel {
    width: 100%;
    max-width: 24rem;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 1rem;
    padding: 1.25rem;
    background-color: var(--theme-card-background, #ffffff);
    border: 1px solid var(--theme-border, #e5e7eb);
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.05);
}
@media (min-width: 640px) {
    .rt-modal,
    [role="dialog"][aria-modal="true"] > .rt-modal-panel {
        max-width: 28rem;
        border-radius: 1.25rem;
        padding: 1.75rem;
    }
}
/* Scroll-lock when modal open — opt-in via body.modal-open class
   toggled by app.blade.php JS. Avoids :has() false-positives where
   modals hide via inline style instead of .hidden class. */
body.modal-open {
    overflow: hidden;
}

/* --- Modal backdrop: clickable via data-dismiss-modal --- */
[role="dialog"][aria-modal="true"] [data-dismiss-modal][aria-hidden="true"] {
    cursor: pointer;
}
