/* АТЕЉЕ — анализа слике */
.an-wrap {
  padding-top: 26px;
}

/* ---- зона за учитавање ---- */

.an-drop {
  border: 2px dashed var(--line);
  border-radius: 18px;
  background: var(--paper-hi);
  padding: 7px;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.an-drop.is-over {
  border-color: var(--red);
  background: #fff7ef;
  transform: scale(1.006);
}

.an-drop-in {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 46px 24px 40px;
  text-align: center;
  cursor: pointer;
  border-radius: 13px;
}

.an-drop-in:hover {
  background: rgba(255, 255, 255, 0.55);
}

.an-drop-in:focus-within {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

.an-file {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.an-drop-ico {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin-bottom: 8px;
  border: 2px solid var(--ink);
  border-radius: 14px;
  background: #fff;
  box-shadow: 3px 3px 0 rgba(34, 38, 46, 0.85);
  transform: rotate(-3deg);
}

.an-drop-ico .ico {
  width: 30px;
  height: 30px;
  stroke-width: 1.7;
}

.an-drop-title {
  font-family: var(--font-head);
  font-size: 1.4rem;
  line-height: 1.2;
}

.an-drop-sub {
  color: var(--muted);
  font-size: 0.95rem;
}

.an-drop-note {
  margin-top: 12px;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.an-error {
  margin: 0;
  padding: 12px 14px;
  border: 1.5px solid var(--red);
  border-radius: 10px;
  color: var(--red);
  font-weight: 600;
  background: #fff5f2;
}

/* ---- радни део ---- */

.an-work {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 30px;
  margin-top: 24px;
  align-items: start;
}

.an-stage {
  position: sticky;
  top: 128px;
}

.an-canvas {
  position: relative;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 2px 0 rgba(34, 38, 46, 0.04);
}

.an-canvas canvas {
  display: block;
  width: 100%;
  height: auto;
}

.an-scan {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 3px;
  opacity: 0;
  background: linear-gradient(90deg, transparent, var(--red), transparent);
  box-shadow: 0 0 18px 6px rgba(212, 69, 47, 0.32);
}

.an-canvas.is-scanning .an-scan {
  animation: an-scan 0.76s cubic-bezier(0.4, 0, 0.6, 1) both;
}

@keyframes an-scan {
  0% { top: 0; opacity: 0; }
  12% { opacity: 1; }
  92% { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}

.an-modes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.an-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.an-stage .readout {
  margin-top: 12px;
}

/* ---- десна страна ---- */

.an-side {
  display: grid;
  gap: 24px;
}

.an-h {
  margin: 0 0 10px;
  font-family: var(--font-hand);
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--ink);
}

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

.an-fact {
  font-size: 0.82rem;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--paper-hi);
  color: var(--muted);
}

.an-fact b {
  color: var(--ink);
  font-weight: 700;
}

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

.an-swatch {
  width: 48px;
  height: 48px;
  border-radius: 11px;
  border: 1.5px solid rgba(34, 38, 46, 0.28);
  background: var(--s);
}

.an-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
  counter-reset: an-step;
}

.an-steps li {
  position: relative;
  padding: 14px 16px 14px 56px;
  background: var(--paper-hi);
  border: 1.5px solid var(--line);
  border-radius: 13px;
  animation: an-step-in 0.42s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.an-steps li::before {
  content: counter(an-step);
  counter-increment: an-step;
  position: absolute;
  left: 14px;
  top: 12px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-family: var(--font-hand);
  font-size: 1.1rem;
  font-weight: 700;
}

.an-steps h3 {
  margin: 0 0 3px;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0;
}

.an-steps p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--muted);
}

.an-step-actions {
  margin-top: 9px;
}

.an-link {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.an-link:hover {
  color: var(--red);
}

@keyframes an-step-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

body.motion-off .an-steps li {
  animation: none;
}

@media (max-width: 920px) {
  .an-work {
    grid-template-columns: 1fr;
    gap: 22px;
  }
  .an-stage {
    position: static;
  }
}

@media (max-width: 520px) {
  .an-drop-in {
    padding: 32px 16px;
  }
  .an-steps li {
    padding: 13px 14px 13px 50px;
  }
  .an-steps li::before {
    left: 12px;
    width: 25px;
    height: 25px;
  }
  .an-swatch {
    width: 40px;
    height: 40px;
  }
}
