:root {
    --rgbhex-stroke: #d3d3d3;
    --rgbhex-heading: #24292e;
    --rgbhex-muted: #757575;
    --rgbhex-preview: #182832;
}

.rgb-hex-tool {
    background: #fff;
    border: 1px solid var(--rgbhex-stroke);
    padding: 12px;
}

.rgb-hex-grid {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.rgb-hex-grid>* {
    flex: 1 0 0;
    min-width: 0;
}

.rgb-hex-preview-col {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.rgb-hex-preview {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 12px;
    min-height: 252px;
    padding: 24px;
    background: var(--rgbhex-preview);
}

.rgb-hex-copy {
    position: absolute;
    top: 20px;
    right: 20px;
    padding: 6px 12px;
    font-size: 14px;
    line-height: 20px;
    color: var(--rgbhex-heading);
    text-align: center;
    white-space: nowrap;
    background: #fff;
    border: 1px solid var(--rgbhex-stroke);
    border-radius: 6px;
    cursor: pointer;
}

.rgb-hex-preview-value {
    margin: 0;
    font-size: 64px;
    font-weight: 500;
    line-height: 72px;
    color: var(--preview-ink, #fff);
    word-break: break-word;
}

.rgb-hex-preview-meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    opacity: 0.9;
}

.rgb-hex-preview-meta span {
    font-size: 14px;
    line-height: 20px;
    color: var(--preview-ink, #fff);
}

/* Saturation / value field */
.rgb-hex-field {
    position: relative;
    height: 148px;
    cursor: crosshair;
    touch-action: none;
}

.rgb-hex-field-handle,
.rgb-hex-hue-handle {
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #8d8d8d;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

/* Hue strip */
.rgb-hex-hue {
    position: relative;
    height: 12px;
    cursor: pointer;
    touch-action: none;
    background: linear-gradient(90deg,
            #f00 0%,
            #ff0 16.667%,
            #0f0 33.333%,
            #0ff 50%,
            #00f 66.667%,
            #f0f 83.333%,
            #f00 100%);
}

.rgb-hex-hue-handle {
    top: 50%;
    background: #FFFAFA;
}

.rgb-hex-controls {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.rgb-hex-paste {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rgb-hex-label {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
    line-height: 24px;
    color: var(--rgbhex-heading);
}

.rgb-hex-input-wrap {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 12px 16px;
    background: #fff;
    border: 1px solid var(--rgbhex-stroke);
}

.rgb-hex-input {
    flex: 1 0 0;
    min-width: 0;
    padding: 0;
    font-size: 16px;
    line-height: 24px;
    color: var(--rgbhex-heading);
    background: transparent;
    border: 0;
    outline: none;
}

.rgb-hex-input-copy {
    position: relative;
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: none;
    border: 0;
    cursor: pointer;
}

/* Tooltip reads "Copy" on hover and swaps to "Copied!" once the value is on
   the clipboard; the JS restores the label after a moment. */
.rgb-hex-input-copy .copyToolTip {
    position: absolute;
    bottom: calc(100% + 6px);
    right: 0;
    display: none;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 400;
    line-height: 16px;
    color: var(--rgbhex-heading);
    white-space: nowrap;
    background-color: #f3f5f7;
    border: 1px solid var(--rgbhex-stroke);
    border-radius: 6px;
    pointer-events: none;
}

.rgb-hex-input-copy:hover .copyToolTip,
.rgb-hex-input-copy:focus-visible .copyToolTip,
.rgb-hex-input-copy .copyToolTip.is-visible {
    display: block;
}

.rgb-hex-conversion {
    margin: 0;
    font-size: 12px;
    font-weight: 500;
    line-height: 16px;
    color: var(--rgbhex-muted);
}

/* Sliders */
.rgb-hex-sliders {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.rgb-hex-slider-row {
    display: flex;
    gap: 20px;
    align-items: center;
}

.rgb-hex-slider-label {
    flex-shrink: 0;
    font-size: 16px;
    font-weight: 500;
    line-height: 24px;
    color: var(--rgbhex-heading);
}

.rgb-hex-range {
    flex: 1 0 0;
    min-width: 0;
    height: 20px;
    margin: 0;
    background: transparent;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

.rgb-hex-range::-webkit-slider-runnable-track {
    height: 12px;
    background: linear-gradient(90deg,
            rgba(var(--track-rgb), 0) 0%,
            rgb(var(--track-rgb)) 100%);
    border: 1px solid var(--rgbhex-stroke);
    border-radius: 0;
}

.rgb-hex-range::-moz-range-track {
    height: 12px;
    background: linear-gradient(90deg,
            rgba(var(--track-rgb), 0) 0%,
            rgb(var(--track-rgb)) 100%);
    border: 1px solid var(--rgbhex-stroke);
    border-radius: 0;
}

.rgb-hex-range[data-channel="red"] {
    --track-rgb: 220, 54, 54;
}

.rgb-hex-range[data-channel="green"] {
    --track-rgb: 33, 186, 69;
}

.rgb-hex-range[data-channel="blue"] {
    --track-rgb: 0, 123, 255;
}

.rgb-hex-range::-webkit-slider-thumb {
    width: 20px;
    height: 20px;
    /* centre the 23px thumb on the 14px bordered track */
    margin-top: -4.5px;
    background: #fffafa;
    border: 1.5px solid #8d8d8d;
    border-radius: 50%;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

.rgb-hex-range::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #fffafa;
    border: 1.5px solid #8d8d8d;
    border-radius: 50%;
    cursor: pointer;
}

.rgb-hex-number {
    flex-shrink: 0;
    width: 80px;
    padding: 8px 4px;
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
    color: var(--rgbhex-heading);
    text-align: center;
    background: #fff;
    border: 1px solid var(--rgbhex-stroke);
    outline: none;
    -moz-appearance: textfield;
    appearance: textfield;
}

.rgb-hex-number::-webkit-outer-spin-button,
.rgb-hex-number::-webkit-inner-spin-button {
    margin: 0;
    -webkit-appearance: none;
    appearance: none;
}

/* Options */
.rgb-hex-options {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}

.rgb-hex-option {
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: 14px;
    line-height: 20px;
    color: var(--rgbhex-heading);
    cursor: pointer;
}

.rgb-hex-option input {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: #007bff;
    cursor: pointer;
}

.rgb-hex-clear {
    align-self: flex-start;
    padding: 6px 12px;
    font-size: 14px;
    line-height: 20px;
    color: var(--rgbhex-heading);
    background: #fff;
    border: 1px solid var(--rgbhex-stroke);
    border-radius: 6px;
    cursor: pointer;
}

p img {
    width: 100%;
}

.js-feedback {
    cursor: auto !important;
}

@media (max-width: 991px) {
    .rgb-hex-grid {
        flex-direction: column;
    }

    .rgb-hex-grid>* {
        width: 100%;
        flex: none;
    }

    .rgb-hex-preview-value {
        font-size: 48px;
        line-height: 56px;
    }
}

@media (max-width: 575px) {
    .rgb-hex-preview-value {
        font-size: 36px;
        line-height: 44px;
    }

    .rgb-hex-preview {
        min-height: 200px;
        padding: 16px;
    }

    .rgb-hex-copy {
        top: 12px;
        right: 12px;
    }

    .rgb-hex-slider-row {
        gap: 12px;
    }

    .rgb-hex-number {
        width: 64px;
    }
}

.rgb-hex-page .panel.content .container:first-of-type > div {
    max-width: 1160px;
}

.rgb-hex-page .panel.content h1.nav-title {
    margin: 12px 0;
    font-size: 22px;
    font-weight: 700;
    line-height: normal;
    color: var(--rgbhex-heading);
}

.rgb-hex-page .panel.content .container:first-of-type > div p {
    margin: 0 0 16px;
    font-size: 16px;
    line-height: 28px;
    color: var(--rgbhex-heading);
    max-width: 900px;
}

.rgb-hex-page .panel.content .container:first-of-type > div p:last-child {
    margin-bottom: 0;
}

.rgb-hex-page .panel.content .container:first-of-type > div :is(h2, h3) {
    margin: 24px 0 0;
    font-size: 20px;
    font-weight: 700;
    line-height: 25px;
    color: var(--rgbhex-heading);
}

.rgb-hex-page .panel.content .container:first-of-type > div :is(h2, h3)+p {
    margin-top: 16px;
}

.rgb-hex-page .panel.content .container:first-of-type > div p>strong:only-child,
.rgb-hex-page .panel.content .container:first-of-type > div p>b:only-child {
    display: block;
    font-size: 16px;
    font-weight: 700;
    line-height: 28px;
}

.rgb-hex-page .panel.content .container:first-of-type > div a {
    color: #00e;
    text-decoration: underline;
}

/* Lists */
.rgb-hex-page .panel.content .container:first-of-type > div :is(ul, ol) {
    margin: 0 0 16px;
    padding-left: 24px;
    max-width: 900px;
}

.rgb-hex-page .panel.content .container:first-of-type > div :is(ul, ol) li {
    font-size: 16px;
    line-height: 28px;
    color: var(--rgbhex-heading);
}

.rgb-hex-page .panel.content .container:first-of-type > div table {
    width: 100%;
    max-width: 1160px;
    margin: 24px 0 16px;
    background: #fff;
    border: 1px solid var(--rgbhex-stroke);
    border-collapse: collapse;
    table-layout: auto;
}

.rgb-hex-page .panel.content .container:first-of-type > div table :is(th, td) {
    padding: 10px 14px;
    font-size: 16px;
    line-height: 28px;
    color: var(--rgbhex-heading);
    text-align: left;
    vertical-align: middle;
    border: 1px solid var(--rgbhex-stroke);
}

.rgb-hex-page .panel.content .container:first-of-type > div table :is(thead th, thead td),
.rgb-hex-page .panel.content .container:first-of-type > div table tr:first-child :is(th, td) {
    font-weight: 700;
    color: #333;
}

.rgb-hex-page .panel.content .container:first-of-type > div table td:first-child {
    white-space: nowrap;
}

.rgb-hex-page .panel.content .container:first-of-type > div table [data-rgb] {
    display: inline-flex;
    gap: 10px;
    align-items: center;
    font-size: 15px;
    font-weight: 500;
    line-height: 22.5px;
    color: var(--rgbhex-heading);
    cursor: pointer;
}

.rgb-hex-page .panel.content .container:first-of-type > div table [data-rgb]::before {
    content: "";
    display: inline-block;
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    background: var(--swatch, transparent);
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 6px;
}
.tool-img{
    width: 100%;
    max-width: 868px;
    height: auto;
}

@media (max-width: 767px) {
    .rgb-hex-page .panel.content .container:first-of-type > div table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .rgb-hex-page .panel.content .container:first-of-type > div :is(h2, h3) {
        font-size: 18px;
        line-height: 24px;
    }
}
