.tool-form-color-tool .tool-header-split {
    margin-bottom: 1rem;
}

.tool-form-color-tool {
    max-width: none;
}

.color-tool-body {
    max-width: 960px;
    margin-left: auto;
    margin-right: auto;
}

.color-tool-panel {
    background: #fafafa;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.color-tool-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 0.75rem;
}

.color-tool-row:last-child {
    margin-bottom: 0;
}

.color-tool-input {
    flex: 1;
    min-width: 200px;
}

.color-preview-box {
    width: 48px;
    height: 48px;
    border-radius: 6px;
    border: 1px solid #ddd;
    flex-shrink: 0;
    background: #fff;
}

.color-preview-box--lg {
    width: 64px;
    height: 64px;
}

.color-result-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    overflow: hidden;
    font-size: 0.8125rem;
}

.color-result-table th,
.color-result-table td {
    padding: 0.55rem 0.75rem;
    border-bottom: 1px solid #f0f0f0;
    text-align: left;
    vertical-align: middle;
}

.color-result-table th {
    background: #f5f5f5;
    font-weight: 500;
    color: #666;
}

.color-result-table tr:last-child td {
    border-bottom: none;
}

.color-result-table td:last-child,
.color-result-table th:last-child {
    width: 72px;
    text-align: center;
}

.color-result-table td:nth-child(2),
.color-result-table th:nth-child(2) {
    width: 100px;
    white-space: nowrap;
}

.color-result-table td:nth-child(1),
.color-result-table th:nth-child(1) {
    width: 72px;
}

.color-conv-value {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    word-break: break-all;
    cursor: pointer;
}

.color-conv-value:hover {
    color: #4f6ef2;
}

.color-result-grid {
    display: grid;
    grid-template-columns: 72px 100px 1fr 72px;
    gap: 0;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    overflow: hidden;
    font-size: 0.8125rem;
}

.color-result-grid__head,
.color-result-grid__row {
    display: contents;
}

.color-result-grid__head > span {
    background: #f5f5f5;
    padding: 0.55rem 0.75rem;
    font-weight: 500;
    color: #666;
    border-bottom: 1px solid #e8e8e8;
}

.color-result-grid__row > span {
    padding: 0.55rem 0.75rem;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
}

.color-result-grid__row:last-child > span {
    border-bottom: none;
}

.color-result-grid__preview {
    width: 36px;
    height: 24px;
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.color-copy-btn {
    padding: 0.15rem 0.45rem;
    font-size: 0.75rem;
    line-height: 1.4;
    cursor: pointer;
}

.color-name-table {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
    margin-top: 0.75rem;
}

.color-name-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border: 1px solid #eee;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.75rem;
    color: #666;
    background: #fff;
}

.color-name-item:hover {
    border-color: #ccc;
    background: #fafafa;
}

.color-name-item__swatch {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    flex-shrink: 0;
}

.color-picker-canvas-wrap {
    position: relative;
    display: inline-block;
    max-width: 100%;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    overflow: hidden;
    background: repeating-conic-gradient(#eee 0% 25%, #fff 0% 50%) 50% / 16px 16px;
    cursor: crosshair;
}

.color-picker-canvas-wrap canvas {
    display: block;
    max-width: 100%;
    height: auto;
}

.color-picker-info {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 1rem;
}

.color-picker-info__value {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.875rem;
    color: #333;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    background: #f5f5f5;
}

.color-picker-info__value:hover {
    background: #eee;
}

.color-blend-main {
    display: flex;
    align-items: stretch;
    gap: 8px;
    width: 100%;
}

.color-blend-inputs-col {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.color-blend-result-col {
    flex: 0 0 336px;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.color-blend-layout {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    gap: 0;
    margin-bottom: 0;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.color-blend-card {
    flex: 1;
    min-width: 0;
    padding: 10px 12px;
    background: #fff;
    border: none;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.color-blend-card:last-child {
    border-bottom: none;
}

.tool-form-color-blend .color-tool-body {
    max-width: 960px;
}

.tool-form-color-blend .tool-header-split {
    margin-bottom: 0.75rem;
}

.color-blend-card__title {
    margin: 0 0 10px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #666;
}

.color-blend-card__body {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.color-blend-picker {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    margin: 0;
    padding: 0;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    background: none;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
    overflow: hidden;
}

.color-blend-picker::-webkit-color-swatch-wrapper {
    padding: 0;
    border: none;
    border-radius: 5px;
}

.color-blend-picker::-webkit-color-swatch {
    border: none;
    border-radius: 5px;
}

.color-blend-picker::-moz-color-swatch {
    border: none;
    border-radius: 5px;
}

.color-blend-fields {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.color-blend-field {
    display: grid;
    grid-template-columns: 36px 1fr;
    gap: 8px;
    align-items: center;
}

.color-blend-field-label {
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 500;
    color: #888;
    text-align: center;
}

.color-blend-hex {
    width: 100%;
    min-width: 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.8125rem;
}

.color-blend-rgb-inputs {
    display: flex;
    gap: 6px;
    min-width: 0;
}

.color-blend-rgb-inputs .color-blend-num {
    flex: 1;
    min-width: 0;
}

.color-blend-num {
    font-size: 0.8125rem;
    padding-left: 0.4rem;
    padding-right: 0.4rem;
}

.color-blend-result-col .screen-picker-card.color-blend-result-card {
    flex: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.color-blend-result-card {
    margin-bottom: 0;
}

.color-blend-result-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 10px 0;
    min-height: 0;
    gap: 0;
}

.color-blend-result-head {
    padding: 8px 12px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #666;
    background: #fafafa;
    border-bottom: 1px solid #f0f0f0;
}

.color-blend-result-table .screen-picker-preview-cell {
    width: 88px;
    padding: 10px 8px;
    text-align: center;
    vertical-align: middle;
    border: none;
    background: #fff;
    box-sizing: border-box;
}

.color-blend-result-table .screen-picker-preview {
    width: 56px;
    height: 56px;
    margin: 0 auto;
}

.color-blend-result-table .screen-picker-format-cell {
    width: 48px;
    max-width: 48px;
    min-width: 48px;
    padding: 0.5rem 0.4rem;
    font-size: 0.8125rem;
    box-sizing: border-box;
    background: transparent;
    color: #888;
    border: none;
}

.color-blend-result-table .screen-picker-copyable__text {
    overflow: visible;
    text-overflow: clip;
    white-space: nowrap;
}

.screen-picker-format-cell {
    width: 56px;
    padding: 0.55rem 0.75rem;
    color: #888;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
    background: #fafafa;
    border-right: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
    font-size: 0.8125rem;
}

.color-blend-result-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    font-size: 0.8125rem;
}

.color-blend-result-table .screen-picker-col-preview {
    width: 88px;
}

.color-blend-result-table .screen-picker-col-format {
    width: 48px;
}

.color-blend-result-table td:last-child {
    padding: 0;
    border: none;
    vertical-align: middle;
}

.color-blend-result-table tr:last-child td:last-child,
.color-blend-result-table tr:last-child .screen-picker-format-cell {
    border-bottom: none;
}

.color-blend-result-tip {
    margin: 20px 0 0;
    padding: 0 12px;
    font-size: 0.75rem;
    color: #999;
    line-height: 1.45;
    text-align: center;
    flex-shrink: 0;
}

.color-blend-gradient-wrap {
    width: 100%;
    margin-top: 12px;
}

.color-blend-gradient-title {
    margin: 0 0 8px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #666;
}

.color-blend-palette {
    display: flex;
    width: 100%;
    height: 40px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #e8e8e8;
    box-sizing: border-box;
}

.color-blend-palette__step {
    flex: 1;
}

@media (max-width: 768px) {
    .color-blend-main {
        flex-direction: column;
    }

    .color-blend-result-col {
        flex: 1 1 auto;
        width: 100%;
    }
}

.color-tool-tip {
    font-size: 0.8125rem;
    color: #999;
    margin-top: 0.5rem;
}

.color-tool-tip.is-error {
    color: #d9534f;
}

/* color tools subnav */
.color-tools-subnav {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    border-bottom: 1px solid #e8e8e8;
    margin-bottom: 1rem;
}

.color-tools-subnav a {
    display: inline-block;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    color: #666;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.color-tools-subnav a:hover {
    color: #4f6ef2;
}

.color-tools-subnav a.is-active {
    color: #4f6ef2;
    border-bottom-color: #4f6ef2;
    font-weight: 500;
}

/* color picker tools (screen / image) */
.tool-form-screen-picker,
.tool-form-image-picker {
    --screen-picker-col-left: 88px;
    --screen-picker-swatch: 56px;
}

.tool-form-screen-picker .color-tool-body {
    max-width: 480px;
}

.tool-form-image-picker .color-tool-body {
    max-width: 560px;
}

.tool-form-screen-picker .tool-header-split,
.tool-form-image-picker .tool-header-split {
    margin-bottom: 0.75rem;
}

.tool-form-image-picker {
    --screen-picker-col-left: 88px;
    --screen-picker-swatch: 48px;
}

.tool-form-image-picker .img-picker-swatches {
    flex-direction: column;
    gap: 10px;
    padding: 12px 8px;
}

.tool-form-image-picker .img-picker-swatch-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.img-picker-swatch-label {
    font-size: 0.6875rem;
    color: #aaa;
    line-height: 1;
    user-select: none;
}

.img-picker-canvas-wrap {
    display: block;
    width: 100%;
    margin-top: 12px;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    overflow: hidden;
    background: repeating-conic-gradient(#eee 0% 25%, #fff 0% 50%) 50% / 16px 16px;
    cursor: crosshair;
}

.img-picker-canvas-wrap[hidden] {
    display: none !important;
}

.img-picker-canvas-wrap canvas {
    display: block;
    width: 100%;
    height: auto;
}

.screen-picker-card {
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.screen-picker-grid {
    display: grid;
    grid-template-columns: var(--screen-picker-col-left) 1fr;
}

.screen-picker-grid .screen-picker-preview-cell {
    grid-column: 1;
    grid-row: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 10px;
    border-right: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
    background: #fff;
    box-sizing: border-box;
}

.screen-picker-preview {
    width: var(--screen-picker-swatch);
    height: var(--screen-picker-swatch);
    flex-shrink: 0;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.15s ease, border-color 0.15s ease;
    box-sizing: border-box;
}

.screen-picker-preview.is-empty {
    background: #fff;
}

.screen-picker-preview__placeholder {
    font-size: 0.875rem;
    color: #ddd;
    user-select: none;
    line-height: 1;
}

.screen-picker-grid .screen-picker-actions {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    padding: 14px 16px;
    background: #fafafa;
    border-bottom: 1px solid #f0f0f0;
    box-sizing: border-box;
}

.screen-picker-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: flex-start;
    min-width: 108px;
    height: 2rem;
    padding: 0 0.85rem;
    margin: 0;
    font-size: 0.875rem;
    line-height: 1;
    box-sizing: border-box;
    cursor: pointer;
    vertical-align: middle;
}

.screen-picker-tip {
    margin: 0;
    font-size: 0.75rem;
    color: #999;
    line-height: 1.45;
}

.screen-picker-tip.is-error {
    color: #d9534f;
}

.screen-picker-grid .screen-picker-result-label {
    grid-column: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    box-sizing: border-box;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #888;
    text-align: center;
    background: #fafafa;
    border-right: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
}

.screen-picker-grid .screen-picker-result-label:last-of-type {
    border-bottom: none;
}

.screen-picker-grid .screen-picker-copyable {
    grid-column: 2;
    display: flex;
    align-items: center;
    min-height: 40px;
    padding: 0 12px;
    border: none;
    border-bottom: 1px solid #f0f0f0;
    background: #fff;
    cursor: pointer;
    text-align: left;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.8125rem;
    color: #333;
    transition: background 0.15s ease, color 0.15s ease;
    box-sizing: border-box;
}

.color-blend-result-table .screen-picker-copyable {
    grid-column: auto;
    display: flex;
    align-items: center;
    min-height: 40px;
    padding: 0 10px;
    border: none;
    background: #fff;
    cursor: pointer;
    text-align: left;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.8125rem;
    color: #333;
    transition: background 0.15s ease, color 0.15s ease;
    box-sizing: border-box;
    width: 100%;
}

.screen-picker-grid .screen-picker-copyable:last-of-type {
    border-bottom: none;
}

.screen-picker-copyable:not(:disabled):hover {
    background: #f5f7ff;
    color: #4f6ef2;
}

.screen-picker-copyable.is-empty,
.screen-picker-copyable:disabled {
    cursor: default;
    color: #ccc;
}

.screen-picker-copyable__text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tool-info-color-picker {
    margin-top: 1.5rem;
}

.tool-info-color-picker h3 {
    margin-top: 0 !important;
    margin-bottom: 0.65rem !important;
    font-size: 0.9375rem !important;
    color: #555 !important;
}

.tool-info-color-picker ul {
    margin: 0;
    padding: 0.7rem 1rem 0.7rem 1.1rem;
    background: #fafafa;
    border: 1px solid #eee;
    border-radius: 6px;
    border-left: 3px solid #4f6ef2;
}

.tool-info-color-picker ul li {
    padding: 0.28rem 0;
    font-size: 0.8125rem;
    line-height: 1.6;
    color: #666;
}

.tool-info-color-picker ul li::before {
    background: #4f6ef2;
}

.tool-info-color-picker .color-tool-info-note {
    margin: 0.65rem 0 0;
    padding: 0;
    font-size: 0.8125rem;
    line-height: 1.6;
    color: #999;
}

/* color conversion (jsongj-style) */
.color-conv-toolbar {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 0.5rem;
}

.color-conv-input-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
    max-width: 420px;
}

.color-conv-input-label {
    font-size: 0.875rem;
    color: #666;
    white-space: nowrap;
}

.color-conv-input {
    flex: 1;
    width: auto;
    min-width: 0;
}

.color-conv-examples-side {
    flex: 0 1 auto;
    margin-left: auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.color-conv-examples-tip {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #565656;
    white-space: nowrap;
}

.color-conv-examples {
    display: contents;
}

.color-conv-tip {
    min-height: 1.2em;
    margin: 0 0 0.75rem;
    text-align: left;
}

.color-conv-example-tag {
    border: none;
    border-radius: 3px;
    font-size: 12px;
    height: 32px;
    line-height: 32px;
    padding: 0 12px;
    cursor: pointer;
    white-space: nowrap;
}

.color-conv-example-tag:hover {
    opacity: 0.92;
}

.color-conv-result-table,
.color-conv-catalog-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    border: 1px solid #e8e8e8;
    font-size: 0.8125rem;
    margin-bottom: 1rem;
}

.color-conv-col-preview {
    width: 72px;
}

.color-conv-col-format {
    width: 88px;
}

.color-conv-col-name {
    width: 160px;
}

.color-conv-col-hex {
    width: 96px;
}

.color-conv-col-rgb {
    width: 180px;
}

.color-conv-col-hsl {
    width: auto;
}

.color-conv-result-table th,
.color-conv-result-table td,
.color-conv-catalog-table th,
.color-conv-catalog-table td {
    padding: 0.55rem 0.75rem;
    border: 1px solid #f0f0f0;
    text-align: left;
    vertical-align: middle;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.color-conv-catalog-table td:nth-child(3),
.color-conv-catalog-table td:nth-child(4),
.color-conv-catalog-table td:nth-child(5),
.color-conv-result-table td:nth-child(3) {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.75rem;
}

.color-conv-result-table thead th,
.color-conv-catalog-table thead th {
    background: #f5f5f5;
    font-weight: 500;
    color: #666;
}

.color-conv-preview-cell,
.color-conv-catalog-preview {
    padding: 0 !important;
}

.color-conv-result-table td:nth-child(2),
.color-conv-result-table th:nth-child(2) {
    white-space: nowrap;
}

.color-conv-value {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    word-break: break-all;
    white-space: normal;
    cursor: pointer;
    display: block;
}

.color-conv-value:hover {
    color: #4f6ef2;
}

.color-conv-catalog-title {
    margin: 1.25rem 0 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    text-transform: capitalize;
}

.color-conv-catalog-table tbody tr:hover {
    background: #fafafa;
}

@media (max-width: 640px) {
    .color-conv-toolbar {
        flex-direction: column;
        gap: 12px;
    }

    .color-conv-input {
        width: 100%;
        flex: 1;
    }

    .color-conv-input-group {
        width: 100%;
    }
}
