:root {
    color-scheme: light dark;
    --bs-blue: #0d6efd;
    --bs-indigo: #6610f2;
    --bs-purple: #6f42c1;
    --bs-pink: #d63384;
    --bs-red: #dc3545;
    --bs-orange: #fd7e14;
    --bs-yellow: #ffc107;
    --bs-green: #198754;
    --bs-teal: #20c997;
    --bs-cyan: #0dcaf0;
    --bs-black: #000;
    --bs-white: #fff;
    --bs-gray: #6c757d;
    --bs-gray-dark: #343a40;
    --bs-gray-100: #212529;
    --bs-gray-200: #343a40;
    --bs-gray-300: #495057;
    --bs-gray-400: #6c757d;
    --bs-gray-500: #adb5bd;
    --bs-gray-600: #ced4da;
    --bs-gray-700: #dee2e6;
    --bs-gray-800: #e9ecef;
    --bs-gray-900: #f8f9fa;
    --bs-primary: #0d6efd;
    --bs-secondary: #6c757d;
    --bs-success: #198754;
    --bs-info: #0dcaf0;
    --bs-warning: #ffc107;
    --bs-danger: #dc3545;
    --bs-light: #f8f9fa;
    --bs-dark: #212529;
    --bs-primary-rgb: 13, 110, 253;
    --bs-secondary-rgb: 108, 117, 125;
    --bs-success-rgb: 25, 135, 84;
    --bs-info-rgb: 13, 202, 240;
    --bs-warning-rgb: 255, 193, 7;
    --bs-danger-rgb: 220, 53, 69;
    --bs-light-rgb: 248, 249, 250;
    --bs-dark-rgb: 33, 37, 41;
    --bs-primary-text-emphasis: #052c65;
    --bs-secondary-text-emphasis: #2b2f32;
    --bs-success-text-emphasis: #0a3622;
    --bs-info-text-emphasis: #055160;
    --bs-warning-text-emphasis: #664d03;
    --bs-danger-text-emphasis: #58151c;
    --bs-light-text-emphasis: #495057;
    --bs-dark-text-emphasis: #495057;
    --bs-primary-bg-subtle: #cfe2ff;
    --bs-secondary-bg-subtle: #e2e3e5;
    --bs-success-bg-subtle: #d1e7dd;
    --bs-info-bg-subtle: #cff4fc;
    --bs-warning-bg-subtle: #fff3cd;
    --bs-danger-bg-subtle: #f8d7da;
    --bs-light-bg-subtle: #fcfcfd;
    --bs-dark-bg-subtle: #ced4da;
    --bs-primary-border-subtle: #9ec5fe;
    --bs-secondary-border-subtle: #c4c8cb;
    --bs-tertiary-border-subtle: #c8c4cb;
    --bs-success-border-subtle: #a3cfbb;
    --bs-info-border-subtle: #9eeaf9;
    --bs-warning-border-subtle: #ffe69c;
    --bs-danger-border-subtle: #f1aeb5;
    --bs-light-border-subtle: #e9ecef;
    --bs-dark-border-subtle: #adb5bd;
    --bs-white-rgb: 255, 255, 255;
    --bs-black-rgb: 0, 0, 0;
    --bs-font-sans-serif: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    --bs-font-monospace: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    --bs-gradient: linear-gradient(180deg,   rgba(255,   255,   255,   0.15),   rgba(255,   255,   255,   0));
    --bs-body-font-family: var(--bs-font-sans-serif);
    --bs-body-font-size: 1rem;
    --bs-body-font-weight: 400;
    --bs-body-line-height: 1.5;
    --bs-body-color: #212529;
    --bs-body-color-rgb: 33, 37, 41;
    --bs-body-bg: #fff;
    --bs-body-bg-rgb: 255, 255, 255;
    --bs-emphasis-color: #000;
    --bs-emphasis-color-rgb: 0, 0, 0;
    --bs-secondary-bg: #e9ecef;
    --bs-secondary-bg-rgb: 233, 236, 239;
    --bs-tertiary-color: rgba(33,   37,   41,   0.5);
    --bs-tertiary-color-rgb: 33, 37, 41;
    --bs-tertiary-bg: #f8f9fa;
    --bs-tertiary-bg-rgb: 248, 249, 250;
    --bs-heading-color: inherit;
    --bs-link-color: #0d6efd;
    --bs-link-color-rgb: 13, 110, 253;
    --bs-link-decoration: underline;
    --bs-link-hover-color: #0a58ca;
    --bs-link-hover-color-rgb: 10, 88, 202;
    --bs-code-color: #d63384;
    --bs-highlight-color: #212529;
    --bs-highlight-bg: #fff3cd;
    --bs-border-width: 1px;
    --bs-border-style: solid;
    --bs-border-color: #dee2e6;
    --bs-border-color-translucent: rgba(255,   255,   255,   0.15);
    --bs-border-radius: 0.375rem;
    --bs-border-radius-sm: 0.25rem;
    --bs-border-radius-lg: 0.5rem;
    --bs-border-radius-xl: 1rem;
    --bs-border-radius-xxl: 2rem;
    --bs-border-radius-2xl: var(--bs-border-radius-xxl);
    --bs-border-radius-pill: 50rem;
    --bs-box-shadow: 0 0.5rem 1rem rgba(0,   0,   0,   0.15);
    --bs-box-shadow-sm: 0 0.125rem 0.25rem rgba(0,   0,   0,   0.075);
    --bs-box-shadow-lg: 0 1rem 3rem rgba(0,   0,   0,   0.175);
    --bs-box-shadow-inset: inset 0 1px 2px rgba(0,   0,   0,   0.075);
    --bs-focus-ring-width: 0.25rem;
    --bs-focus-ring-opacity: 0.25;
    --bs-focus-ring-color: rgba(13,   110,   253,   0.25);
    --bs-form-valid-color: #198754;
    --bs-form-valid-border-color: #198754;
    --bs-form-invalid-color: #dc3545;
    --bs-form-invalid-border-color: #dc3545;

    --radicals-components-padding: 5px;
    --fast-fade: 0.25s cubic-bezier(0,0,0,1);
    --svg-light-background: var(--bs-light);

    /* URI Components escaped */
    --reset-button-svg: url("data:image/svg+xml, %3Csvg%20fill%3D%22%23000000%22%20width%3D%22800px%22%20height%3D%22800px%22%20viewBox%3D%220%200%201920%201920%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M960%200v213.333c411.627%200%20746.667%20334.934%20746.667%20746.667S1371.627%201706.667%20960%201706.667%20213.333%201371.733%20213.333%20960c0-197.013%2078.4-382.507%20213.334-520.747v254.08H640V106.667H53.333V320h191.04C88.64%20494.08%200%20720.96%200%20960c0%20529.28%20430.613%20960%20960%20960s960-430.72%20960-960S1489.387%200%20960%200%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E");
    --reset-button-size: 0.85em;
    --clear-text-button-svg: url("data:image/svg+xml, %3Csvg%20width%3D%22365.76624%22%20height%3D%22365.76624%22%20viewBox%3D%220%200%2010.972987%2010.972987%22%20version%3D%221.1%22%20id%3D%22svg1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Asvg%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%20%3Cdefs%20id%3D%22defs1%22%20%2F%3E%20%3Cpath%20fill%3D%22none%22%20stroke%3D%22%23000000%22%20stroke-width%3D%222%22%20d%3D%22M%200.48649307%2C0.48649307%2010.486493%2C10.486493%20m%20-9.99999993%2C0%209.99999993%2C-9.99999993%22%20id%3D%22path1%22%20style%3D%22fill%3Anone%3Bfill-opacity%3A1%3Bstroke-width%3A1.37601%3Bstroke-dasharray%3Anone%22%2F%3E%3C%2Fsvg%3E");
    --search-button-svg: url("data:image/svg+xml, %3Csvg%20fill%3D%22%23000000%22%20width%3D%22550%22%20height%3D%22550%22%20viewBox%3D%220%200%2022%2022%22%20version%3D%221.1%22%20id%3D%22svg1%22%20sodipodi%3Adocname%3D%22search-svgrepo-com.svg%22%20xmlns%3Ainkscape%3D%22http%3A%2F%2Fwww.inkscape.org%2Fnamespaces%2Finkscape%22%20xmlns%3Asodipodi%3D%22http%3A%2F%2Fsodipodi.sourceforge.net%2FDTD%2Fsodipodi-0.dtd%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Asvg%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%20%3Cdefs%20id%3D%22defs1%22%2F%3E%20%3Csodipodi%3Anamedview%20id%3D%22namedview1%22%20pagecolor%3D%22%23ffffff%22%20bordercolor%3D%22%23000000%22%20borderopacity%3D%220.25%22%20inkscape%3Ashowpageshadow%3D%222%22%20inkscape%3Apageopacity%3D%220.0%22%20inkscape%3Apagecheckerboard%3D%220%22%20inkscape%3Adeskcolor%3D%22%23d1d1d1%22%3E%20%3Cinkscape%3Apage%20x%3D%220%22%20y%3D%220%22%20width%3D%2222%22%20height%3D%2222%22%20id%3D%22page2%22%20margin%3D%220%22%20bleed%3D%220%22%2F%3E%20%3C%2Fsodipodi%3Anamedview%3E%20%3Cpath%20d%3D%22M%2022%2C19.57%2016.353%2C13.922%20A%208.895%2C8.895%200%200%200%2017.875%2C8.938%20C%2017.875%2C4.01%2013.867%2C0%208.938%2C0%204.01%2C0%200%2C4.01%200%2C8.938%20c%200%2C4.929%204.01%2C8.938%208.938%2C8.938%20a%208.887%2C8.887%200%200%200%204.984%2C-1.522%20L%2019.568%2C22%20Z%20M%208.938%2C15.125%20A%206.194%2C6.194%200%200%201%202.75%2C8.937%206.195%2C6.195%200%200%201%208.938%2C2.749%206.195%2C6.195%200%200%201%2015.126%2C8.937%206.195%2C6.195%200%200%201%208.938%2C15.125%20Z%22%20id%3D%22path1%22%2F%3E%3C%2Fsvg%3E")
}
@media (prefers-color-scheme: dark) {
    :root {
        /* color-scheme: dark; */
        --bs-blue: #0d6efd;
        --bs-indigo: #6610f2;
        --bs-purple: #6f42c1;
        --bs-pink: #d63384;
        --bs-red: #dc3545;
        --bs-orange: #fd7e14;
        --bs-yellow: #ffc107;
        --bs-green: #198754;
        --bs-teal: #20c997;
        --bs-cyan: #0dcaf0;
        --bs-black: #000;
        --bs-white: #fff;
        --bs-gray: #6c757d;
        --bs-gray-dark: #343a40;
        --bs-gray-100: #f8f9fa;
        --bs-gray-200: #e9ecef;
        --bs-gray-300: #dee2e6;
        --bs-gray-400: #ced4da;
        --bs-gray-500: #adb5bd;
        --bs-gray-600: #6c757d;
        --bs-gray-700: #495057;
        --bs-gray-800: #343a40;
        --bs-gray-900: #212529;
        --bs-primary: #0d6efd;
        --bs-secondary: #6c757d;
        --bs-success: #198754;
        --bs-info: #0dcaf0;
        --bs-warning: #ffc107;
        --bs-danger: #dc3545;
        --bs-light: #f8f9fa;
        --bs-dark: #212529;
        --bs-primary-rgb: 13, 110, 253;
        --bs-secondary-rgb: 108, 117, 125;
        --bs-success-rgb: 25, 135, 84;
        --bs-info-rgb: 13, 202, 240;
        --bs-warning-rgb: 255, 193, 7;
        --bs-danger-rgb: 220, 53, 69;
        --bs-light-rgb: 248, 249, 250;
        --bs-dark-rgb: 33, 37, 41;
        --bs-primary-text-emphasis: #6ea8fe;
        --bs-secondary-text-emphasis: #a7acb1;
        --bs-success-text-emphasis: #75b798;
        --bs-info-text-emphasis: #6edff6;
        --bs-warning-text-emphasis: #ffda6a;
        --bs-danger-text-emphasis: #ea868f;
        --bs-light-text-emphasis: #f8f9fa;
        --bs-dark-text-emphasis: #dee2e6;
        --bs-primary-bg-subtle: #031633;
        --bs-secondary-bg-subtle: #161719;
        --bs-success-bg-subtle: #051b11;
        --bs-info-bg-subtle: #032830;
        --bs-warning-bg-subtle: #332701;
        --bs-danger-bg-subtle: #2c0b0e;
        --bs-light-bg-subtle: #343a40;
        --bs-dark-bg-subtle: #1a1d20;
        --bs-primary-border-subtle: #084298;
        --bs-secondary-border-subtle: #41464b;
        --bs-tertiary-border-subtle: #590898;
        --bs-success-border-subtle: #0f5132;
        --bs-info-border-subtle: #087990;
        --bs-warning-border-subtle: #997404;
        --bs-danger-border-subtle: #842029;
        --bs-light-border-subtle: #495057;
        --bs-dark-border-subtle: #343a40;
        --bs-white-rgb: 255, 255, 255;
        --bs-black-rgb: 0, 0, 0;
        --bs-font-sans-serif: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
        --bs-font-monospace: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
        --bs-gradient: linear-gradient(180deg,   rgba(255,   255,   255,   0.15),   rgba(255,   255,   255,   0));
        --bs-body-font-family: var(--bs-font-sans-serif);
        --bs-body-font-size: 1rem;
        --bs-body-font-weight: 400;
        --bs-body-line-height: 1.5;
        --bs-body-color: #dee2e6;
        --bs-body-color-rgb: 222, 226, 230;
        --bs-body-bg: #212529;
        --bs-body-bg-rgb: 33, 37, 41;
        --bs-emphasis-color: #fff;
        --bs-emphasis-color-rgb: 255, 255, 255;
        --bs-secondary-bg: #343a40;
        --bs-secondary-bg-rgb: 52, 58, 64;
        --bs-tertiary-color: rgba(222,   226,   230,   0.5);
        --bs-tertiary-color-rgb: 222, 226, 230;
        --bs-tertiary-bg: #2b3035;
        --bs-tertiary-bg-rgb: 43, 48, 53;
        --bs-heading-color: inherit;
        --bs-link-color: #6ea8fe;
        --bs-link-color-rgb: 110, 168, 254;
        --bs-link-decoration: underline;
        --bs-link-hover-color: #8bb9fe;
        --bs-link-hover-color-rgb: 139, 185, 254;
        --bs-code-color: #e685b5;
        --bs-highlight-color: #dee2e6;
        --bs-highlight-bg: #664d03;
        --bs-border-width: 1px;
        --bs-border-style: solid;
        --bs-border-color: #495057;
        --bs-border-color-translucent: rgba(255,   255,   255,   0.15);
        --bs-border-radius: 0.375rem;
        --bs-border-radius-s: 0.125rem;
        --bs-border-radius-sm: 0.25rem;
        --bs-border-radius-lg: 0.5rem;
        --bs-border-radius-xl: 1rem;
        --bs-border-radius-xxl: 2rem;
        --bs-border-radius-2xl: var(--bs-border-radius-xxl);
        --bs-border-radius-pill: 50rem;
        --bs-box-shadow: 0 0.5rem 1rem rgba(0,   0,   0,   0.15);
        --bs-box-shadow-sm: 0 0.125rem 0.25rem rgba(0,   0,   0,   0.075);
        --bs-box-shadow-lg: 0 1rem 3rem rgba(0,   0,   0,   0.175);
        --bs-box-shadow-inset: inset 0 1px 2px rgba(0,   0,   0,   0.075);
        --bs-focus-ring-width: 0.25rem;
        --bs-focus-ring-opacity: 0.25;
        --bs-focus-ring-color: rgba(13,   110,   253,   0.25);
        --bs-form-valid-color: #75b798;
        --bs-form-valid-border-color: #75b798;
        --bs-form-invalid-color: #ea868f;
        --bs-form-invalid-border-color: #ea868f;

        --svg-light-background: #e9ecef;

        --reset-button-filter: invert(1);
    }
}

:root {
    font-size: 22px;
}

body {
    font-family: sans-serif;
    margin-top: 0;
    background-color: var(--bs-body-bg);
    touch-action: manipulation;
    margin-bottom: 1em;
}

input, #header-input-mirror {
    background-color: var(--bs-body-bg);
    border-style: solid;
    border-radius: var(--bs-border-radius-s);
    border-color: var(--bs-gray-600);
    border-width: 2px;
}

.flexbox {
    display: flex;
}

.flexbox > div {
    flex: 1;
    text-align: center;
}

.flexbox-vertical {
    flex-direction: column;
}

.flexbox-horizontal {
    flex-direction: row;
    justify-content: space-around;
}

.flexbox-center {
    justify-content: center;
    align-items: center;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, 400px);
    justify-content: center;
    margin-bottom: 1em;
}

#radicals-selection, #components-selection {
    text-align: left;
}

.vertical-separator {
    border: 1px solid var(--bs-border-color);
    margin: var(--radicals-components-padding);
    width: 0;
}

#kanji-results {
    white-space: nowrap;
    overflow-x: scroll;
    line-height: 1.35;
    padding-bottom: 0.5em;
}

.no-select {
    user-select: none;
}

#skip-part-2 > input[type="number"],
#skip-part-3 > input[type="number"],
[id^=stroke-count-input] {
    width: 5em;
}

.stroke-count {
    background-color: var(--bs-gray-700);
    user-select: none;
    pointer-events: none;
}

.table-item {
    width: 1.5rem;
    height: 1.5rem;
    display: inline-block;
    text-align: center;
    align-content: center;
}

.table-item:not(.stroke-count), [id*=four-corners-], #skip-part-1 {
    cursor: pointer;
    transition: background-color var(--fast-fade), filter var(--fast-fade);
}

.table-item:hover:not(.selected):not(.clicked):not(.stroke-count) {
    background-color: var(--bs-gray-600);
}

.table-item.selected:hover {
    filter: saturate(150%);
}

.selected {
    background-color: var(--bs-tertiary-border-subtle);
}

.clicked {
    background-color: var(--bs-gray-700);
}

.disabled-item {
    filter: opacity(50%);
}

#sticky-header {
    position: sticky;
    top: 0;
    background-color: var(--bs-body-bg);
    z-index: 999;
}

#sticky-header > hr {
    margin-bottom: 0;
}

.header-input-item {
    font-size: 1.5rem;
    line-height: 1.25;
    flex-basis: 50%;
    margin-left: 10px;
    margin-right: 10px;
}

#header-input, #header-input-mirror {
    width: 100%;
    flex: 1;
    line-height: 1.45;
    padding-top: 0;
    padding-bottom: 0;
    margin-top: 2px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow-x: scroll;
    min-width: 300px;
    max-width: max(max(50vw, 50vh), 500px);
}

#header-search-flexbox {
    padding-top: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

#header-search-flexbox > div {
    align-items: center;
}

#reset-all-header {
    margin: 5px;
}

div.left-right-header {
    flex: 0;
    align-items: stretch;
    justify-content: space-between;
}

.hide-scrollbar::-webkit-scrollbar {
    display: none;
}
.hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

#partial-word-container > input {
    width: 2em;
}

.reset-button, .clear-text-button, .search-button, .fake-icon {
    border: 2px solid var(--bs-gray-700);
    width: 34px;
    height: 34px;
    display: inline-block;
    user-select: none;
    border-radius: 50%;
}

.reset-button > .icon,
.clear-text-button > .icon,
.search-button > .icon,
.fake-icon > .icon {
    filter: var(--reset-button-filter);
    width: var(--reset-button-size);
    height: var(--reset-button-size);
    background-size: var(--reset-button-size) var(--reset-button-size);
}

.fake-icon {
    visibility: hidden;
}

.reset-button > .icon {
    background-image: var(--reset-button-svg);
}

.clear-text-button > .icon {
    background-image: var(--clear-text-button-svg);
}

.search-button > .icon {
    background-image: var(--search-button-svg);
}

#reset-all, #clear-text, #jisho-search {
    flex-shrink: 0;
}

a {
    color: var(--bs-link-color);
    transition: color var(--fast-fade);
    text-decoration: var(--bs-link-decoration);
}
a:hover {
    color: var(--bs-link-hover-color);
}

.skip-icon {
    background-color: var(--svg-light-background);
    border: 1px solid var(--bs-border-color);
    pointer-events: none;
    user-select: none;
}

.four-corner-icon {
    background-color: var(--svg-light-background);
    border: 1px solid var(--bs-border-color);
    pointer-events: none;
    user-select: none;
    top: .25em;
    position: relative;
}

.icon {
    height: 1em;
    width: 1em;
}

.icon-wrapper {
    display: inline-flex;
    justify-content: center;
    align-items: center;
}

.documentation-text {
    max-width: max(max(50vw, 50vh), 500px);
}

code {
    background-color: var(--bs-gray-800);
}

@media (min-width: 600px) {
    .fake-icon {
        display: none;
    }
}
