/* ---------- output ---------- */
.output-area {
  position: relative;
  flex: none;
  padding: 12px clamp(10px, 3vw, 20px);
  background: var(--panel);
}

.clear-circle-btn {
  position: absolute;
  top: 20px;
  right: clamp(18px, 3vw, 28px);
  z-index: 1;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  border: none;
  background: color-mix(in srgb, var(--elevated) 65%, transparent);
  color: var(--muted);
  font-size: 1rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.clear-circle-btn:hover {
  background: color-mix(in srgb, var(--danger) 25%, transparent);
  color: var(--danger);
}

/* clips the fake caret (see output.js updateFakeCaret) to the textarea's own
   box, so scrolling/overflow can never make it poke out above/below the
   output area -- it also just naturally hugs #output's size, since the
   mirror/caret are the only other (absolutely positioned, out-of-flow)
   children. */
.ta-wrap {
  position: relative;
  overflow: hidden;
}

#output {
  width: 100%;
  resize: vertical;
  min-height: 3.2em;
  max-height: 34vh;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-2);
  color: var(--text);
  font-family: var(--font-glyph);
  /* ~70% of the old 1.15rem */
  font-size: .8rem;
  line-height: 1.6;
}

#output:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
}

/* Custom caret shown only when #output isn't actually focused (mobile --
   see updateFakeCaret() in output.js for why). .ta-mirror is never visible,
   just used to measure where the caret marker lands. */
.ta-mirror {
  pointer-events: none;
}

.fake-caret {
  position: absolute;
  display: none;
  width: 2px;
  background: var(--accent);
  pointer-events: none;
  animation: fake-caret-blink 1s step-end infinite;
}

@keyframes fake-caret-blink {
  50% { opacity: 0; }
}

.output-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.btn-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.count {
  color: var(--muted);
  font-size: .82rem;
  white-space: nowrap;
}

.btn {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--elevated);
  color: var(--text);
  line-height: 1;
  transition: background .12s, border-color .12s, transform .05s;
}

.btn:active {
  transform: translateY(1px);
}

.btn.primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: transparent;
  font-weight: 600;
}

