/* ==========================================================================
   grafikit.pl — cutout.css: narzędzie „Wytnij postać” (prefiks ct-). Tokeny z style.css.
   ========================================================================== */
.ct-layout { grid-template-columns: minmax(0, 360px) minmax(0, 1fr); }
@media (max-width: 900px) { .ct-layout { grid-template-columns: minmax(0, 1fr); } .ct-side { order: 2; } .ct-stage-card { order: 1; } }

.ct-fieldset { border: 0; padding: 0; margin: 1rem 0 0; min-width: 0; }
.ct-fieldset legend { padding: 0; }
.ct-model { display: flex; gap: .6rem; align-items: flex-start; padding: .5rem .6rem; border: 1.5px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; margin-bottom: .4rem; }
.ct-model:hover { border-color: var(--accent); }
.ct-model:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.ct-model input { margin-top: .2rem; flex: 0 0 auto; }
.ct-hex { width: 7.5rem !important; font-family: var(--font-mono); text-transform: uppercase; }

.ct-stage-card { padding: .9rem; }
@media (min-width: 901px) { .ct-stage-card { position: sticky; top: calc(var(--header-h, 64px) + 1rem); } }
.ct-stage-bar { display: flex; justify-content: space-between; align-items: center; gap: .75rem; margin-bottom: .75rem; }
.ct-stage-title { font: 600 .95rem var(--font-ui); color: var(--muted); }
.ct-stage { position: relative; min-height: 280px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: .5rem; overflow: hidden; }
.ct-stage .tl-empty { margin: 0; width: 100%; border: 0; }
.ct-wrap { position: relative; border-radius: var(--radius-sm); overflow: hidden; box-shadow: var(--shadow); touch-action: none; max-width: 100%; }
.ct-wrap canvas { display: block; width: 100%; height: 100%; }
.ct-wrap #ct-overlay { position: absolute; inset: 0; }
.ct-wrap.is-brush #ct-overlay { cursor: none; }
.ct-wrap:not(.is-brush) #ct-overlay { pointer-events: none; }
.ct-wrap.tl-checker { background-size: 18px 18px; background-position: 0 0, 9px 9px; }

#ct-app.is-busy .ct-wrap { opacity: .75; }
#ct-app.is-busy .ct-wrap::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(100deg, transparent 30%, rgba(254, 153, 35, .22) 50%, transparent 70%);
  background-size: 220% 100%; animation: ct-scan 1.4s linear infinite;
}
@keyframes ct-scan { from { background-position: 120% 0; } to { background-position: -120% 0; } }
@media (prefers-reduced-motion: reduce) { #ct-app.is-busy .ct-wrap::after { animation: none; } }

.stack--tight > * + * { margin-top: .6rem; }
#ct-card-dl .btn { width: 100%; justify-content: flex-start; }
#ct-compare[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
