:root {
    --greeting-ink: #181817;
    --greeting-muted: #66635e;
    --greeting-line: var(--bj-line, #ece9e6);
    --greeting-soft-line: #ebe8e2;
    --greeting-paper: #fbfaf7;
}

body:has(.greetingSearch) {
    color: var(--greeting-ink);
    background: #fff;
}

.greetingSearch,
.greetingSearch * {
    box-sizing: border-box;
}

.greetingSearch {
    width: min(100% - 48px, 1000px);
    margin: 0 auto;
    padding: 64px 0 128px;
    color: var(--greeting-ink);
    font-family: var(--bj-font-family);
}

.greetingSearch a {
    color: inherit;
    text-decoration: none;
}

.greetingSearch__intro {
    max-width: 640px;
    padding-bottom: 32px;
}

.greetingSearch__intro h1 {
    margin: 0;
    font-size: var(--bj-type-page);
    font-weight: var(--bj-type-page-weight);
    line-height: var(--bj-type-page-line);
    letter-spacing: -.03em;
}

.greetingSearch__intro > p:last-child {
    margin: 8px 0 0;
    color: var(--greeting-muted);
    font-size: var(--bj-type-body);
    font-weight: var(--bj-type-body-weight);
    line-height: var(--bj-type-body-line);
    letter-spacing: -.01em;
    word-break: keep-all;
}

.greetingSearch__family {
    border-top: 1px solid var(--greeting-ink);
    border-bottom: 1px solid var(--greeting-line);
    scrollbar-width: none;
}

.greetingSearch__family::-webkit-scrollbar,
.greetingSearch__typeRail::-webkit-scrollbar {
    display: none;
}

.greetingSearch__rail {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.greetingSearch__familyLink {
    position: relative;
    display: flex;
    min-height: 72px;
    align-items: center;
    justify-content: center;
    color: var(--greeting-muted);
    font-size: var(--bj-type-nav);
    font-weight: var(--bj-type-nav-weight);
    letter-spacing: -.02em;
}

.greetingSearch__familyLink > span {
    color: inherit;
    font: inherit;
    letter-spacing: inherit;
}

.greetingSearch__familyLink::after {
    position: absolute;
    right: 0;
    bottom: -1px;
    left: 0;
    height: 2px;
    background: transparent;
    content: "";
}

.greetingSearch__familyLink:hover,
.greetingSearch__familyLink:focus-visible,
.greetingSearch__familyLink.is-active {
    color: var(--greeting-ink);
}

.greetingSearch__familyLink.is-active {
    font-weight: 600;
}

.greetingSearch__familyLink.is-active::after {
    background: var(--greeting-ink);
}

/* Block surface focus: tab and sort links underline their label; no box. */
.greetingSearch__familyLink:focus-visible,
.greetingSearch__typeLink:focus-visible,
.greetingSearch__sort a:focus-visible {
    outline: none;
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 4px;
}

.greetingSearch__types {
    padding-top: 64px;
}

.greetingSearch__sectionHead {
    margin-bottom: 32px;
}

.greetingSearch__sectionHead h2,
.greetingSearch__summary h2 {
    margin: 0;
    font-size: var(--bj-type-subsection);
    font-weight: var(--bj-type-subsection-weight);
    line-height: var(--bj-type-subsection-line);
    letter-spacing: -.025em;
}

.greetingSearch__sectionHead > p {
    margin: 8px 0 0;
    color: var(--greeting-muted);
    font-size: var(--bj-type-caption);
    line-height: 1.6;
    letter-spacing: -.01em;
}

.greetingSearch__typeRail {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    border-top: 1px solid var(--greeting-line);
    border-bottom: 1px solid var(--greeting-line);
}

.greetingSearch__typeLink {
    position: relative;
    display: flex;
    min-width: 0;
    min-height: 56px;
    align-items: center;
    justify-content: center;
    padding: 0 18px;
    color: var(--greeting-muted);
    font-size: var(--bj-type-control);
    font-weight: var(--bj-type-control-weight);
    letter-spacing: -.02em;
    white-space: nowrap;
}

.greetingSearch__typeLink::after {
    position: absolute;
    right: 18px;
    bottom: -1px;
    left: 18px;
    height: 2px;
    background: transparent;
    content: "";
}

.greetingSearch__typeLink:hover,
.greetingSearch__typeLink:focus-visible,
.greetingSearch__typeLink.is-active {
    color: var(--greeting-ink);
}

.greetingSearch__typeLink.is-active {
    font-weight: 600;
}

.greetingSearch__typeLink.is-active::after {
    background: var(--greeting-ink);
}

.greetingSearch__results {
    padding-top: 64px;
}

.greetingSearch__resultBar {
    display: flex;
    min-height: 64px;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    border-top: 1px solid var(--greeting-ink);
    border-bottom: 1px solid var(--greeting-line);
}

.greetingSearch__summary {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin: 0;
}

.greetingSearch__summary h2 {
    font-size: var(--bj-type-subsection);
}

.greetingSearch__summary > p {
    margin: 0;
    color: var(--greeting-muted);
    font-size: var(--bj-type-caption);
}

.greetingSearch__summary strong {
    color: var(--greeting-ink);
    font-weight: 600;
}

.greetingSearch__sort {
    display: flex;
    min-height: 44px;
    align-items: stretch;
}

.greetingSearch__sort a {
    position: relative;
    display: flex;
    min-width: 68px;
    align-items: center;
    justify-content: center;
    color: var(--greeting-muted);
    font-size: var(--bj-type-control);
    letter-spacing: -.015em;
}

.greetingSearch__sort a + a::before {
    position: absolute;
    top: 15px;
    bottom: 15px;
    left: 0;
    width: 1px;
    background: var(--greeting-line);
    content: "";
}

.greetingSearch__sort a.is-active {
    color: var(--greeting-ink);
    font-weight: 600;
}

.greetingSearch__list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 40px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.greetingSearch__item {
    display: block;
    min-height: 0;
    padding: 32px 0;
    border-bottom: 1px solid var(--greeting-line);
}

.greetingSearch__code {
    display: flex;
    align-items: flex-start;
    flex-direction: row;
    gap: 8px;
    margin-bottom: 16px;
    padding: 0;
    color: var(--greeting-muted);
    font-size: var(--bj-type-caption);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    line-height: 1.4;
}

.greetingSearch__code > span:first-child {
    color: inherit;
    font: inherit;
    letter-spacing: inherit;
}

.greetingSearch__best {
    display: inline-block;
    color: #77746f;
    font-size: var(--bj-type-caption);
    font-weight: 600;
    letter-spacing: .06em;
    line-height: 1;
}

.greetingSearch__message {
    display: flex;
    max-width: none;
    flex-direction: column;
    justify-content: center;
    gap: 30px;
    margin: 0;
    padding: 0;
    color: #3f3e3b;
    font-family: var(--bj-font-family);
    font-size: var(--bj-type-body);
    font-weight: var(--bj-type-body-weight);
    line-height: var(--bj-type-body-line);
    letter-spacing: -.01em;
    text-align: left;
    word-break: keep-all;
}

.greetingSearch__message p,
.greetingSearch__message section {
    margin: 0;
}

.greetingSearch__message p {
    color: inherit;
    font: inherit;
    letter-spacing: inherit;
}

.greetingSearch__message h3 {
    margin: 0 0 8px;
    color: var(--greeting-muted);
    font-family: var(--primaryFont, "Spoqa Han Sans Neo", sans-serif);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .06em;
}

.greetingSearch__empty {
    padding: 88px 24px;
    border-bottom: 1px solid var(--greeting-line);
    text-align: center;
}

.greetingSearch__empty strong {
    font-size: 18px;
    font-weight: 500;
}

.greetingSearch__empty p {
    margin: 10px 0 0;
    color: var(--greeting-muted);
    font-size: 14px;
}

@media (max-width: 767px) {
    .greetingSearch {
        width: 100%;
        padding: 48px 0 80px;
    }

    .greetingSearch__intro,
    .greetingSearch__sectionHead,
    .greetingSearch__resultBar,
    .greetingSearch__typeRail,
    .greetingSearch__list {
        margin-right: 16px;
        margin-left: 16px;
    }

    .greetingSearch__intro {
        display: block;
        padding-bottom: 24px;
    }

    .greetingSearch__intro h1 {
        font-size: var(--bj-type-page);
        line-height: var(--bj-type-page-line);
    }

    .greetingSearch__intro > p:last-child {
        margin-top: 8px;
        font-size: var(--bj-type-body);
        line-height: var(--bj-type-body-line);
    }

    .greetingSearch__family {
        overflow-x: auto;
    }

    .greetingSearch__rail {
        display: flex;
        width: max-content;
        min-width: 100%;
    }

    .greetingSearch__familyLink {
        min-width: 128px;
        min-height: 64px;
        padding: 0 16px;
        font-size: var(--bj-type-nav);
    }

    .greetingSearch__types {
        padding-top: 48px;
    }

    .greetingSearch__sectionHead {
        margin-bottom: 24px;
    }

    .greetingSearch__sectionHead h2 {
        font-size: var(--bj-type-subsection);
    }

    .greetingSearch__sectionHead > p {
        display: none;
    }

    .greetingSearch__typeRail {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .greetingSearch__typeLink {
        min-height: 52px;
        justify-content: flex-start;
        padding: 0 12px;
        border-bottom: 1px solid var(--greeting-soft-line);
        font-size: var(--bj-type-control);
    }

    .greetingSearch__typeLink::after {
        right: 12px;
        left: 12px;
    }

    .greetingSearch__typeLink:last-child:nth-child(odd) {
        grid-column: 1 / -1;
    }

    .greetingSearch__results {
        padding-top: 24px;
    }

    .greetingSearch__resultBar {
        min-height: 64px;
        align-items: center;
        gap: 12px;
    }

    .greetingSearch__summary h2 {
        font-size: var(--bj-type-subsection);
    }

    .greetingSearch__summary > p {
        font-size: var(--bj-type-caption);
    }

    .greetingSearch__sort a {
        min-width: 56px;
        font-size: var(--bj-type-control);
    }

    .greetingSearch__item {
        padding: 24px 0;
    }

    .greetingSearch__code {
        margin-bottom: 16px;
        font-size: var(--bj-type-caption);
    }

    .greetingSearch__message {
        max-width: none;
        min-height: 0;
        padding: 0;
        font-size: var(--bj-type-body);
        line-height: var(--bj-type-body-line);
    }

    .greetingSearch__list {
        display: block;
    }
}

@media (min-width: 768px) and (max-width: 1039px) {
    .greetingSearch {
        width: calc(100% - 48px);
    }
}

@media (max-width: 359px) {
    .greetingSearch__familyLink {
        min-height: 56px;
    }

    .greetingSearch__types {
        padding-top: 24px;
    }

    .greetingSearch__sectionHead {
        margin-bottom: 16px;
    }

    .greetingSearch__typeLink {
        min-height: 44px;
    }

    .greetingSearch__results {
        padding-top: 16px;
    }

    .greetingSearch__resultBar {
        gap: 4px;
    }

    .greetingSearch__summary {
        gap: 6px;
        white-space: nowrap;
    }

    .greetingSearch__sort a {
        min-width: 48px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .greetingSearch * {
        scroll-behavior: auto !important;
    }
}
