/*
    MerchStudio version 0.01 - Core File
    Copyright (c) 2026 MerchStudio Inc.
    Image Tools: the Knockout window and Tools > Knockout page (MERCH_KO1).
    Uses the theme variables, so it follows light and dark mode.
    @version     tpl/core/common/css/image_tools.css - ki12 - 10-19-2026 - merchstudio (MERCH_KI12)
*/

body.mit_open { overflow: hidden; }

/* hidden must win over the flex rows below */
.mit_overlay [hidden] { display: none !important; }

.mit_overlay {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.6);
}

.mit_modal {
    display: flex;
    flex-direction: column;
    width: min(1280px, 100%);
    height: min(860px, 100%);
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 20px 60px var(--shadow, rgba(0, 0, 0, 0.4));
    overflow: hidden;
}

.mit_head,
.mit_foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--line);
}

.mit_foot {
    border-top: 1px solid var(--line);
    border-bottom: 0;
    flex-wrap: wrap;
}

.mit_title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 1.1rem;
    min-width: 0;
}

.mit_title .mit_file {
    font-weight: 400;
    color: var(--subtle);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mit_icon_btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: transparent;
    color: var(--text);
    cursor: pointer;
}

.mit_icon_btn:hover { background: var(--hover); }

.mit_body {
    display: flex;
    flex: 1;
    min-height: 0;
}

.mit_stage_col {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    padding: 12px;
    gap: 10px;
}

/* --- stage and preview backgrounds --- */
.mit_stage {
    --mit_shirt: #000000;
    position: relative;
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    touch-action: none;
}

.mit_stage.bg_shirt,
.mit_stage.bg_shirt .mit_loupe { background: var(--mit_shirt); }

.mit_stage.bg_transparent,
.mit_stage.bg_transparent .mit_loupe {
    background-color: #ffffff;
    background-image:
        linear-gradient(45deg, #cfcfcf 25%, transparent 25%),
        linear-gradient(-45deg, #cfcfcf 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #cfcfcf 75%),
        linear-gradient(-45deg, transparent 75%, #cfcfcf 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0;
}

.mit_stage.picking { cursor: crosshair; }

.mit_canvas {
    max-width: 100%;
    max-height: 100%;
    image-rendering: auto;
}

.mit_stage_msg {
    position: absolute;
    padding: 10px 14px;
    border-radius: 8px;
    background: var(--base);
    color: var(--text);
}

.mit_loupe_box {
    position: absolute;
    right: 10px;
    top: 10px;
    padding: 4px;
    background: var(--base);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
    pointer-events: none;
}

.mit_loupe {
    display: block;
    width: 220px;
    height: 220px;
    image-rendering: pixelated;
}

.mit_loupe_lbl {
    display: block;
    font-size: 0.75rem;
    color: var(--subtle);
    text-align: center;
    padding-top: 2px;
}

.mit_stagebar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

/* --- segmented buttons and chips --- */
.mit_seg {
    display: inline-flex;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
}

.mit_seg button {
    min-height: 40px;
    padding: 0 14px;
    border: 0;
    border-right: 1px solid var(--line);
    background: transparent;
    color: var(--text);
    cursor: pointer;
    font: inherit;
}

.mit_seg button:last-child { border-right: 0; }

.mit_seg button:hover { background: var(--hover); }

.mit_seg button.on,
.mit_seg button.on:hover {
    background: var(--accent);
    color: var(--mit_on_accent, #ffffff);
}

.mit_modes { display: flex; width: 100%; }
.mit_modes button { flex: 1; }

.mit_chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 40px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    font: inherit;
}

.mit_chip:hover { background: var(--hover); }

.mit_chip.on,
.mit_chip.on:hover {
    border-color: var(--accent);
    background: var(--accent);
    color: var(--mit_on_accent, #ffffff);
}

.mit_chip:disabled { opacity: 0.5; cursor: default; }

/* --- control panel --- */
.mit_panel {
    width: 340px;
    flex: none;
    overflow-y: auto;
    padding: 12px 16px;
    border-left: 1px solid var(--line);
    background: var(--base);
}

.mit_group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}

.mit_group:first-child { padding-top: 0; }

.mit_row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mit_row > label { min-width: 0; }

.mit_slider {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
}

.mit_lbl {
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.mit_val {
    color: var(--subtle);
    font-variant-numeric: tabular-nums;
}

.mit_slider input[type="range"] {
    width: 100%;
    accent-color: var(--accent);
    min-height: 28px;
}

.mit_check input { width: 20px; height: 20px; accent-color: var(--accent); }

.mit_row input[type="color"] {
    width: 44px;
    height: 36px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: transparent;
}

.mit_custom > label { min-width: 60px; }

.mit_size .mit_num {
    width: 86px;
    min-height: 36px;
    padding: 4px 8px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--bg);
    color: var(--text);
    font: inherit;
}

.mit_size > label { flex: 1; }

.mit_warn {
    margin: 0;
    padding: 8px 10px;
    border-left: 3px solid var(--accent_red, #d33);
    background: var(--info_bg, transparent);
    font-size: 0.9rem;
}

.mit_hint {
    margin: 8px 0 0;
    color: var(--subtle);
    font-size: 0.85rem;
}

.mit_adv { padding: 12px 0; }

.mit_adv summary {
    cursor: pointer;
    font-weight: 700;
    min-height: 44px;
    display: flex;
    align-items: center;
}

.mit_adv[open] > .mit_row { margin-top: 10px; }

/* --- footer --- */
.mit_foot_info {
    flex: 1;
    min-width: 200px;
}

.mit_status { color: var(--subtle); font-size: 0.9rem; }
.mit_status.mit_err { color: var(--accent_red, #d33); }

.mit_bar {
    height: 6px;
    margin-top: 6px;
    border-radius: 3px;
    background: var(--line);
    overflow: hidden;
}

.mit_bar i {
    display: block;
    height: 100%;
    width: 0;
    background: var(--accent);
    transition: width 0.2s ease;
}

.mit_foot_btns {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.mit_foot_btns .merch_button {
    display: inline-flex;
    white-space: nowrap;
    align-items: center;
    gap: 6px;
    min-height: 40px;
}

.mit_primary:disabled { opacity: 0.5; cursor: default; }

/* --- Tools > Knockout page --- */
.mit_drop {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 220px;
    padding: 24px;
    border: 2px dashed var(--line);
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
}

.mit_drop.over { border-color: var(--accent); }
.mit_drop .merch_icon { width: 40px; height: 40px; }

/* --- phones and small tablets: full-height sheet --- */
@media (max-width: 767px) {
    .mit_overlay { padding: 0; align-items: stretch; }
    .mit_modal { width: 100%; height: 100%; border-radius: 0; border: 0; }
    .mit_body { flex-direction: column; overflow-y: auto; }
    .mit_stage_col { flex: none; padding: 10px; }
    .mit_stage { flex: none; height: 52vh; }
    .mit_panel { width: auto; border-left: 0; border-top: 1px solid var(--line); overflow: visible; }
    .mit_loupe { width: 150px; height: 150px; }
    .mit_foot { padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
    .mit_foot_btns { width: 100%; }
    .mit_foot_btns .merch_button { flex: 1; justify-content: center; }
}

/* MERCH_KO2: the window outside the admin (gang sheet builder) has no
   admin button or icon styles, so it carries its own. */
.mit_overlay .merch_icon { width: 20px; height: 20px; fill: currentColor; flex: none; }
.mit_overlay .merch_icon.small { width: 18px; height: 18px; }
/* MERCH_KO3: the window sets its own button colours so they read in every
   theme. Plain buttons: theme text on the window background. Main button:
   the accent, with black or white text picked by image_tools.js. */
.mit_overlay button.merch_button,
.mit_overlay button.merch_button:focus {
    margin: 0;
    min-width: 0;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}
.mit_overlay button.merch_button:hover,
.mit_overlay button.merch_button:active {
    background: var(--hover);
    border-color: var(--line);
    color: var(--text);
}
.mit_overlay button.merch_button.mit_primary,
.mit_overlay button.merch_button.mit_primary:focus,
.mit_overlay button.merch_button.mit_primary:hover,
.mit_overlay button.merch_button.mit_primary:active,
.mit_overlay button.merch_button.mit_primary:disabled {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--mit_on_accent, #ffffff);
}
.mit_overlay button.merch_button.mit_primary:hover { filter: brightness(1.1); }
.mit_overlay button.merch_button:disabled,
.mit_overlay button.merch_button:disabled:hover { background: transparent; filter: none; }
.mit_overlay button.merch_button.mit_primary:disabled { filter: none; }
.mit_overlay button:focus-visible,
.mit_overlay summary:focus-visible {
    outline: 2px solid var(--text);
    outline-offset: 2px;
    box-shadow: none;
}
.mit_mode_hint { margin: 0; }
@media (max-width: 767px) {
    .mit_overlay .mit_foot_btns { gap: 6px; }
    .mit_overlay .mit_foot_btns button.merch_button { flex: 1 1 auto; padding: 0 8px; min-width: 0; }
}
/* MERCH_KO3: secondary text in the theme text colour, softened, so it reads
   in every theme (some themes set a pale "subtle" colour). */
.mit_overlay .mit_title .mit_file,
.mit_overlay .mit_loupe_lbl,
.mit_overlay .mit_val,
.mit_overlay .mit_hint,
.mit_overlay .mit_status {
    color: var(--text);
    opacity: 0.8;
}
.mit_overlay .mit_status.mit_err { color: var(--accent_red, #d33); opacity: 1; }

/* MERCH_KO2: gang sheet image cards */
/* MERCH_NLI6: a red dot (the button sits in a group that clips outlines) */
.upload_thumb .btn_knockout.ko_stale {
    position: relative;
}
.upload_thumb .btn_knockout.ko_stale::after {
    content: '';
    position: absolute;
    top: 4px;
    right: 4px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent_red, #e74c3c);
}
.upload_thumb .thumb_ko {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.upload_thumb .thumb_ko_badge {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text);
    border: 1px solid var(--accent);
    background: transparent;
}
.upload_thumb .btn_ko_restore {
    padding: 2px 6px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 0.7rem;
    cursor: pointer;
}
/* MERCH_NLI1: a short explanation under a slider */
.mit_overlay .mit_slider_hint { margin: 2px 0 0; font-size: 0.8rem; line-height: 1.35; }
/* MERCH_NLI2: presets and the before/after split */
.mit_presets { display: flex; flex-wrap: wrap; gap: 6px; }
.mit_presets .mit_chip { min-height: 40px; padding: 0 10px; }
.mit_stagebtns { display: flex; gap: 8px; flex-wrap: wrap; }
.mit_split {
    position: absolute;
    width: 0;
    border-left: 2px solid #ffffff;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.55);
    pointer-events: none;
    z-index: 2;
}
.mit_split_tag {
    position: absolute;
    top: 8px;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.7);
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
}
.mit_split_before { right: 8px; }
.mit_split_after { left: 8px; }
.mit_split_knob {
    position: absolute;
    top: 50%;
    left: -12px;
    width: 22px;
    height: 22px;
    margin-top: -11px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
}
/* MERCH_NLI5: Knockout and Restore on a design in Manage Job */
.component_thumb .pq_ko { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 6px; }
.component_thumb .pq_ko .merch_button { margin: 0; min-width: 0; display: inline-flex; align-items: center; gap: 4px; }
.component_thumb .pq_ko_badge { padding: 2px 6px; border: 1px solid var(--accent); border-radius: 4px; font-size: 0.7rem; font-weight: 700; color: var(--text); }
/* MERCH_NLI6: "Loading Knockout Tool..." over the page, above the window */
.mit_loading {
    position: fixed;
    inset: 0;
    z-index: 10060;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.45);
    padding: 16px;
}
.mit_loading_box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    max-width: 320px;
    padding: 20px 26px;
    border: 1px solid var(--line, #42434a);
    border-radius: 12px;
    background: var(--bg, #11121a);
    color: var(--text, #dddddd);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
    text-align: center;
}
.mit_loading_box b {
    font-size: 0.95rem;
}
.mit_loading_box small {
    margin-top: -6px;
    font-size: 0.8rem;
    opacity: 0.7;
    overflow-wrap: anywhere;
}
.mit_loading .mit_spin {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 3px solid color-mix(in srgb, var(--accent, #c9a227) 25%, transparent);
    border-top-color: var(--accent, #c9a227);
    animation: mit_spin 0.9s linear infinite;
}
@keyframes mit_spin {
    to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
    .mit_loading .mit_spin { animation-duration: 2.4s; }
}
/* MERCH_KI1: undo and redo in the header */
.mit_head_btns { display: flex; align-items: center; gap: 8px; }
.mit_overlay .mit_icon_btn:disabled { opacity: 0.4; cursor: default; }
.mit_overlay .mit_icon_btn:disabled:hover { background: transparent; }
.mit_modal:focus { outline: none; }

/* MERCH_KI1: the canvas scroller; centred with auto margins so a print
   bigger than the stage can still scroll to every edge */
.mit_scroll {
    position: absolute;
    inset: 0;
    display: flex;
    overflow: hidden;
}
.mit_scroll .mit_canvas { margin: auto; }
.mit_stage.mit_arm { touch-action: pan-x pan-y; }
.mit_stage.mit_arm .mit_scroll { overflow: auto; overscroll-behavior: contain; touch-action: pan-x pan-y; }
.mit_stage.mit_arm .mit_canvas { max-width: none; max-height: none; flex: none; }

/* MERCH_KI1: "Original" while Space is held */
.mit_compare_tag {
    position: absolute;
    left: 10px;
    top: 10px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.72);
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 700;
    pointer-events: none;
}
.mit_overlay .mit_kbd_hint { margin: 6px 2px 0; font-size: 0.8rem; }
@media (hover: none) {
    .mit_overlay .mit_kbd_hint { display: none; }
}

/* MERCH_KI1: Knockout all progress */
.mit_progress_box { width: min(340px, 100%); align-items: stretch; }
.mit_progress_box .mit_bar { margin: 0; height: 8px; border-radius: 4px; background: var(--line, #42434a); overflow: hidden; }
.mit_progress_box .mit_bar i { display: block; height: 100%; width: 0; background: var(--accent, #c9a227); transition: width 0.25s ease; }
.mit_progress_box small { min-height: 1.2em; }
.mit_progress_cancel {
    align-self: center;
    min-height: 36px;
    padding: 0 16px;
    border: 1px solid var(--line, #42434a);
    border-radius: 8px;
    background: transparent;
    color: var(--text, #dddddd);
    font: inherit;
    font-size: 0.85rem;
    cursor: pointer;
}
.mit_progress_cancel:hover { background: var(--hover, rgba(255, 255, 255, 0.08)); }
.mit_progress_cancel:disabled { opacity: 0.7; cursor: default; }
/* MERCH_KI2: the stage buttons wrap on narrow windows */
.mit_stagebtns .mit_chip { white-space: nowrap; }

/* MERCH_KI4: dot shape and the new pattern button */
.mit_shape_row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.mit_shapes button { min-height: 36px; padding: 0 12px; }
.mit_overlay .mit_pattern { margin-top: 6px; min-height: 36px; }
.mit_overlay .mit_pattern:disabled { opacity: 0.45; cursor: default; }

/* MERCH_KI5: section labels, and the Show Advanced Options switch */
.mit_overlay .mit_section_lbl {
    margin: 0 0 6px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text);
    opacity: 0.7;
}
.mit_overlay .mit_stylize { display: flex; flex-wrap: wrap; gap: 6px; }
.mit_overlay .mit_stylize .mit_chip { min-height: 40px; padding: 0 10px; }
.mit_overlay .mit_group > .mit_presets + .mit_section_lbl { margin-top: 12px; }
.mit_overlay .mit_adv_toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 40px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}
.mit_overlay .mit_switch {
    position: relative;
    flex: none;
    width: 38px;
    height: 22px;
    border-radius: 11px;
    background: var(--line);
    transition: background 0.2s ease;
}
.mit_overlay .mit_switch::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #ffffff;
    transition: left 0.2s ease;
}
.mit_overlay .mit_adv_toggle.on .mit_switch { background: var(--accent); }
.mit_overlay .mit_adv_toggle.on .mit_switch::after { left: 19px; }
.mit_overlay .mit_adv_toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
/* MERCH_KI5: phone tap targets at least 40 px (the KI4 shape and pattern buttons were 36) */
.mit_overlay .mit_shapes button,
.mit_overlay .mit_pattern { min-height: 40px; }
/* MERCH_KI6: the collapsible Stylize section and each effect's controls */
.mit_overlay .mit_style_head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 44px;
    margin: 12px 0 0;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}
.mit_overlay .mit_style_head:hover { background: var(--hover); }
.mit_overlay .mit_style_head:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mit_overlay .mit_style_count { font-weight: 500; opacity: 0.75; }
.mit_overlay .mit_chev {
    width: 8px;
    height: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(-45deg);
    transition: transform 0.2s ease;
    margin-right: 4px;
}
.mit_overlay .mit_style_head.open .mit_chev { transform: rotate(45deg); }
.mit_overlay .mit_style_body { padding: 12px 0 0; }
.mit_overlay .mit_fx_box { margin: 10px 0 0; padding-left: 10px; border-left: 2px solid var(--accent); }
.mit_overlay .mit_fade_row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.mit_overlay .mit_fade_dir button { min-height: 40px; padding: 0 9px; }
/* MERCH_KI7: colour styles */
.mit_overlay .mit_colstyle { margin-bottom: 2px; }
.mit_overlay .mit_style_body .mit_section_lbl { margin-top: 18px; }
.mit_overlay .mit_style_body > .mit_section_lbl:first-child { margin-top: 0; }
.mit_overlay .mit_ink_row { display: flex; align-items: center; gap: 10px; margin: 10px 0 0; }
.mit_overlay .mit_ink_lbl { font-size: 13px; opacity: 0.8; }
.mit_overlay .mit_inks { display: flex; flex-wrap: wrap; gap: 6px; }
.mit_overlay .mit_ink {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1px solid var(--line);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15);
}
.mit_overlay .mit_duo_row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mit_overlay .mit_duo_row input[type="color"] { width: 44px; height: 40px; padding: 2px; border: 1px solid var(--line); border-radius: 6px; background: transparent; }
.mit_overlay .mit_duo_pairs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.mit_overlay .mit_duo {
    min-height: 40px;
    padding: 0 12px;
    border: 2px solid transparent;
    border-radius: 8px;
    color: #fff;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
    cursor: pointer;
}
.mit_overlay .mit_duo.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.mit_overlay .mit_duo:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* MERCH_KI8: badge controls and the Match my shirt hint */
.mit_overlay .mit_ring_row input[type="color"] { width: 44px; height: 40px; padding: 2px; margin-left: auto; border: 1px solid var(--line); border-radius: 6px; background: transparent; }
.mit_overlay .mit_ring_row input[type="color"]:disabled { opacity: 0.4; }
.mit_overlay .mit_badge_shape button { min-height: 40px; padding: 0 10px; }
.mit_overlay .mit_match_hint { margin-top: 8px; }
.mit_overlay .mit_fade_dir { display: grid; grid-template-columns: repeat(3, 1fr); flex: 1 1 100%; }
.mit_overlay .mit_fade_dir button { padding: 0 6px; border-bottom: 1px solid var(--line); }
.mit_overlay .mit_fade_dir button:nth-child(3n) { border-right: 0; }
.mit_overlay .mit_fade_dir button:nth-last-child(-n+3) { border-bottom: 0; }
/* MERCH_KI9: two colour pickers in a row (Echo, HUD frame) */
.mit_overlay .mit_echo_row input[type="color"] + input[type="color"],
.mit_overlay .mit_hud_row input[type="color"] + input[type="color"] { margin-left: 8px; }
.mit_overlay .mit_echo_row label,
.mit_overlay .mit_hud_row label,
.mit_overlay .mit_out_row label { min-width: 0; }
/* MERCH_KI10: Neon colour sets, Duotone middle colour */
.mit_overlay .mit_neon_set { display: grid; grid-template-columns: repeat(2, 1fr); flex: 1 1 100%; }
.mit_overlay .mit_neon_set button { padding: 0 6px; border-bottom: 1px solid var(--line); }
.mit_overlay .mit_neon_set button:nth-child(2n) { border-right: 0; }
.mit_overlay .mit_neon_set button:nth-last-child(-n+2) { border-bottom: 0; }
.mit_overlay .mit_duo_row .mit_chip { margin-left: auto; }
/* MERCH_KI11: the Looks row */
.mit_overlay .mit_looks .mit_chip { font-weight: 600; }