body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

#app {
    width: 100%;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    flex: 1;
}

h2 {
    text-align: center;
    margin: 0;
}

header {
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
    height: fit-content;
    border: none;
    border-bottom: 1px solid lightgray;
    background: radial-gradient(ellipse 60% 50% at bottom center,
            rgba(0, 89, 143, 0.04) 0%,
            rgba(0, 89, 143, 0.02) 35%,
            rgba(0, 89, 143, 0) 85%),
        rgba(255, 255, 255, 0.9);
    box-shadow: none;
    position: sticky;
    top: 0;
    margin: 0 auto;
    padding: 1rem 0;
    backdrop-filter: blur(5px);
}

header::before {
    content: attr(name);
    position: absolute;
    right: 0;
    top: 0;
    font-size: 12px;
    padding: 3px;
    color: #949494;
}

form>div {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: .5rem;
    width: 100%;
    margin: 10px 0;

    &> :first-child {
        flex: 0 0 150px;
    }

    &> :first-child+* {
        flex: 1 1 300px;
        width: 100%;
        display: block;
    }

    &>span {
        min-height: 40px;
        padding: 5px 0;
        font-size: 1.2rem;
        line-height: 40px;
    }
}

button {
    display: block;
    outline: none;
    border-radius: 100px;
    border: 0;
    min-width: 6rem;
    height: 40px;
    cursor: pointer;
    line-height: 40px;
    font-size: 15px;
    font-weight: 700;
    transition: transform 0.3s ease,
        filter 0.3s ease,
        box-shadow 0.3s ease;
    transform-origin: center center;
    box-sizing: border-box;
    padding-left: 20px;
    padding-right: 20px;
    text-decoration: none;
}

button:hover,
button:focus-visible {
    filter: brightness(1.1);
    transform: scale(1.02);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

button.danger {
    color: rgb(255, 255, 255);
    background-color: rgb(220, 78, 65);
}

button.submit {
    color: rgb(255, 255, 255);
    background-color: rgb(6, 111, 209);
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

select,
.textbox {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    margin: 5px 0;
    min-height: 40px;
    /* min-width: 200px; */
    padding: 5px 20px;
    border: 1px solid #949494;
    border-radius: 40px;
    background: #fff;
    font-size: 20px;
    line-height: normal;
    outline: none;
    box-sizing: border-box;
    -webkit-border-radius: 40px;
    width: 100%;
}

select:focus,
.textbox:focus {
    border-color: rgba(0, 123, 255, 0.5);
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.3);
}

select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23066FD1' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6l6 -6' /%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 24px;
}

.switch {
    width: fit-content;
    margin: .5rem auto -.5rem auto;
    padding: 2px;
    border-radius: 999px;
    background-color: rgba(0, 0, 0, 0.05);
    font-size: 1rem;
    border: 2px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 0 2px #9c9c9c;
    background-clip: padding-box;
    display: flex;
    align-items: center;

    &>label {
        appearance: none;
        padding: 2px 10px;
        border-radius: 999px;
        cursor: pointer;
        user-select: none;
        text-decoration: none;
        color: inherit;

        &:has(input[type="radio"]:checked) {
            background-color: white;
            box-shadow: 0 0 5px rgba(0, 0, 0, 0.15);
        }

        &>input[type="radio"] {
            display: none;
        }
    }
}

label:has(input[type="checkbox"]) {
    align-self: center;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    position: relative;
    padding: 5px;
    font-size: 1.2rem;

    & input[type="checkbox"] {
        appearance: none;
        position: absolute;
        opacity: 0;
    }

    &::before {
        content: "";
        width: 1.5rem;
        height: 1.5rem;
        border: 1px solid #949494;
        border-radius: 5px;
        flex-shrink: 0;
    }

    &::after {
        content: "";
        position: absolute;
        left: 15px;
        top: 30%;
        width: 10px;
        height: 22px;
        border: solid #06c;
        border-width: 0 3px 3px 0;
        transform: translateY(-30%) rotate(45deg);
        opacity: 0;
    }

    &:has(input:checked)::after {
        opacity: 1;
    }
}

ul.result-list {
    height: calc(100% - 80px);
    display: flex;
    flex-direction: column;
    list-style: none;
    padding: 0 0.5rem;
    margin: 0;

    &>li {
        margin: 0;
        padding: 0;
        max-width: 100%;

        &.item,
        &>a {
            display: block;
            text-decoration: none;
            max-width: 100%;
            outline: 1px solid rgba(50, 100, 201, 0.5);
            border-radius: .6rem;
            background-image: repeating-linear-gradient(-45deg, #f5f5f5 0, #f5f5f5 2px, #F0F0F8 2px, #F0F0F8 4px);
            color: #5c5c5c;
            word-wrap: break-word;
            word-break: break-all;
            white-space: normal;
            min-height: 50px;
            position: relative;
            margin-top: 10px;
            height: auto;
            padding: .5rem 2rem .5rem 1rem;
            transition: background-image, outline 0.1s ease-in-out;
        }

        &>a {

            &:hover,
            &:focus-visible {
                background-image: repeating-linear-gradient(-45deg, #f2f5f9 0, #f2f5f9 4px);
                outline: 2px solid rgba(50, 100, 201, 1);
            }

            &::after {
                content: "";
                position: absolute;
                top: 50%;
                transform: translateY(-50%);
                right: .1rem;
                width: 1.5rem;
                height: 2rem;
                background: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='currentColor'%20stroke-width='1'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20stroke='none'%20d='M0%200h24v24H0z'%20fill='none'/%3E%3Cpath%20d='M9%206l6%206l-6%206'/%3E%3C/svg%3E") no-repeat center right;
                background-size: contain;
                pointer-events: none;
            }
        }
    }
}

table {
    border: 1px solid gray;
    width: 100%;
    margin: 0.5rem auto;
    border-radius: 10px;
    overflow: hidden;
    font-size: 1rem;
    border-spacing: 0;
    max-width: calc(100% - 1rem);
}

table th,
table td {
    border-right: 1px solid lightgray;
    border-bottom: 1px solid lightgray;
    padding: 6px;
}

table tr:last-child td {
    border-bottom: none;
}

table td:last-child {
    border-right: none;
}

.info {
    color: #06c;
    background: initial;
    text-shadow: none;
    padding: 0 0.5rem 0 0.5rem;
    text-align: left;
    border-radius: 0;
    width: fit-content;
    min-width: 2rem;
    margin: 0;
    border-left: 3px solid #06c;
}

.warning {
    margin: 1rem 0;
    padding: 1rem;
    border: 2px solid #ffe69c;
    background-color: #fff3cd;
    color: #664d03;
    border-radius: 5px;
    font-size: small;
}