/*
 * Gradient Contrast Checker ([gradient_contrast]). Loaded after tools.css; the
 * code box reuses its .gg-output styles.
 */

.cc-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, 1fr); gap: 20px; align-items: start; margin-bottom: 20px; }

.cc-stage { position: sticky; top: 96px; }
.cc-preview {
	position: relative; aspect-ratio: 16 / 9; border-radius: 28px; overflow: hidden;
	display: flex; align-items: center; justify-content: center; padding: 24px;
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06);
}
.cc-preview[data-zone="left"] { justify-content: flex-start; padding-left: 6%; }
.cc-preview[data-zone="bottom"] { align-items: flex-end; padding-bottom: 7%; }
#cc-heat { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; pointer-events: none; }
.cc-zone { position: absolute; border: 2px dashed rgba(255, 255, 255, .85); border-radius: 14px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .25); pointer-events: none; }
.cc-zone[hidden] { display: none; }
.cc-text {
	position: relative; margin: 0 !important; max-width: 90%; text-align: center; outline: none;
	font-size: 19px; font-weight: 500; line-height: 1.35; color: inherit;
}
.cc-preview[data-zone="left"] .cc-text { text-align: left; max-width: 44%; }
.cc-text.is-large { font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
.cc-text:focus-visible { outline: 2px dashed currentColor; outline-offset: 6px; border-radius: 6px; }
.cc-stage-bar { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 12px; }
.cc-check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: #333; cursor: pointer; }
.cc-check input { width: 16px; height: 16px; margin: 0; accent-color: #111; }

.cc-side { display: grid; gap: 14px; }
.cc-card { background: #fff; border: 1px solid #F0F0F0; border-radius: 24px; padding: 18px 20px; box-shadow: 0 1px 3px rgba(0, 0, 0, .04); }
.cc-card-title { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #6E6E78; margin-bottom: 12px; }

.cc-verdict { display: inline-block; padding: 6px 14px; border-radius: 999px; font-size: 14px; font-weight: 700; margin-bottom: 14px; }
.cc-verdict.is-pass { background: #E6F4EA; color: #166534; }
.cc-verdict.is-fail { background: #FDECEC; color: #B42318; }
.cc-nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.cc-nums div { display: flex; flex-direction: column; gap: 2px; }
.cc-nums b { font-size: 20px; font-weight: 800; letter-spacing: -.02em; color: #111; font-variant-numeric: tabular-nums; }
.cc-nums span { font-size: 12px; color: #6E6E78; line-height: 1.3; }
.cc-explain { margin: 14px 0 0 !important; font-size: 13.5px; line-height: 1.55; color: #45454F; }

.cc-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.cc-row input[type="color"] { width: 40px !important; height: 40px !important; padding: 0 !important; border: 0 !important; border-radius: 12px !important; background: none !important; cursor: pointer; flex-shrink: 0; }
.cc-row input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.cc-row input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 12px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); }
.cc-row input[type="text"] { flex: 1; min-width: 90px; font-family: 'SF Mono', 'Fira Code', ui-monospace, monospace; text-transform: uppercase; }
.cc-stops { margin-bottom: 4px; }
.cc-angle label { font-size: 13px; font-weight: 600; color: #333; }
.cc-angle input { flex: 1; }
.cc-angle span { min-width: 40px; text-align: right; font-family: 'SF Mono', 'Fira Code', ui-monospace, monospace; font-size: 13px; color: #55555F; }
.cc-chip, .cc-btn, .cc-remove {
	padding: 7px 13px !important; margin: 0 !important; border: 1px solid #E2E2E8 !important; border-radius: 999px !important;
	background: #fff !important; color: #222 !important; font-size: 13px !important; font-weight: 600 !important; cursor: pointer; box-shadow: none !important;
	display: inline-flex; align-items: center; gap: 6px;
}
.cc-chip:hover, .cc-btn:hover, .cc-remove:hover { border-color: #111 !important; }
.cc-btn .tg-i { width: 15px; height: 15px; }
.cc-remove { width: 30px; height: 30px; padding: 0 !important; justify-content: center; }
#cc-add[hidden] { display: none !important; }
.cc-paste { width: 100%; font-family: 'SF Mono', 'Fira Code', ui-monospace, monospace; font-size: 12.5px !important; }

.cc-seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; border-radius: 999px; background: #F4F4F7; margin-top: 10px; }
.cc-seg button { padding: 8px 4px !important; border: 0 !important; border-radius: 999px !important; background: transparent !important; font-size: 13px !important; font-weight: 600 !important; color: #45454F !important; cursor: pointer; box-shadow: none !important; }
.cc-seg button[aria-pressed="true"] { background: #fff !important; color: #111 !important; box-shadow: 0 1px 3px rgba(0, 0, 0, .1) !important; }

.cc-outputs { margin-bottom: 20px; }

@media (max-width: 860px) {
	.cc-layout { grid-template-columns: 1fr; }
	.cc-stage { position: static; }
	.cc-text.is-large { font-size: 24px; }
}

/* Dark mode */
html[data-theme="dark"] .tg-tool .cc-card { background: #15151D !important; border-color: rgba(255, 255, 255, .09) !important; }
html[data-theme="dark"] .tg-tool .cc-nums b { color: #EDEDF2 !important; }
html[data-theme="dark"] .tg-tool .cc-nums span, html[data-theme="dark"] .tg-tool .cc-angle span { color: #9393A3 !important; }
html[data-theme="dark"] .tg-tool .cc-explain { color: #B9B9C6 !important; }
html[data-theme="dark"] .tg-tool .cc-check, html[data-theme="dark"] .tg-tool .cc-angle label { color: #EDEDF2 !important; }
html[data-theme="dark"] .tg-tool .cc-verdict.is-pass { background: #12301F; color: #8BE3A9; }
html[data-theme="dark"] .tg-tool .cc-verdict.is-fail { background: #3A1418; color: #FF9A9A; }
html[data-theme="dark"] .tg-tool .cc-chip, html[data-theme="dark"] .tg-tool .cc-btn, html[data-theme="dark"] .tg-tool .cc-remove { background: #1D1D27 !important; border-color: rgba(255, 255, 255, .16) !important; color: #EDEDF2 !important; }
html[data-theme="dark"] .tg-tool .cc-seg { background: #1D1D27 !important; }
html[data-theme="dark"] .tg-tool .cc-seg button { color: #B9B9C6 !important; }
html[data-theme="dark"] .tg-tool .cc-seg button[aria-pressed="true"] { background: #262633 !important; color: #EDEDF2 !important; }
