:root {
    --bg: #f4faff;
    --surface: #ffffff;
    --surface-soft: #eef8ff;
    --primary: #78bdea;
    --primary-dark: #3f8fc5;
    --primary-deep: #226fa5;
    --border: #b9ddf5;
    --border-soft: #dceef9;
    --text: #263746;
    --muted: #657a8b;
    --success: #2f9d67;
    --success-soft: #e9f8f0;
    --danger: #c84a4a;
    --danger-soft: #fff0f0;
    --warning: #a76b19;
    --shadow: 0 18px 50px rgba(63, 143, 197, 0.12);
    --radius-lg: 22px;
    --radius-md: 14px;
    --radius-sm: 9px;
}

* {
    box-sizing: border-box;
}

html {
    color: var(--text);
    background: var(--bg);
    font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN",
        "Yu Gothic", "Meiryo", sans-serif;
    line-height: 1.6;
    -webkit-text-size-adjust: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(circle at 10% 0, rgba(120, 189, 234, 0.16), transparent 28rem),
        linear-gradient(180deg, #f8fcff 0, var(--bg) 28rem);
}

a {
    color: var(--primary-deep);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

button,
input,
select {
    font: inherit;
}

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

:focus-visible {
    outline: 3px solid rgba(63, 143, 197, 0.35);
    outline-offset: 3px;
}

.site-header {
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid var(--border-soft);
    backdrop-filter: blur(12px);
}

.site-header-inner {
    width: min(1120px, calc(100% - 40px));
    min-height: 84px;
    margin: 0 auto;
    display: flex;
    align-items: center;
}

.brand {
    display: inline-flex;
    align-items: center;
    color: var(--text);
    text-decoration: none;
}

.brand strong,
.brand small {
    display: block;
}

.brand strong {
    font-size: 1rem;
}

.brand small {
    margin-top: 1px;
    color: var(--muted);
    font-size: 0.75rem;
}

.steps {
    padding: 22px 20px 18px;
    background: #fff;
    border-bottom: 1px solid var(--border-soft);
}

.steps ol {
    width: min(880px, 100%);
    margin: 0 auto;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    list-style: none;
}

.steps li {
    position: relative;
    display: grid;
    justify-items: center;
    align-content: start;
    gap: 8px;
    color: #99a8b4;
    font-size: 0.82rem;
    font-weight: 700;
    text-align: center;
}

.steps li:not(:last-child)::after {
    content: "";
    position: absolute;
    z-index: 0;
    top: 17px;
    left: calc(50% + 24px);
    width: calc(100% - 48px);
    height: 2px;
    background: #dfeaf1;
}

.step-number {
    position: relative;
    z-index: 1;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    display: grid;
    place-items: center;
    background: #f0f5f8;
    border: 2px solid #dfeaf1;
    border-radius: 50%;
}

.step-label {
    position: relative;
    z-index: 1;
    line-height: 1.3;
    white-space: nowrap;
}

.steps .is-current,
.steps .is-complete {
    color: var(--primary-deep);
}

.steps .is-current .step-number {
    color: #fff;
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    box-shadow: 0 0 0 5px rgba(120, 189, 234, 0.18);
}

.steps .is-complete .step-number {
    color: var(--primary-deep);
    background: var(--surface-soft);
    border-color: var(--primary);
}

.steps .is-complete:not(:last-child)::after {
    background: var(--primary);
}

.page-shell {
    width: min(1120px, calc(100% - 40px));
    min-height: calc(100vh - 260px);
    margin: 0 auto;
    padding: 46px 0 72px;
}

.hero-panel {
    margin-bottom: 26px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 28px;
}

.hero-panel.compact {
    align-items: center;
}

.hero-panel h1 {
    margin: 3px 0 8px;
    font-size: clamp(1.7rem, 4vw, 2.35rem);
    line-height: 1.3;
    letter-spacing: -0.025em;
}

.hero-panel p {
    margin: 0;
    color: var(--muted);
}

.section-kicker {
    margin: 0;
    color: var(--primary-dark) !important;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.12em;
}

.booking-window,
.selection-summary {
    min-width: 245px;
    padding: 16px 18px;
    color: var(--primary-deep);
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.booking-window span,
.booking-window strong,
.selection-summary span,
.selection-summary strong {
    display: block;
}

.booking-window span,
.selection-summary span {
    font-size: 0.74rem;
    font-weight: 700;
}

.booking-window strong {
    margin-top: 3px;
    font-size: 1.2rem;
}

.selection-summary strong {
    margin: 4px 0 7px;
    color: var(--text);
    font-size: 0.92rem;
}

.selection-summary a {
    font-size: 0.78rem;
}

.legend-symbol {
    margin: 0 3px;
    font-weight: 800;
}

.available {
    color: var(--success);
}

.unavailable {
    color: #97a5af;
}

.calendar-card,
.content-card,
.summary-card,
.completion-card {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.calendar-card {
    overflow: hidden;
}

.booking-contact-notice {
    margin-bottom: 20px;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    background: #fff7e8;
    border: 1px solid #efd7a5;
    border-radius: 16px;
}

.booking-contact-notice p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 0.82rem;
}

.booking-contact-notice .button {
    min-width: 220px;
    display: grid;
    gap: 2px;
    text-align: center;
}

.booking-contact-notice .button span {
    font-size: 0.7rem;
}

.booking-contact-notice .button strong {
    font-size: 1rem;
}

.contact-not-configured {
    color: var(--muted);
    font-size: 0.78rem;
}

.calendar-toolbar {
    padding: 24px 26px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    border-bottom: 1px solid var(--border-soft);
}

.calendar-toolbar h2 {
    margin: 2px 0 0;
    font-size: 1.25rem;
}

.week-actions,
.form-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.button {
    min-height: 48px;
    padding: 0 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 750;
    text-decoration: none;
    transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.button:hover {
    transform: translateY(-1px);
}

.button-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--primary-dark), #5cace0);
    border-color: var(--primary-dark);
    box-shadow: 0 9px 22px rgba(63, 143, 197, 0.22);
}

.button-secondary {
    color: var(--primary-deep);
    background: #fff;
    border-color: var(--border);
}

.button-small {
    min-height: 40px;
    padding: 0 14px;
    font-size: 0.8rem;
}

.button-full {
    width: 100%;
}

.button-emphasis {
    min-width: 220px;
}

.button.is-disabled {
    color: #a8b3ba;
    background: #f5f7f8;
    border-color: #e4e9ec;
    cursor: not-allowed;
    transform: none;
}

.availability-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
}

.availability-table th,
.availability-table td {
    height: 59px;
    padding: 6px;
    text-align: center;
    border-right: 1px solid var(--border-soft);
    border-bottom: 1px solid var(--border-soft);
}

.availability-table thead th {
    height: 72px;
    background: #f8fcff;
}

.availability-table th:first-child {
    width: 88px;
    color: var(--muted);
    font-size: 0.83rem;
}

.availability-table thead th span,
.availability-table thead th small {
    display: block;
}

.availability-table thead th span {
    font-size: 0.98rem;
}

.availability-table thead th small {
    margin-top: 1px;
    color: var(--muted);
    font-size: 0.68rem;
}

.availability-table .is-saturday span,
.availability-table .is-saturday small {
    color: #387ca9;
}

.availability-table .is-sunday span,
.availability-table .is-sunday small {
    color: var(--danger);
}

.availability-table tr:last-child th,
.availability-table tr:last-child td {
    border-bottom: 0;
}

.availability-table th:last-child,
.availability-table td:last-child {
    border-right: 0;
}

.slot-form {
    height: 100%;
    margin: 0;
}

.slot-button {
    width: 100%;
    height: 100%;
    min-height: 43px;
    color: var(--success);
    background: var(--success-soft);
    border: 1px solid transparent;
    border-radius: 9px;
    cursor: pointer;
    font-size: 1.25rem;
    font-weight: 850;
    transition: background 0.15s ease, border 0.15s ease, transform 0.15s ease;
}

.slot-button:hover,
.slot-button.is-selected {
    background: #d7f1e4;
    border-color: #78c69e;
    transform: scale(1.03);
}

.slot-x {
    color: #a8b2b9;
    font-size: 1.1rem;
    font-weight: 700;
}

.calendar-legend {
    padding: 18px 24px;
    display: flex;
    justify-content: center;
    gap: 26px;
    color: var(--muted);
    background: #fbfdff;
    border-top: 1px solid var(--border-soft);
    font-size: 0.82rem;
}

.calendar-legend strong {
    margin-right: 3px;
    font-size: 1rem;
}

.calendar-mobile {
    display: none;
}

.content-card {
    padding: 30px;
}

.form-stack {
    display: grid;
    gap: 22px;
}

.service-fieldset {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.service-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
}

.service-card {
    position: relative;
    cursor: pointer;
}

.service-card input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.service-card-inner {
    min-height: 132px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 17px;
    background: #fff;
    border: 2px solid var(--border-soft);
    border-radius: 16px;
    transition: border 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.service-card:hover .service-card-inner {
    border-color: var(--border);
    background: #fbfdff;
}

.service-card.is-unavailable {
    cursor: not-allowed;
}

.service-card.is-unavailable .service-card-inner {
    opacity: 0.52;
    background: #f4f6f7;
}

.service-card.is-unavailable:hover .service-card-inner {
    transform: none;
    border-color: var(--border-soft);
}

.service-card input:checked + .service-card-inner {
    background: var(--surface-soft);
    border-color: var(--primary-dark);
    box-shadow: 0 9px 24px rgba(63, 143, 197, 0.14);
}

.service-card input:focus-visible + .service-card-inner {
    outline: 3px solid rgba(63, 143, 197, 0.3);
    outline-offset: 3px;
}

.service-icon {
    width: 54px;
    height: 54px;
    flex: 0 0 54px;
    display: grid;
    place-items: center;
    color: var(--primary-deep);
    background: #ddf1ff;
    border-radius: 15px;
    font-size: 1.1rem;
    font-weight: 850;
}

.service-copy {
    flex: 1;
}

.service-copy strong,
.service-copy small,
.service-copy em {
    display: block;
}

.service-copy strong {
    font-size: 1.02rem;
}

.service-copy small {
    margin-top: 4px;
    color: var(--muted);
}

.service-copy em {
    margin-top: 7px;
    color: var(--primary-dark);
    font-size: 0.78rem;
    font-style: normal;
    font-weight: 700;
}

.service-check {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    color: #fff;
    background: #cad7df;
    border-radius: 50%;
    font-size: 0.8rem;
}

.service-card input:checked + .service-card-inner .service-check {
    background: var(--primary-dark);
}

.form-actions {
    margin-top: 6px;
    justify-content: space-between;
}

.two-column-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(280px, 0.85fr);
    align-items: start;
    gap: 24px;
}

.customer-form {
    display: grid;
    gap: 22px;
}

.reservation-sort { display: inline-flex; gap: 4px; white-space: nowrap; }
.reservation-sort-link { display: inline-block; padding: 3px 8px; border: 1px solid #cbdce7; border-radius: 4px; text-decoration: none; background: #fff; }
.reservation-sort-link.is-active { background: #1769aa; color: #fff; border-color: #1769aa; }
.reservation-sort-link:focus { outline: 2px solid #1769aa; outline-offset: 2px; }

.field-group textarea {
    font: inherit;
    resize: vertical;
}

.reservation-remarks {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
    min-width: 0;
}

.field-group {
    display: grid;
    gap: 7px;
}

.field-group label {
    font-size: 0.9rem;
    font-weight: 750;
}

.field-group input,
.field-group select,
.field-group textarea {
    width: 100%;
    min-height: 50px;
    padding: 10px 13px;
    color: var(--text);
    background: #fff;
    border: 1px solid #cbdce7;
    border-radius: 10px;
}

.field-group input:focus,
.field-group select:focus,
.field-group textarea:focus {
    border-color: var(--primary-dark);
    box-shadow: 0 0 0 4px rgba(120, 189, 234, 0.15);
    outline: none;
}

.field-group input[aria-invalid="true"] {
    border-color: var(--danger);
}

.required-mark {
    display: inline-block;
    margin-left: 4px;
    padding: 1px 6px;
    color: #fff;
    background: var(--danger);
    border-radius: 4px;
    font-size: 0.66rem;
    font-weight: 700;
    vertical-align: 2px;
}

.field-error {
    margin: 0;
    color: var(--danger);
    font-size: 0.78rem;
    font-weight: 650;
}

.field-help {
    margin: 0;
    color: var(--muted);
    font-size: 0.78rem;
}

.optional-mark {
    display: inline-block;
    margin-left: 4px;
    padding: 1px 6px;
    color: var(--muted);
    background: var(--surface-soft);
    border-radius: 4px;
    font-size: 0.66rem;
    font-weight: 700;
}

.photo-selection-grid,
.photo-preview-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.photo-selection-card,
.photo-preview-grid figure {
    margin: 0;
    padding: 9px;
    min-width: 0;
    background: var(--surface-soft);
    border: 1px solid var(--border-soft);
    border-radius: 10px;
}

.photo-selection-card img,
.photo-preview-grid img {
    width: 100%;
    aspect-ratio: 4 / 3;
    display: block;
    object-fit: cover;
    border-radius: 7px;
}

.photo-selection-card > span:not(.photo-remove),
.photo-selection-card > small,
.photo-preview-grid figcaption {
    margin-top: 6px;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.72rem;
}

.photo-selection-card > small {
    margin-top: 2px;
    color: var(--muted);
}

.photo-remove {
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--danger);
    font-size: 0.72rem;
}

.photo-remove input {
    width: auto;
    min-height: 0;
}

.completion-photos {
    margin: 0 0 25px;
    text-align: left;
}

.summary-card {
    position: sticky;
    top: 20px;
    padding: 24px;
}

.summary-card h2 {
    margin: 3px 0 20px;
    font-size: 1.2rem;
}

.summary-card dl {
    margin: 0 0 17px;
}

.summary-card dl div {
    padding: 14px 0;
    border-top: 1px solid var(--border-soft);
}

.summary-card dt {
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 700;
}

.summary-card dd {
    margin: 4px 0 0;
    font-size: 0.9rem;
    font-weight: 700;
}

.summary-card a {
    font-size: 0.8rem;
}

.confirmation-card {
    max-width: 850px;
    margin: 0 auto;
}

.confirmation-list,
.completion-summary {
    margin: 0;
}

.confirmation-list > div {
    padding: 17px 0;
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 20px;
    border-bottom: 1px solid var(--border-soft);
}

.confirmation-list dt,
.completion-summary dt {
    color: var(--muted);
    font-size: 0.83rem;
    font-weight: 700;
}

.confirmation-list dd,
.completion-summary dd {
    margin: 0;
    font-weight: 700;
}

.confirmation-note {
    margin: 24px 0;
    padding: 16px 18px;
    color: #80551b;
    background: #fff9eb;
    border: 1px solid #f2d89f;
    border-radius: 11px;
}

.confirmation-note p {
    margin: 3px 0 0;
    font-size: 0.84rem;
}

.completion-card {
    max-width: 720px;
    margin: 0 auto;
    padding: 48px;
    text-align: center;
}

.completion-mark {
    width: 74px;
    height: 74px;
    margin: 0 auto 18px;
    display: grid;
    place-items: center;
    color: #fff;
    background: linear-gradient(145deg, #52b982, var(--success));
    border-radius: 50%;
    box-shadow: 0 12px 28px rgba(47, 157, 103, 0.22);
    font-size: 2rem;
    font-weight: 800;
}

.completion-card h1 {
    margin: 5px 0 10px;
    font-size: 2rem;
}

.completion-lead {
    margin: 0 auto 27px;
    color: var(--muted);
}

.reservation-code {
    margin: 0 auto 25px;
    padding: 19px;
    background: var(--surface-soft);
    border: 1px dashed var(--primary-dark);
    border-radius: 14px;
}

.reservation-code span,
.reservation-code strong {
    display: block;
}

.reservation-code span {
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 700;
}

.reservation-code strong {
    margin-top: 3px;
    color: var(--primary-deep);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 1.75rem;
    letter-spacing: 0.07em;
}

.completion-summary {
    margin-bottom: 28px;
    text-align: left;
}

.completion-summary > div {
    padding: 14px 0;
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 18px;
    border-bottom: 1px solid var(--border-soft);
}

.alert {
    margin-bottom: 20px;
    padding: 14px 17px;
    border: 1px solid;
    border-radius: 11px;
    font-weight: 650;
}

.alert-error {
    color: #9f3939;
    background: var(--danger-soft);
    border-color: #efb9b9;
}

.alert-success {
    color: #257b52;
    background: var(--success-soft);
    border-color: #a9dec2;
}

.site-footer {
    min-height: 110px;
    padding: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    color: var(--muted);
    background: #fff;
    border-top: 1px solid var(--border-soft);
    font-size: 0.75rem;
}

.site-footer p {
    margin: 0;
}

.site-footer a {
    color: var(--muted);
}

.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;
}

@media (max-width: 840px) {
    .calendar-desktop {
        display: none;
    }

    .calendar-mobile {
        display: block;
        padding: 14px;
    }

    .day-card {
        padding: 16px;
        background: #fbfdff;
        border: 1px solid var(--border-soft);
        border-radius: 14px;
    }

    .day-card + .day-card {
        margin-top: 12px;
    }

    .day-card h3 {
        margin: 0 0 12px;
        font-size: 0.95rem;
    }

    .mobile-slots {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .mobile-slots form {
        margin: 0;
    }

    .mobile-slot-button {
        width: 100%;
        min-height: 48px;
        padding: 7px 9px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        color: var(--text);
        background: var(--success-soft);
        border: 1px solid #bfdfce;
        border-radius: 9px;
        cursor: pointer;
        font-size: 0.78rem;
    }

    .mobile-slot-button strong {
        color: var(--success);
        font-size: 1rem;
    }

    .mobile-slot-button.is-unavailable {
        color: #a3adb4;
        background: #f5f7f8;
        border-color: #e3e8eb;
        cursor: default;
    }

    .mobile-slot-button.is-unavailable strong {
        color: #adb6bc;
    }

    .two-column-layout {
        grid-template-columns: 1fr;
    }

    .summary-card {
        position: static;
        grid-row: 1;
    }
}

@media (max-width: 680px) {
    .site-header-inner,
    .page-shell {
        width: min(100% - 26px, 1120px);
    }

    .site-header-inner {
        min-height: 72px;
    }

    .brand strong {
        font-size: 0.9rem;
    }

    .brand small {
        display: none;
    }

    .steps {
        padding: 18px 13px 28px;
    }

    .steps li {
        justify-content: center;
    }

    .steps li:not(:last-child)::after {
        top: 14px;
        left: calc(50% + 17px);
        width: calc(100% - 34px);
    }

    .step-number {
        width: 30px;
        height: 30px;
        flex-basis: 30px;
        font-size: 0.72rem;
    }

    .step-label {
        display: none;
    }

    .steps .is-current .step-label {
        position: absolute;
        top: 36px;
        left: 50%;
        display: block;
        transform: translateX(-50%);
        white-space: nowrap;
        font-size: 0.65rem;
    }

    .page-shell {
        padding: 38px 0 55px;
    }

    .hero-panel,
    .hero-panel.compact,
    .calendar-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .hero-panel h1 {
        font-size: 1.65rem;
    }

    .booking-window,
    .selection-summary {
        min-width: 0;
    }

    .calendar-toolbar {
        padding: 20px;
    }

    .week-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .week-actions > :nth-child(2) {
        display: none;
    }

    .calendar-legend {
        flex-wrap: wrap;
        gap: 10px 20px;
    }

    .mobile-slots {
        grid-template-columns: repeat(2, 1fr);
    }

    .content-card,
    .completion-card {
        padding: 22px 18px;
    }

    .form-actions {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .form-actions .button {
        width: 100%;
    }

    .confirmation-list > div,
    .completion-summary > div {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .photo-selection-grid,
    .photo-preview-grid {
        grid-template-columns: 1fr;
    }

    .completion-card h1 {
        font-size: 1.65rem;
    }

    .reservation-code strong {
        font-size: 1.35rem;
    }

    .booking-contact-notice {
        align-items: stretch;
        flex-direction: column;
    }

    .booking-contact-notice .button {
        min-width: 0;
    }
}
