*, *::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0
}

body {
    --border-radius: 10px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #F7F5F2;
    color: #1a1a1a;
    min-height: 100vh;
    line-height: 1.6;
}

.page {

    margin: 0 auto;
}

h2 {
    font-size: 26px;
    font-weight: 600;
    letter-spacing: -.02em;
    margin-bottom: 6px;
    color: #1a1a1a;
}

.page-subtitle {
    font-size: 18px;
    color: #9f9f9f;
    margin-bottom: 20px
}

.logo {
    width: 200px
}

/* direction-toggle */
.direction-toggle {
    display: inline-flex;
    background: #EDEBE7;
    border-radius: var(--border-radius);
    padding: 3px;
    gap: 2px;
    margin-bottom: 20px;
}

.direction-toggle__button {
    font-size: 16px;
    font-weight: 500;
    background: transparent;
    border: none;
    border-radius: var(--border-radius);
    padding: 7px 16px;
    cursor: pointer;
    color: #9a9690;
    transition: all .15s;
}

.direction-toggle__button.on {
    background: #fff;
    color: #1a1a1a;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .06)
}

/* input */
.search-box {
    position: relative;
    margin-bottom: 28px
}

#search-input {
    padding: 18px !important;
    height: 24px !important;
    width: 100%;
    background: #fff;
    border: 1.5px solid #E5E2DC;
    border-radius: var(--border-radius);
    font-size: 17px;
    padding: 13px 42px 13px 16px;
    outline: none;
    color: #1a1a1a;
    transition: border-color .15s;
}

#search-input::placeholder {
    color: #9f9f9f
}

#search-input:focus {
    border-color: #B8B3AB
}

.search-box__icon{
    position:absolute;
    right:14px;
    top:50%;
    transform:translateY(-50%);
    color:#C4C0BA;
    line-height:0;
    pointer-events:none;
    display:flex;
    align-items:center;
    justify-content:center;
}

.search-box.has-value .search-box__icon{
    display:none;
}

.search-box__clear {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #C4C0BA;
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
    padding: 2px;
    display: none;

    font-size: 16px;
    font-weight: 500;
    background: #FAF8F5;
    border: 1px solid #E5E2DC;
    border-radius: var(--border-radius);
    padding: 6px 14px;
    cursor: pointer;
    color: #9a9690;
    transition: all .15s;
}

.search-box__clear.show {
    display: block
}

/* dropdown */
.search-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1.5px solid #E5E2DC;
    border-radius: var(--border-radius);
    overflow: hidden;
    z-index: 50;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .06);
    display: none;
}

.search-dropdown.open {
    display: block
}

.search-dropdown__item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 11px 16px;
    cursor: pointer;
    border-bottom: 1px solid #F2EFE9;
    transition: background .1s;
}

.search-dropdown__item:last-child {
    border: none
}

.search-dropdown__item:hover, .search-dropdown__item.on {
    background: #FAF8F5
}

.search-dropdown__code {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    min-width: 44px;
    flex-shrink: 0;
    padding-top: 1px
}

.search-dropdown__name {
    font-size: 16px;
    color: #7a7570;
    line-height: 1.4
}

.search-dropdown__name em {
    color: #1a1a1a;
    font-style: normal
}

.search-dropdown__empty {
    padding: 14px 16px;
    font-size: 16px;
    color: #9a9690;
    text-align: center
}

/* result card */
.mapping-card {
    background: #fff;
    border: 1.5px solid #E5E2DC;
    border-radius: var(--border-radius);
    overflow: hidden;
}

.mapping-card__header {
    padding: 18px 20px;
    border-bottom: 1px solid #F2EFE9
}

.mapping-card__code {
    font-size: 23px;
    font-weight: 600;
    letter-spacing: -.02em;
    color: #1a1a1a
}

.mapping-card__label {
    font-size: 18px;
    color: #9a9690;
    margin-top: 3px
}

.mapping-card__body {
    padding: 18px 20px
}

/* pill */
.pill {
    display: inline-block;
    font-size: 15px;
    font-weight: 500;
    padding: 5px 15px;
    border-radius: 999px;
    margin-bottom: 14px;
}

.pill.ok {
    background: #EBF5EE;
    color: #2F7A4A
}

.pill.many {
    background: #FFF3E3;
    color: #A06020
}

.pill.no {
    background: #FAEAEA;
    color: #A03030
}

/* items */
.mapping-result__label {
    font-size: 18px;
    font-weight: 500;
    color: #4e4e4e;
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: 10px
}

.mapping-result__item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 11px 14px;
    border: 1px solid #F2EFE9;
    border-radius: var(--border-radius);
    margin-bottom: 6px;
}

.mapping-result__item:last-of-type {
    margin-bottom: 0
}

.mapping-result__code {
    font-size: 23px;
    font-weight: 600;
    min-width: 48px;
    flex-shrink: 0;
    padding-top: 1px;
    color: #1a1a1a
}

.mapping-result__name {
    font-size: 18px;
    color: #6a6560;
    line-height: 1.45
}

/* absent */
.mapping-result__notice {
    padding: 14px 16px;
    background: #FAEAEA;
    border-radius: var(--border-radius);
    color: #A03030;
    font-size: 16px;
}

.mapping-result__notice small {
    display: block;
    color: #C08080;
    font-size: 16px;
    margin-top: 3px
}

/* copy */
.mapping-card__actions {
    display: flex;
    gap: 8px;
    margin-top: 16px
}

.mapping-card__copy-button,
.mapping-card__close-button {
    font-size: 16px;
    font-weight: 500;
    background: #FAF8F5;
    border: 1px solid #E5E2DC;
    border-radius: var(--border-radius);
    padding: 6px 14px;
    cursor: pointer;
    color: #9a9690;
    transition: all .15s;
}

.mapping-card__copy-button:hover,
.mapping-card__close-button:hover {
    color: #1a1a1a;
    border-color: #C4C0BA
}

.mapping-card__copy-button.ok,
.mapping-card__close-button.ok {
    color: #2F7A4A;
    border-color: #A8D4B4
}

/* loading */
.loading-state {
    font-size: 16px;
    color: #9a9690;
    padding: 12px 0;
    display: flex;
    align-items: center;
    gap: 8px
}

.loading-spinner {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
    border: 1.5px solid #E5E2DC;
    border-top-color: #9a9690;
    border-radius: 50%;
    animation: sp .6s linear infinite;
}

em {
    background-color: #ffbc4d
}

@keyframes sp {
    to {
        transform: rotate(360deg)
    }
}

@media (max-width: 480px) {
    .page {
        padding: 40px 16px 60px
    }

    .direction-toggle__button {
        padding: 6px 12px;
        font-size: 16px
    }
}

.wrapper-btns-result {
    display: none;
}

.search-dropdown {
    max-height: 300px;
    overflow-y: auto;
}

.mapping-result__notice--light {
    background: #fff;
    margin-bottom: 10px;
}

.search-dropdown__loading {
    padding: 14px 16px;
    color: #7a7570;
}

.mapping-card__query {
    font-size: 18px;
    font-weight: 500;
    color: #4e4e4e;
    margin-bottom: 10px
}
