/* ============================================================
   Text on Image Contrast Checker - stylesheet (2026-10-05)
   Everything is scoped under .tic / .tic-*; the shared header, footer,
   FAQ and related-tools pills come from styles/custom_styles.css,
   which loads first. Blue accent, single colours for titles and icons,
   no thick side borders. Dark mode via [data-theme="dark"], light default.
   ============================================================ */

.tic {
    --tic-accent: #3399cc;
    --tic-accent-strong: #237a9f;
    --tic-accent-soft: rgba(51, 153, 204, 0.10);
    --tic-accent-line: rgba(51, 153, 204, 0.45);
    --tic-go: #237a9f;
    --tic-go-hover: #1b6183;
    --tic-card: var(--bg-elevated, #fff);
    --tic-sunk: var(--card-tertiary, #f1f5f9);
    --tic-open: var(--card-secondary, #f8fafc);
    --tic-line: var(--border-color, #e2e8f0);
    --tic-text-1: var(--text-primary, #1e293b);
    --tic-text-2: var(--text-secondary, #555);
    --tic-muted: var(--text-muted, #64748b);
    --tic-checker: #e5e7eb;
    --tic-checker-bg: #fff;
    --tic-view-bg: #eef2f6;
    --tic-red: #c23b3b;
    --tic-green: #2d8659;
    --tic-input: var(--input-bg, #fff);
}
[data-theme="dark"] .tic {
    --tic-accent: #5bb8e0;
    --tic-accent-strong: #7cc8ea;
    --tic-accent-soft: rgba(91, 184, 224, 0.13);
    --tic-accent-line: rgba(91, 184, 224, 0.5);
    --tic-go: #3399cc;
    --tic-go-hover: #5bb8e0;
    --tic-sunk: #172033;
    --tic-open: #1a2438;
    --tic-checker: #334155;
    --tic-checker-bg: #1e293b;
    --tic-view-bg: #111a2b;
    --tic-red: #f87171;
    --tic-green: #4ade80;
}

.tic.tool-container { max-width: 1160px; margin: 0 auto; padding: 2rem; }
.tic [hidden] { display: none !important; }
.tic button { font: inherit; width: auto; }

/* ---------- title ---------- */
.tic .tool-header { text-align: center; margin-bottom: 1.75rem; }
.tic .tool-title-row { display: flex; align-items: center; justify-content: center; gap: 0.9rem; margin-bottom: 0.9rem; }
.tic .tic-title-icon {
    width: 56px; height: 56px; border-radius: 16px;
    background: var(--tic-accent); color: #fff;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
[data-theme="dark"] .tic .tic-title-icon { color: #0f172a; }
.tic .tic-title-icon svg { width: 30px; height: 30px; display: block; }
.tic .tool-title { margin: 0; font-size: 2rem; font-weight: 700; color: var(--tic-accent); line-height: 1.2; }
.tic .tool-description { max-width: 800px; margin: 0 auto; font-size: 1.05rem; line-height: 1.65; color: var(--tic-text-2); }
.tic .tool-description a { color: var(--tic-accent-strong); font-weight: 500; }

/* ---------- error ---------- */
.tic .tic-error {
    display: flex; align-items: flex-start; gap: 0.7rem;
    margin: 0 0 1rem; padding: 0.9rem 1rem; border-radius: 12px;
    border: 1px solid rgba(230, 78, 78, 0.35); background: rgba(230, 78, 78, 0.08);
    color: var(--tic-text-1);
}
.tic .tic-error > svg { width: 20px; height: 20px; color: #e64e4e; flex-shrink: 0; margin-top: 2px; }
.tic .tic-error > div { flex: 1; min-width: 0; }
.tic .tic-error p { margin: 0; font-size: 0.9rem; line-height: 1.55; color: var(--tic-text-1); }
.tic .tic-error p + p { margin-top: 0.3rem; color: var(--tic-muted); }
.tic .tic-error a { color: var(--tic-red); font-weight: 600; }

/* ---------- shared bits ---------- */
.tic .tic-checker {
    background-color: var(--tic-checker-bg);
    background-image:
        linear-gradient(45deg, var(--tic-checker) 25%, transparent 25%),
        linear-gradient(-45deg, var(--tic-checker) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, var(--tic-checker) 75%),
        linear-gradient(-45deg, transparent 75%, var(--tic-checker) 75%);
    background-size: 16px 16px;
    background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}
.tic .tic-card {
    background: var(--tic-card); border: 1px solid var(--tic-line);
    border-radius: 14px; padding: 1rem 1.1rem; min-width: 0;
}
.tic .tic-col-view > * + *,
.tic .tic-col-side > * + * { margin-top: 0.875rem; }
.tic .tic-card-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.75rem; min-width: 0; }
.tic .tic-h { display: inline-flex; align-items: center; gap: 0.45rem; margin: 0; font-size: 0.95rem; font-weight: 700; color: var(--tic-text-1); min-width: 0; }
.tic .tic-h svg { width: 17px; height: 17px; color: var(--tic-accent); flex-shrink: 0; }
.tic .tic-chip,
.tic .tic-adv-value {
    display: inline-flex; align-items: center; padding: 0.12rem 0.5rem; border-radius: 999px;
    background: var(--tic-accent-soft); color: var(--tic-accent-strong);
    font-size: 0.75rem; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums;
}
.tic .tic-hint { margin: 0.55rem 0 0; font-size: 0.78rem; line-height: 1.5; color: var(--tic-muted); }
.tic .tic-text-btn {
    display: inline-flex; align-items: center; gap: 0.35rem;
    padding: 0.4rem 0.6rem; border: none; border-radius: 8px; background: none;
    color: var(--tic-accent-strong); font-size: 0.85rem; font-weight: 600; cursor: pointer; flex-shrink: 0; white-space: nowrap;
}
.tic .tic-text-btn:hover { background: var(--tic-accent-soft); }
.tic .tic-text-btn svg { width: 15px; height: 15px; }
.tic .tic-link-btn {
    display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.3rem 0.55rem; border-radius: 8px;
    border: 1px solid var(--tic-line); background: var(--tic-card); color: var(--tic-text-2);
    font-size: 0.82rem; font-weight: 600; cursor: pointer;
}
.tic .tic-link-btn:hover { border-color: var(--tic-accent-line); color: var(--tic-accent-strong); }
.tic .tic-link-btn svg { width: 14px; height: 14px; }
.tic .tic-icon-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; padding: 0; border-radius: 9px;
    border: 1px solid var(--tic-line); background: var(--tic-card); color: var(--tic-text-2);
    cursor: pointer; flex-shrink: 0; transition: border-color .15s, color .15s, background .15s;
}
.tic .tic-icon-btn svg { width: 16px; height: 16px; }
.tic .tic-icon-btn:hover:not(:disabled) { border-color: var(--tic-accent-line); color: var(--tic-accent-strong); }
.tic .tic-icon-btn:disabled { opacity: 0.4; cursor: not-allowed; background: var(--tic-card); }
.tic .tic-error-close { width: 28px; height: 28px; border: none; background: none; }
.tic .tic-mini-actions { display: flex; gap: 0.3rem; }
.tic .tic-mini-actions .tic-icon-btn { width: 32px; height: 32px; }

/* segmented */
.tic .tic-seg {
    display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px;
    padding: 4px; border-radius: 12px; background: var(--tic-sunk); border: 1px solid var(--tic-line);
}
.tic .tic-seg button {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.35rem;
    min-height: 36px; padding: 0.35rem 0.5rem; border: 1px solid transparent; border-radius: 9px;
    background: none; color: var(--tic-text-2); font-size: 0.85rem; font-weight: 600; cursor: pointer;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
.tic .tic-seg button:hover:not(.active) { color: var(--tic-text-1); }
.tic .tic-seg button.active {
    background: var(--tic-card); color: var(--tic-accent-strong); border-color: var(--tic-line);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

/* buttons */
.tic .tic-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
    min-height: 42px; padding: 0.55rem 1rem; border-radius: 11px; border: 1px solid transparent;
    font-size: 0.92rem; font-weight: 700; cursor: pointer; white-space: nowrap; text-decoration: none;
    transition: background .15s, border-color .15s, color .15s;
}
.tic .tic-btn svg { width: 17px; height: 17px; flex-shrink: 0; }
.tic .tic-go { background: var(--tic-go); color: #fff; }
.tic .tic-go:hover:not(:disabled) { background: var(--tic-go-hover); color: #fff; }
[data-theme="dark"] .tic .tic-go,
[data-theme="dark"] .tic .tic-go:hover:not(:disabled) { color: #0b1220; }
.tic .tic-go:disabled { opacity: 0.5; cursor: not-allowed; background: var(--tic-go); }
.tic .tic-btn-ghost { background: none; color: var(--tic-text-2); border-color: var(--tic-line); }
.tic .tic-btn-ghost:hover:not(:disabled) { color: var(--tic-accent-strong); border-color: var(--tic-accent-line); background: var(--tic-accent-soft); }
.tic .tic-btn-ghost:disabled { opacity: 0.45; cursor: not-allowed; background: none; }

/* ---------- main layout ---------- */
.tic .tic-main {
    background: var(--tic-card); border: 1px solid var(--tic-line); border-radius: 22px;
    box-shadow: var(--shadow-md, 0 4px 12px rgba(0, 0, 0, 0.08)); padding: 1.25rem;
}
.tic .tic-layout {
    display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    gap: 1.25rem; align-items: start;
}
.tic .tic-col-view,
.tic .tic-col-side { min-width: 0; }

/* ---------- image card ---------- */
.tic .tic-view-card { padding: 0.75rem; }
.tic .tic-filebar { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin: 0 0 0.6rem; min-width: 0; }
.tic .tic-file { display: inline-flex; align-items: center; gap: 0.45rem; min-width: 0; font-size: 0.86rem; font-weight: 600; color: var(--tic-text-1); }
.tic .tic-file svg { width: 16px; height: 16px; color: var(--tic-accent); flex-shrink: 0; }
.tic .tic-file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

.tic .tic-drop {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.45rem;
    min-height: 340px; padding: 2rem 1.25rem; border-radius: 12px; text-align: center; cursor: pointer;
    border: 2px dashed var(--tic-accent-line); background: var(--tic-accent-soft); color: var(--tic-text-2);
    transition: background .15s, border-color .15s; outline: none; box-sizing: border-box;
}
.tic .tic-drop:hover,
.tic .tic-drop.is-drag,
.tic .tic-drop:focus-visible { border-color: var(--tic-accent); background: rgba(51, 153, 204, 0.16); }
.tic .tic-drop.is-busy { cursor: progress; opacity: 0.75; }
.tic .tic-drop-icon {
    width: 60px; height: 60px; border-radius: 18px; display: flex; align-items: center; justify-content: center;
    background: var(--tic-accent); color: #fff; margin-bottom: 0.35rem;
}
[data-theme="dark"] .tic .tic-drop-icon { color: #0f172a; }
.tic .tic-drop-icon svg { width: 28px; height: 28px; }
.tic .tic-drop-title { font-size: 1.15rem; font-weight: 700; color: var(--tic-text-1); }
.tic .tic-drop-sub { font-size: 0.88rem; color: var(--tic-muted); }
.tic .tic-drop-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; margin-top: 0.5rem; }
.tic .tic-drop-chips span {
    padding: 0.12rem 0.45rem; border-radius: 6px; background: var(--tic-card); border: 1px solid var(--tic-line);
    font-size: 0.7rem; font-weight: 700; color: var(--tic-muted); letter-spacing: 0.03em;
}
.tic .tic-samples { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; margin-top: 0.7rem; }
.tic .tic-samples-label { font-size: 0.8rem; font-weight: 700; color: var(--tic-muted); margin-right: 0.15rem; }

.tic .tic-view {
    position: relative; overflow: hidden; border-radius: 12px; outline: none;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
}
.tic .tic-view:focus-visible { box-shadow: 0 0 0 3px var(--tic-accent-line); }
.tic .tic-view.is-drag { box-shadow: 0 0 0 3px var(--tic-accent); }
.tic .tic-view-canvas { display: block; cursor: pointer; touch-action: none; }
.tic .tic-view.is-pannable .tic-view-canvas { cursor: grab; }
.tic .tic-view.is-dragging .tic-view-canvas { cursor: grabbing; }
.tic .tic-busy {
    position: absolute; inset: 0; z-index: 4; display: flex; align-items: center; justify-content: center; gap: 0.6rem;
    background: rgba(15, 23, 42, 0.45); color: #fff; font-size: 0.95rem;
}
.tic .tic-spinner {
    width: 22px; height: 22px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, 0.35); border-top-color: #fff;
    animation: tic-spin .8s linear infinite;
}
@keyframes tic-spin { to { transform: rotate(360deg); } }

.tic .tic-view-tools { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-top: 0.6rem; min-width: 0; }
.tic .tic-view-hint { display: flex; align-items: center; gap: 0.35rem; margin: 0; min-width: 0; }
.tic .tic-view-hint svg { width: 14px; height: 14px; flex-shrink: 0; }
.tic .tic-zoom {
    display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: 10px; flex-shrink: 0;
    background: var(--tic-sunk); border: 1px solid var(--tic-line);
}
.tic .tic-zoom button {
    display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; padding: 0;
    border: none; border-radius: 7px; background: none; color: var(--tic-text-2); cursor: pointer;
}
.tic .tic-zoom button:hover { background: var(--tic-card); color: var(--tic-accent-strong); }
.tic .tic-zoom button svg { width: 16px; height: 16px; }
.tic .tic-zoom strong { min-width: 50px; text-align: center; font-size: 0.78rem; color: var(--tic-text-1); font-variant-numeric: tabular-nums; }

/* ---------- collapsed option rows ---------- */
.tic .tic-adv-options { padding: 0; overflow: hidden; }
.tic .tic-adv-row + .tic-adv-row { border-top: 1px solid var(--tic-line); }
.tic .tic-adv-head {
    display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
    width: 100%; min-height: 52px; padding: 0.55rem 1rem; border: none; background: none;
    cursor: pointer; text-align: left; color: var(--tic-text-1); box-sizing: border-box;
}
.tic .tic-adv-head-static { cursor: default; }
.tic .tic-adv-head:hover:not(.tic-adv-head-static) { background: var(--tic-open); }
.tic .tic-adv-left { display: flex; align-items: center; gap: 0.7rem; min-width: 0; }
.tic .tic-adv-left > svg { width: 18px; height: 18px; color: var(--tic-accent); flex-shrink: 0; }
.tic .tic-adv-text { display: flex; flex-direction: column; min-width: 0; }
.tic .tic-adv-title { font-size: 0.9rem; font-weight: 700; color: var(--tic-text-1); }
.tic .tic-adv-hint { font-size: 0.76rem; color: var(--tic-muted); line-height: 1.4; overflow: hidden; text-overflow: ellipsis; }
.tic .tic-adv-right { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }
.tic .tic-chevron { width: 17px; height: 17px; color: var(--tic-muted); transition: transform .2s; }
.tic .tic-adv-row.open .tic-chevron { transform: rotate(180deg); }
.tic .tic-adv-row.open .tic-adv-head,
.tic .tic-adv-row.open .tic-adv-body { background: var(--tic-open); }
.tic .tic-adv-body { padding: 0.2rem 1rem 1rem; }

/* switch - must beat .tool-container input[type="checkbox"] in custom_styles.css */
.tic .tic-switch-wrap { display: inline-flex; align-items: center; gap: 0.45rem; flex-shrink: 0; cursor: pointer; }
.tic .tic-switch-wrap em { font-style: normal; font-size: 0.72rem; font-weight: 800; color: var(--tic-muted); min-width: 26px; letter-spacing: 0.04em; }
.tic .tic-switch-wrap input:checked + em { color: var(--tic-accent-strong); }
input[type="checkbox"].tic-switch,
.tool-container input[type="checkbox"].tic-switch {
    -webkit-appearance: none !important; appearance: none !important;
    position: relative !important; display: inline-block !important;
    width: 40px !important; min-width: 40px !important; max-width: 40px !important; height: 22px !important;
    margin: 0 !important; padding: 0 !important; border: none !important; border-radius: 999px !important;
    background: #cbd5e1 !important; background-color: #cbd5e1 !important; box-shadow: none !important;
    cursor: pointer !important; transition: background-color .2s !important; flex-shrink: 0; vertical-align: middle;
}
[data-theme="dark"] input[type="checkbox"].tic-switch,
[data-theme="dark"] .tool-container input[type="checkbox"].tic-switch { background: #475569 !important; background-color: #475569 !important; }
input[type="checkbox"].tic-switch::after,
.tool-container input[type="checkbox"].tic-switch::after,
.tool-container input[type="checkbox"].tic-switch:checked::after {
    content: '' !important; font-size: 0 !important; position: absolute !important;
    top: 3px !important; left: 3px !important; right: auto !important; bottom: auto !important;
    width: 16px !important; height: 16px !important; border-radius: 50% !important;
    background: #fff !important; box-shadow: 0 1px 2px rgba(0,0,0,.3) !important;
    transform: none !important; transition: transform .2s !important; display: block !important;
}
input[type="checkbox"].tic-switch:checked,
.tool-container input[type="checkbox"].tic-switch:checked { background: var(--tic-go, #237a9f) !important; background-color: var(--tic-go, #237a9f) !important; }
input[type="checkbox"].tic-switch:checked::after,
.tool-container input[type="checkbox"].tic-switch:checked::after { transform: translateX(18px) !important; }
input[type="checkbox"].tic-switch:focus-visible,
.tool-container input[type="checkbox"].tic-switch:focus-visible { outline: 2px solid var(--tic-accent) !important; outline-offset: 2px !important; }

/* ---------- toast ---------- */
.tic .tic-toast {
    position: fixed; left: 50%; bottom: 24px; z-index: 9500; transform: translate(-50%, 16px);
    padding: 0.7rem 1.1rem; border-radius: 12px; background: #0f172a; color: #f8fafc;
    font-size: 0.88rem; font-weight: 600; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; max-width: calc(100vw - 32px);
}
.tic .tic-toast.show { opacity: 1; transform: translate(-50%, 0); }
[data-theme="dark"] .tic .tic-toast { background: #f8fafc; color: #0f172a; }

/* ---------- content ---------- */
.tic .related-tools { margin-top: 2rem; }
.tic .tic-info { display: grid; gap: 1.5rem; margin-top: 2rem; }
.tic .tic-info > * { min-width: 0; }
.tic .tic-info .info-card {
    background: var(--tic-card); border: 1px solid var(--tic-line); border-radius: 16px;
    padding: 1.6rem 1.75rem; box-shadow: none;
}
.tic .tic-info .info-card h2 { font-size: 1.3rem; margin: 0 0 1rem; }
.tic .tic-info .info-card h2 svg { color: var(--tic-accent); width: 22px; height: 22px; }
.tic .tic-info p { margin: 0.75rem 0 0; line-height: 1.7; color: var(--tic-text-2); }
.tic .tic-list-info strong { color: var(--tic-text-1); }
.tic .tic-list-info { margin: 0; padding-left: 1.2rem; display: grid; gap: 0.6rem; line-height: 1.65; color: var(--tic-text-2); }
.tic .tic-table-wrap { overflow-x: auto; border: 1px solid var(--tic-line); border-radius: 12px; margin-top: 0.9rem; }
.tic .tic-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.tic .tic-table th,
.tic .tic-table td { padding: 0.6rem 0.85rem; text-align: left; border-bottom: 1px solid var(--tic-line); color: var(--tic-text-2); }
.tic .tic-table th { background: var(--tic-open); color: var(--tic-text-1); font-weight: 700; }
.tic .tic-table tr:last-child td { border-bottom: none; }
.tic .tic-table code { font-size: 0.85em; padding: 0.05rem 0.3rem; border-radius: 4px; background: var(--tic-sunk); white-space: nowrap; }


/* ---------- text box on the photo ---------- */
.tic .tic-view { background: var(--tic-view-bg); touch-action: none; }
.tic .tic-box {
    position: absolute; left: 0; top: 0; z-index: 2; box-sizing: border-box; cursor: move; outline: none;
    border: 1.5px dashed rgba(255, 255, 255, 0.95); box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.55), inset 0 0 0 1px rgba(15, 23, 42, 0.35);
    border-radius: 2px; touch-action: none;
}
.tic .tic-box:focus-visible { border-style: solid; box-shadow: 0 0 0 3px var(--tic-accent-line); }
.tic .tic-hd {
    position: absolute; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 3px;
    background: #fff; box-shadow: 0 0 0 1.5px #237a9f, 0 1px 3px rgba(0, 0, 0, 0.35); touch-action: none;
}
.tic .tic-hd::after { content: ''; position: absolute; inset: -10px; }   /* bigger touch target */
.tic .tic-hd-nw { left: 0; top: 0; cursor: nwse-resize; }
.tic .tic-hd-n { left: 50%; top: 0; cursor: ns-resize; }
.tic .tic-hd-ne { left: 100%; top: 0; cursor: nesw-resize; }
.tic .tic-hd-e { left: 100%; top: 50%; cursor: ew-resize; }
.tic .tic-hd-se { left: 100%; top: 100%; cursor: nwse-resize; }
.tic .tic-hd-s { left: 50%; top: 100%; cursor: ns-resize; }
.tic .tic-hd-sw { left: 0; top: 100%; cursor: nesw-resize; }
.tic .tic-hd-w { left: 0; top: 50%; cursor: ew-resize; }
.tic .tic-view.is-preview .tic-box { opacity: 0.35; }
.tic .tic-preview-tag {
    position: absolute; right: 10px; top: 10px; z-index: 3; display: none; pointer-events: none;
    padding: 0.2rem 0.55rem; border-radius: 999px; background: rgba(15, 23, 42, 0.78); color: #fff;
    font-size: 0.72rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase;
}
.tic .tic-view.is-preview .tic-preview-tag { display: block; }
.tic .tic-view-btns { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }
.tic .tic-pill {
    display: inline-flex; align-items: center; gap: 0.35rem; min-height: 38px; padding: 0.3rem 0.75rem; border-radius: 10px;
    border: 1px solid var(--tic-line); background: var(--tic-card); color: var(--tic-text-2);
    font-size: 0.82rem; font-weight: 700; cursor: pointer; white-space: nowrap;
}
.tic .tic-pill svg { width: 15px; height: 15px; }
.tic .tic-pill:hover { border-color: var(--tic-accent-line); color: var(--tic-accent-strong); }
.tic .tic-pill.active { background: rgba(230, 78, 78, 0.1); border-color: rgba(230, 78, 78, 0.45); color: var(--tic-red); }
.tic .tic-legend { display: flex; flex-wrap: wrap; gap: 0.9rem; margin: 0.55rem 0 0; font-size: 0.78rem; color: var(--tic-muted); }
.tic .tic-legend span { display: inline-flex; align-items: center; gap: 0.35rem; }
.tic .tic-key { display: inline-block; width: 14px; height: 14px; border-radius: 4px; box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.2); }
.tic .tic-key-red { background: rgb(230, 50, 50); }
.tic .tic-key-amber { background: rgb(245, 158, 11); }
.tic .tic-key-clear { background: transparent; box-shadow: inset 0 0 0 1px var(--tic-muted); }

.tic:not(.has-image) .tic-needs-img { display: none; }

/* ---------- result ---------- */
.tic .tic-verdict {
    display: flex; align-items: flex-start; gap: 0.75rem; padding: 0.85rem 0.95rem; border-radius: 12px;
    background: var(--tic-sunk); border: 1px solid var(--tic-line);
}
.tic .tic-verdict > div { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; }
.tic .tic-verdict strong { font-size: 1.02rem; color: var(--tic-text-1); }
.tic .tic-verdict span { font-size: 0.84rem; line-height: 1.5; color: var(--tic-text-2); }
.tic .tic-verdict-ico {
    display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%;
    flex-shrink: 0; background: var(--tic-muted); color: #fff;
}
.tic .tic-verdict-ico svg { width: 18px; height: 18px; }
.tic .tic-verdict.is-pass { background: rgba(51, 153, 102, 0.1); border-color: rgba(51, 153, 102, 0.4); }
.tic .tic-verdict.is-pass .tic-verdict-ico { background: var(--tic-green); }
.tic .tic-verdict.is-fail { background: rgba(230, 78, 78, 0.08); border-color: rgba(230, 78, 78, 0.4); }
.tic .tic-verdict.is-fail .tic-verdict-ico { background: #e64e4e; }
[data-theme="dark"] .tic .tic-verdict-ico { color: #0f172a; }
.tic .tic-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 0.8rem; }
.tic .tic-stat {
    display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; padding: 0.6rem 0.7rem; border-radius: 10px;
    background: var(--tic-sunk); border: 1px solid var(--tic-line);
}
.tic .tic-stat span { font-size: 0.72rem; font-weight: 700; color: var(--tic-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tic .tic-stat strong { font-size: 1.1rem; color: var(--tic-text-1); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tic .tic-stat-main strong { color: var(--tic-green); }
.tic .tic-stat-main.is-bad strong { color: var(--tic-red); }
.tic .tic-pair { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 0.75rem; align-items: center; margin-top: 0.8rem; }
.tic .tic-pair-sw {
    display: flex; align-items: center; justify-content: center; width: 64px; height: 44px; border-radius: 10px;
    font: 800 1.15rem/1 Arial, sans-serif; box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.15);
}
.tic .tic-pair-txt { display: flex; flex-direction: column; min-width: 0; }
.tic .tic-pair-txt strong { font: 700 0.86rem/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--tic-text-1); }
.tic .tic-pair-txt small { font-size: 0.76rem; line-height: 1.45; color: var(--tic-muted); }
.tic .tic-next { margin: 0.75rem 0 0; font-size: 0.82rem; line-height: 1.6; color: var(--tic-text-2); }
.tic .tic-next a,
.tic .tic-info a { color: var(--tic-accent-strong); font-weight: 600; }

/* ---------- suggestions ---------- */
.tic .tic-sugg-intro { margin: -0.35rem 0 0.7rem; }
.tic .tic-sugg-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; transition: opacity .2s; }
.tic .tic-sugg-list.is-stale { opacity: 0.55; }
.tic .tic-sug {
    display: grid; grid-template-columns: 34px minmax(0, 1fr); grid-template-rows: auto auto; gap: 0.35rem 0.65rem; align-items: start;
    min-width: 0; padding: 0.75rem; border-radius: 12px; border: 1px solid var(--tic-line); background: var(--tic-card);
    outline: none; transition: border-color .15s, background .15s;
}
.tic .tic-sug:hover,
.tic .tic-sug:focus-visible { border-color: var(--tic-accent-line); background: var(--tic-open); }
.tic .tic-sug.is-on { border-color: var(--tic-green); background: rgba(51, 153, 102, 0.07); }
.tic .tic-sug.is-na { opacity: 0.6; }
.tic .tic-sug-ico {
    grid-row: 1 / span 2; display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 10px;
    background: var(--tic-accent-soft); color: var(--tic-accent-strong);
}
.tic .tic-sug-ico svg { width: 17px; height: 17px; }
.tic .tic-sug-txt { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.tic .tic-sug-txt strong { font-size: 0.88rem; color: var(--tic-text-1); line-height: 1.35; }
.tic .tic-sug-txt small { font-size: 0.76rem; line-height: 1.45; color: var(--tic-muted); }
.tic .tic-sug-txt em { font-style: normal; font-size: 0.74rem; font-weight: 700; color: var(--tic-green); font-variant-numeric: tabular-nums; }
.tic .tic-sug > .tic-btn { grid-column: 2; justify-self: start; }
.tic .tic-sug-colors { grid-column: 1 / -1; }
.tic .tic-colchips { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; margin-top: 0.45rem; }
.tic .tic-colchip {
    display: flex; align-items: center; gap: 0.5rem; min-width: 0; padding: 0.4rem 0.5rem; border-radius: 10px; text-align: left;
    border: 1px solid var(--tic-line); background: var(--tic-card); color: var(--tic-text-1); cursor: pointer;
}
.tic .tic-colchip:hover { border-color: var(--tic-accent-line); }
.tic .tic-colchip.is-cur { border-color: var(--tic-accent); background: var(--tic-accent-soft); }
.tic .tic-colchip-sw { width: 26px; height: 26px; border-radius: 7px; flex-shrink: 0; box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.2); }
.tic .tic-colchip > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.tic .tic-colchip b { font-size: 0.76rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tic .tic-colchip small { display: inline-flex; align-items: center; gap: 0.2rem; font: 600 0.72rem/1.3 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--tic-muted); white-space: nowrap; }
.tic .tic-colchip small svg { color: var(--tic-red); flex-shrink: 0; }
.tic .tic-colchip.is-ok small svg { color: var(--tic-green); }
.tic .tic-btn-sm { min-height: 32px; padding: 0.3rem 0.8rem; font-size: 0.82rem; border-radius: 9px; }

/* ---------- side: presets + text ---------- */
.tic .tic-presets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.tic .tic-presets button {
    display: flex; align-items: center; gap: 0.5rem; min-width: 0; min-height: 44px; padding: 0.45rem 0.65rem; border-radius: 10px;
    border: 1px solid var(--tic-line); background: var(--tic-card); color: var(--tic-text-1);
    font-size: 0.84rem; font-weight: 700; text-align: left; cursor: pointer;
}
.tic .tic-presets button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tic .tic-presets button svg { width: 17px; height: 17px; color: var(--tic-accent); flex-shrink: 0; }
.tic .tic-presets button:hover { border-color: var(--tic-accent-line); }
.tic .tic-presets button.active { border-color: var(--tic-accent); background: var(--tic-accent-soft); color: var(--tic-accent-strong); }
.tic .tic-textarea,
.tic .tic-input {
    width: 100%; box-sizing: border-box; padding: 0.6rem 0.75rem; border-radius: 10px;
    border: 1px solid var(--tic-line); background: var(--tic-input); color: var(--tic-text-1);
    font: 500 0.95rem/1.45 inherit; font-family: inherit; resize: vertical;
}
.tic .tic-textarea { min-height: 76px; }
.tic .tic-textarea:focus,
.tic .tic-input:focus { outline: none; border-color: var(--tic-accent); box-shadow: 0 0 0 3px var(--tic-accent-soft); }
.tic .tic-color-row { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; gap: 8px; align-items: center; margin-top: 0.6rem; }
.tic .tic-color-pick { position: relative; display: block; width: 42px; height: 42px; border-radius: 10px; overflow: hidden; cursor: pointer; box-shadow: inset 0 0 0 1px var(--tic-line); }
.tic .tic-color-dot { position: absolute; inset: 0; box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.18); border-radius: 10px; }
.tic .tic-color-pick input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; }
.tic .tic-color-row .tic-input { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-weight: 700; text-transform: uppercase; height: 42px; }
.tic .tic-quick { display: flex; gap: 4px; }
.tic .tic-quick button {
    display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; padding: 0; border-radius: 10px;
    border: 1px solid var(--tic-line); background: var(--tic-card); cursor: pointer;
}
.tic .tic-quick button span { width: 22px; height: 22px; border-radius: 6px; box-shadow: inset 0 0 0 1px rgba(100, 116, 139, 0.5); }
.tic .tic-quick button:hover { border-color: var(--tic-accent-line); }

/* fields inside option rows */
.tic .tic-field { display: flex; flex-direction: column; gap: 0.35rem; margin-top: 0.7rem; }
.tic .tic-caption { font-size: 0.76rem; font-weight: 700; color: var(--tic-muted); }
.tic .tic-caption b { color: var(--tic-text-1); font-variant-numeric: tabular-nums; }
.tic .tic-range { width: 100%; accent-color: var(--tic-accent); margin: 0; }
.tic .tic-size-row { display: grid; grid-template-columns: minmax(0, 1fr) 96px; gap: 10px; align-items: center; }
.tic .tic-num { display: flex; align-items: center; gap: 0.3rem; padding: 0 0.55rem; border-radius: 9px; border: 1px solid var(--tic-line); background: var(--tic-input); height: 38px; box-sizing: border-box; }
.tic .tic-num input { width: 100%; min-width: 0; border: none; background: none; color: var(--tic-text-1); font: 700 0.9rem/1 inherit; font-family: inherit; padding: 0; }
.tic .tic-num input:focus { outline: none; }
.tic .tic-num span { font-size: 0.75rem; color: var(--tic-muted); font-weight: 700; }
.tic .tic-seg svg { width: 15px; height: 15px; flex-shrink: 0; }
.tic .tic-seg-wrap { grid-auto-flow: row; grid-template-columns: repeat(auto-fit, minmax(78px, 1fr)); }

/* ---------- export ---------- */
.tic .tic-export { margin-top: 1.1rem; }
.tic .tic-export-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: 1.4rem; align-items: start; }
.tic .tic-export-grid > * { min-width: 0; }
.tic .tic-export-img .tic-hint { margin: 0.3rem 0 0.75rem; }
.tic .tic-export-bar { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; margin-top: 0.9rem; }
.tic .tic-summary { display: flex; flex-direction: column; min-width: 0; }
.tic .tic-summary strong { font-size: 0.85rem; color: var(--tic-text-1); }
.tic .tic-summary span { font-size: 0.8rem; color: var(--tic-muted); font-variant-numeric: tabular-nums; }
.tic .tic-go { min-width: 170px; }
.tic .tic-code-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.6rem; }
.tic .tic-tabs {
    display: flex; flex-wrap: wrap; gap: 2px; padding: 3px; border-radius: 10px; margin-bottom: 0.6rem;
    background: var(--tic-sunk); border: 1px solid var(--tic-line); width: fit-content; max-width: 100%; box-sizing: border-box;
}
.tic .tic-tabs button {
    padding: 0.3rem 0.75rem; border: 1px solid transparent; border-radius: 7px; background: none; cursor: pointer;
    color: var(--tic-text-2); font-size: 0.82rem; font-weight: 700; white-space: nowrap;
}
.tic .tic-tabs button.active { background: var(--tic-card); color: var(--tic-accent-strong); border-color: var(--tic-line); }
.tic .tic-code {
    margin: 0; padding: 0.85rem 1rem; border-radius: 11px; max-height: 300px; overflow: auto;
    background: #0f172a; color: #e2e8f0; border: 1px solid #1e293b;
    font: 0.8rem/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    white-space: pre-wrap; word-break: break-word;
}
.tic .tic-code code { font: inherit; color: inherit; background: none; padding: 0; }

/* ---------- content extras ---------- */
.tic .tic-info .info-card p:first-of-type { margin-top: 0; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
    .tic .tic-layout { display: flex; flex-direction: column; align-items: stretch; gap: 0.875rem; }
    .tic .tic-col-view,
    .tic .tic-col-side { display: contents; }
    .tic .tic-col-view > * + *,
    .tic .tic-col-side > * + * { margin-top: 0; }
    .tic .tic-view-card { order: 1; }
    .tic .tic-text-card { order: 2; }
    .tic .tic-result { order: 3; }
    .tic .tic-sugg-card { order: 4; }
    .tic .tic-presets-card { order: 5; }
    .tic .tic-adv-options { order: 6; }
    .tic:not(.has-image) .tic-presets-card { order: 2; }
    .tic .tic-export-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
    .tic.tool-container { padding: 1rem 0.75rem; }
    .tic .tool-title { font-size: 1.5rem; }
    .tic .tic-title-icon { width: 46px; height: 46px; border-radius: 13px; }
    .tic .tic-title-icon svg { width: 24px; height: 24px; }
    .tic .tic-main { padding: 0.75rem; border-radius: 16px; }
    .tic .tic-card { padding: 0.85rem; }
    .tic .tic-view-card { padding: 0.5rem; }
    .tic .tic-drop { min-height: 220px; }
    .tic .tic-view-tools { flex-direction: column; align-items: stretch; }
    .tic .tic-view-btns { justify-content: space-between; }
    .tic .tic-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tic .tic-sugg-list { grid-template-columns: minmax(0, 1fr); }
    .tic .tic-export-bar { flex-direction: column; align-items: stretch; }
    .tic .tic-go { min-width: 0; }
    .tic .tic-info .info-card { padding: 1.2rem; }
    .tic .tic-table th,
    .tic .tic-table td { padding: 0.5rem 0.55rem; }
    .tic .tic-adv-head { padding: 0.55rem 0.8rem; }
    .tic .tic-adv-body { padding: 0.2rem 0.8rem 1rem; }
}
@media (prefers-reduced-motion: reduce) {
    .tic * { transition: none !important; animation: none !important; }
}

/* Shared steps list + FAQ (main CSS) follow the tool accent (2026-10-11) */
.tic.tool-container { --tool-accent: var(--tic-accent, #3399cc); }
