/*
 * Annotator studio styles. Single column: toolbar, then the canvas as the
 * visual focus, then actions. All values come from the --kw-* tokens.
 */

.kw-as { display: grid; gap: var(--kw-space-5); }

.kw-as__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--kw-space-2);
}
.kw-as__head .kw-hint { margin: 0; font-variant-numeric: tabular-nums; }

.kw-as__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--kw-space-5);
}
.kw-as__cluster { display: grid; gap: 6px; }
.kw-as__cluster--stroke { flex: 1 1 220px; max-width: 320px; }

.kw-as__tools { display: flex; flex-wrap: wrap; gap: var(--kw-space-1); }
.as-tool {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--kw-line);
  border-radius: var(--kw-radius);
  background: var(--kw-surface);
  color: var(--kw-text-2);
  cursor: pointer;
  transition: border-color 120ms var(--kw-ease), background-color 120ms var(--kw-ease), color 120ms var(--kw-ease);
}
.as-tool:hover { border-color: var(--kw-accent); color: var(--kw-text); }
.as-tool[aria-pressed="true"] {
  border-color: var(--kw-accent);
  background: var(--kw-primary-soft);
  color: var(--kw-primary-ink);
}

.kw-as__colors { display: flex; flex-wrap: wrap; gap: var(--kw-space-1); }
.as-swatch {
  width: 28px;
  height: 28px;
  border: 2px solid var(--kw-surface);
  border-radius: var(--kw-radius-full);
  box-shadow: 0 0 0 1px var(--kw-line-strong);
  cursor: pointer;
}
.as-swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--kw-focus); }
.as-swatch:disabled { opacity: .4; cursor: not-allowed; }

.kw-as__stage {
  position: relative;
  display: grid;
  justify-items: center;
  padding: var(--kw-space-3);
  border: 1px solid var(--kw-line);
  border-radius: var(--kw-radius);
  background: var(--kw-surface-2);
}
.kw-as__stage.is-dragging { border-color: var(--kw-accent); }
#as-canvas {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: var(--kw-radius-sm);
  box-shadow: var(--kw-shadow);
  touch-action: none;
}

.kw-as__text-input {
  position: absolute;
  min-width: 4ch;
  max-width: 60%;
  padding: 2px 6px;
  border: 1px dashed var(--kw-focus);
  border-radius: var(--kw-radius-sm);
  background: var(--kw-surface);
  font-weight: 600;
  font-size: 16px;
}

/* The overlay is only ever visible in the empty state, so it flows normally
 * and sizes itself: no absolute overlay squeezed over an idle canvas (the
 * 390 collapse Lens caught). Styled as the drop card itself. */
.kw-as__overlay {
  display: grid;
  justify-items: center;
  gap: var(--kw-space-4);
  width: 100%;
  padding: var(--kw-space-8) var(--kw-space-4);
  border: 2px dashed var(--kw-line-strong);
  border-radius: var(--kw-radius-lg);
  background: var(--kw-surface);
  text-align: center;
  min-height: 200px;
  align-content: center;
}
.kw-as__overlay-idle { display: grid; gap: var(--kw-space-4); max-width: 46ch; }
.kw-as__overlay-idle .kw-actions { justify-content: center; }
.kw-as__overlay-idle > .kw-hint:last-child { margin: 0; }

.kw-as__confirm {
  position: absolute;
  left: 50%;
  bottom: var(--kw-space-4);
  transform: translateX(-50%);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--kw-space-3);
  max-width: calc(100% - 2 * var(--kw-space-4));
}
.kw-as__confirm p { margin: 0; }

.kw-as__actions { flex-wrap: wrap; }
.kw-as__spacer { flex: 1 1 auto; }

.kw-as__export {
  display: flex;
  flex-wrap: wrap;
  gap: var(--kw-space-3);
  padding-top: var(--kw-space-2);
  border-top: 1px solid var(--kw-line);
}

.as-status { min-height: 1.5em; margin: 0; }
.as-status--error { color: var(--kw-danger); font-weight: 500; }

@media (max-width: 767px) {
  .kw-as__actions .kw-as__spacer { display: none; }
  .kw-as__export .kw-btn--primary { width: 100%; }
  .kw-as__cluster--stroke { flex-basis: 100%; }
}

