/*
 * Chat-Overlay Studio — Editor im Dashboard.
 * Wird nach design-v3.css geladen und nutzt dessen Variablen.
 */

.co-library-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

/* ── Overlay-Erstellung ── */
.co-create-modal {
  max-width: 500px;
  padding: 1.35rem 1.45rem;
  overflow: visible;
}

.co-create-modal .modal-header {
  align-items: flex-start;
  margin-bottom: 1.3rem;
}

.co-create-modal-heading {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 0.8rem;
}

.co-create-modal-heading h3 {
  margin: 0;
  color: var(--text-primary);
  font-family: 'Outfit', var(--font-main);
  font-size: 1.12rem;
  font-weight: 760;
}

.co-create-modal-icon {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(72, 233, 226, 0.28);
  border-radius: 11px;
  background: rgba(72, 233, 226, 0.09);
  box-shadow: 0 0 24px rgba(72, 233, 226, 0.08);
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 850;
  letter-spacing: 0.04em;
}

.co-create-modal .form-group {
  margin-bottom: 0;
}

.co-create-modal input {
  width: 100%;
}

.co-create-help {
  display: block;
  margin-top: 0.48rem;
  color: var(--text-muted);
  font-size: 0.75rem;
  line-height: 1.45;
}

.co-create-error {
  margin: 0.55rem 0 0;
  color: var(--danger);
  font-size: 0.76rem;
  line-height: 1.4;
}

.co-create-error[hidden] {
  display: none;
}

.co-create-modal .modal-actions {
  margin-top: 1.35rem;
}

.co-new-btn {
  min-height: 36px;
  padding: 0.5rem 0.8rem;
  border-radius: 8px;
  font-size: 0.74rem;
}

/* ── Profil-Bibliothek ── */
.co-library {
  margin-bottom: 1.2rem;
  padding: 1.1rem 1.2rem;
}

.co-library-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.co-library-eyebrow {
  display: block;
  margin-bottom: 0.2rem;
  color: var(--accent);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.13em;
}

.co-library-header h3,
.co-editor-heading h3 {
  margin: 0;
  color: var(--text-primary);
  font-family: 'Outfit', var(--font-main);
  font-size: 1.05rem;
  font-weight: 750;
  letter-spacing: -0.01em;
}

.co-profile-count {
  flex: 0 0 auto;
  padding: 0.28rem 0.62rem;
  border: 1px solid rgba(72, 233, 226, 0.18);
  border-radius: 999px;
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.co-profile-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}

.co-profile-card {
  position: relative;
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.68rem;
  padding: 0.72rem 0.78rem;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md, 11px);
  background: rgba(148, 163, 184, 0.035);
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition:
    border-color 0.18s ease,
    background-color 0.18s ease,
    transform 0.18s ease;
}

.co-profile-card:hover {
  border-color: rgba(72, 233, 226, 0.32);
  background: rgba(72, 233, 226, 0.055);
  transform: translateY(-1px);
}

.co-profile-card:focus-visible {
  outline: 2px solid rgba(72, 233, 226, 0.75);
  outline-offset: 2px;
}

.co-profile-card.is-active {
  border-color: rgba(72, 233, 226, 0.48);
  background:
    radial-gradient(circle at 0 0, rgba(72, 233, 226, 0.12), transparent 58%),
    rgba(72, 233, 226, 0.045);
  box-shadow: inset 0 0 0 1px rgba(72, 233, 226, 0.08);
}

.co-profile-copy {
  min-width: 0;
}

.co-profile-name {
  display: block;
  overflow: hidden;
  color: var(--text-primary);
  font-size: 0.88rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.co-profile-meta {
  display: block;
  margin-top: 0.2rem;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 0.7rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.co-profile-arrow {
  color: var(--text-muted);
  font-size: 1rem;
  transition: color 0.18s ease, transform 0.18s ease;
}

.co-profile-card:hover .co-profile-arrow,
.co-profile-card.is-active .co-profile-arrow {
  color: var(--accent);
  transform: translateX(2px);
}

.co-profile-message {
  display: flex;
  grid-column: 1 / -1;
  flex-direction: column;
  align-items: center;
  padding: 1.5rem;
  border: 1px dashed var(--border-default);
  border-radius: var(--radius-md, 11px);
  color: var(--text-muted);
  font-size: 0.84rem;
  line-height: 1.55;
  text-align: center;
}

.co-profile-message strong {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.co-profile-message .btn {
  margin: 0.8rem auto 0;
}

/* ── Profil-Editor ── */
.co-editor[hidden] {
  display: none;
}

.co-editor-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1.2rem;
  padding: 0.95rem 1.05rem;
}

.co-editor-identity {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(180px, 0.7fr) minmax(240px, 1fr);
  align-items: center;
  gap: 1.25rem;
}

.co-editor-heading p {
  margin: 0.28rem 0 0;
  color: var(--text-muted);
  font-size: 0.74rem;
}

.co-editor-heading p.is-dirty {
  color: #f6c85f;
}

.co-editor-heading p.is-saving {
  color: var(--accent);
}

.co-profile-name-field {
  width: min(100%, 420px);
  min-width: 0;
}

.co-profile-name-field label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.38rem;
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 700;
}

.co-profile-name-field label small {
  overflow: hidden;
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.co-name-input {
  position: relative;
}

.co-name-input > span {
  position: absolute;
  top: 50%;
  left: 0.72rem;
  z-index: 1;
  color: var(--text-muted);
  font-size: 0.85rem;
  pointer-events: none;
  transform: translateY(-50%);
  transition: color 0.16s ease;
}

.co-name-input input {
  width: 100%;
  min-height: 38px;
  padding: 0.52rem 0.75rem 0.52rem 2rem;
  border: 1px solid var(--border-default);
  border-radius: 8px !important;
  background: rgba(2, 6, 12, 0.66) !important;
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 0.86rem;
  font-weight: 650;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

.co-name-input:focus-within > span {
  color: var(--accent);
}

.co-name-input input::placeholder {
  color: var(--text-muted);
  font-weight: 500;
}

.co-editor-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.42rem;
}

.co-editor-actions .btn {
  min-height: 34px;
  padding: 0.44rem 0.65rem;
  border-radius: 8px;
  font-size: 0.72rem;
  white-space: nowrap;
}

.co-history-btn {
  min-width: 94px;
}

#btn-co-reset {
  margin-left: 0.18rem;
}

.co-delete-btn {
  border-color: rgba(255, 107, 129, 0.22) !important;
  color: var(--danger) !important;
}

.co-delete-btn:hover:not(:disabled) {
  border-color: rgba(255, 107, 129, 0.42) !important;
  background: var(--danger-dim) !important;
}

.co-editor-actions .btn:disabled,
.co-url-actions .btn:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

/* \u2500\u2500 OBS-Testlauf \u2500\u2500 */
.co-test-console {
  position: relative;
  display: grid;
  grid-column: 1;
  grid-row: 1;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.9rem;
  align-items: stretch;
  margin-bottom: 0;
  padding: 1.1rem 1.2rem 0.9rem;
  overflow: hidden;
  border-color: rgba(72, 233, 226, 0.22);
  background: linear-gradient(180deg, rgba(11, 21, 31, 0.96), rgba(11, 16, 27, 0.96));
}

.co-test-intro {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.co-test-kicker {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.28rem;
  color: var(--accent);
  font-size: 0.64rem;
  font-weight: 850;
  letter-spacing: 0.14em;
}

.co-test-kicker > span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(72, 233, 226, 0.1), 0 0 12px rgba(72, 233, 226, 0.65);
}

.co-test-intro h3 {
  margin: 0;
  color: var(--text-primary);
  font-family: 'Outfit', var(--font-main);
  font-size: 1.05rem;
  font-weight: 760;
}

.co-test-intro p {
  max-width: 760px;
  margin: 0.3rem 0 0;
  color: var(--text-muted);
  font-size: 0.75rem;
  line-height: 1.5;
}

.co-test-controls {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  align-items: end;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
}

.co-test-field {
  display: block;
  min-width: 0;
  margin: 0;
  transition: opacity 0.18s ease, filter 0.18s ease;
}

.co-test-field.is-disabled {
  opacity: 0.35;
  filter: grayscale(0.7);
}

.co-test-field.is-disabled > span {
  color: var(--text-muted);
}

.co-test-field > span {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  column-gap: 0.75rem;
  row-gap: 0.12rem;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.71rem;
  font-weight: 700;
}

.co-test-field-name {
  min-width: 0;
}

.co-test-field output {
  display: inline-flex;
  align-items: baseline;
  margin-left: auto;
  color: var(--accent);
  font-size: 0.68rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.co-test-field output[data-unit]::after {
  margin-left: 0.28em;
  content: attr(data-unit);
}

.co-test-field input[type='range'] {
  width: 100%;
  margin: 0;
  accent-color: var(--accent);
}

.co-test-field input[type='range']:disabled {
  cursor: not-allowed;
}

.co-test-random-button {
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  gap: 0.58rem;
  padding: 0.55rem 0.72rem;
  border: 1px solid rgba(155, 123, 255, 0.28);
  border-radius: 11px;
  background: rgba(155, 123, 255, 0.07);
  color: var(--text-secondary);
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: border-color 0.18s ease, background-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.co-test-random-button:hover:not(:disabled) {
  border-color: rgba(155, 123, 255, 0.52);
  background: rgba(155, 123, 255, 0.12);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.co-test-random-button:focus-visible {
  outline: 2px solid rgba(155, 123, 255, 0.88);
  outline-offset: 3px;
}

.co-test-random-button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.co-test-random-button.is-active {
  border-color: rgba(155, 123, 255, 0.65);
  background: linear-gradient(135deg, rgba(155, 123, 255, 0.2), rgba(255, 107, 214, 0.13));
  box-shadow: 0 8px 24px rgba(155, 123, 255, 0.11);
  color: #d9cdff;
}

.co-test-random-button > span:last-child {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.co-test-random-button strong {
  font-size: 0.7rem;
  line-height: 1.2;
  white-space: nowrap;
}

.co-test-random-button small {
  margin-top: 0.14rem;
  color: var(--text-muted);
  font-size: 0.61rem;
  font-weight: 650;
}

.co-test-random-button.is-active small {
  color: #bca9ff;
}

.co-test-random-icon {
  font-size: 1rem;
  filter: grayscale(0.25);
}

.co-test-button {
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 0.58rem 0.9rem;
  border: 1px solid rgba(72, 233, 226, 0.55);
  border-radius: 11px;
  background: linear-gradient(135deg, #48e9e2, #70d6f4);
  box-shadow: 0 8px 25px rgba(72, 233, 226, 0.13);
  color: #061117;
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.co-test-button:hover:not(:disabled) {
  box-shadow: 0 10px 30px rgba(72, 233, 226, 0.22);
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.co-test-button:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 3px;
}

.co-test-button:disabled {
  cursor: not-allowed;
  filter: grayscale(0.5);
  opacity: 0.42;
}

.co-test-button.is-running {
  border-color: rgba(255, 107, 129, 0.62);
  background: linear-gradient(135deg, #ff6b81, #ff8fa0);
  box-shadow: 0 8px 28px rgba(255, 107, 129, 0.18);
}

.co-test-button-icon {
  display: grid;
  width: 29px;
  height: 29px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: rgba(4, 15, 20, 0.13);
  font-size: 0.7rem;
}

.co-test-button-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.co-test-button-copy strong {
  font-size: 0.76rem;
  line-height: 1.2;
  white-space: nowrap;
}

.co-test-button-copy small {
  margin-top: 0.15rem;
  font-size: 0.62rem;
  font-weight: 650;
  opacity: 0.68;
}

.co-test-status {
  position: static;
  z-index: 1;
  max-width: none;
  margin: -0.15rem 0 0;
  color: var(--text-muted);
  font-size: 0.62rem;
  line-height: 1.4;
  text-align: right;
}

.co-studio {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 480px);
  gap: 1.35rem;
  align-items: start;
}

.co-controls {
  display: flex;
  min-width: 0;
  grid-column: 1;
  grid-row: 2;
  flex-direction: column;
  gap: 1rem;
}

.co-group {
  padding: 1.15rem 1.25rem;
}

.co-group-title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 0.9rem;
  color: var(--text-primary);
  font-family: 'Outfit', var(--font-main);
  font-size: 1rem;
  font-weight: 750;
  letter-spacing: -0.01em;
}

.co-group .form-group {
  margin-bottom: 0.85rem;
}

.co-group .form-group:last-child {
  margin-bottom: 0;
}

.co-group label:not(.co-check) {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 600;
}

.co-group small {
  display: block;
  margin-top: 0.4rem;
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.co-subsection + .co-subsection {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(148, 163, 184, 0.1);
}

.co-subsection-title {
  margin: 0 0 0.72rem;
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.co-mode-description {
  margin: -0.28rem 0 0.85rem;
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.co-subsection > :last-child {
  margin-bottom: 0;
}

.co-group :is(input[type='text'], select) {
  min-height: 40px;
  padding: 0.58rem 0.75rem;
  font-size: 0.86rem;
}

.co-value {
  padding: 0.1rem 0.45rem;
  border-radius: 6px;
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* ── Schieberegler ── */
.co-group input[type='range'] {
  width: 100%;
  height: 4px;
  margin: 0.35rem 0 0;
  padding: 0;
  appearance: none;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.18);
  cursor: pointer;
}

.co-group input[type='range']::-webkit-slider-thumb {
  width: 15px;
  height: 15px;
  appearance: none;
  border: none;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(72, 233, 226, 0.5);
  cursor: pointer;
}

.co-group input[type='range']::-moz-range-thumb {
  width: 15px;
  height: 15px;
  border: none;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
}

/* ── Farbwähler ── */
.co-group input[type='color'] {
  width: 100%;
  height: 36px;
  padding: 3px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm, 8px);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
}

#co-text-color {
  width: min(160px, 100%);
}

/* ── Ankreuzfelder ── */
.co-check {
  display: grid;
  width: 100%;
  min-height: 40px;
  grid-template-columns: 19px minmax(0, 1fr);
  align-items: center;
  justify-content: start;
  gap: 0.65rem;
  margin-bottom: 0.36rem;
  padding: 0.5rem 0.6rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm, 8px);
  background: rgba(148, 163, 184, 0.025);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1.35;
  text-align: left;
  transition:
    border-color 0.18s ease,
    background-color 0.18s ease,
    color 0.18s ease;
}

.co-check-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.42rem;
}

.co-check-grid .co-check {
  height: 100%;
  margin-bottom: 0;
}

.co-blocked-users-field {
  margin-top: 0.85rem;
}

.co-check:hover {
  border-color: rgba(148, 163, 184, 0.16);
  background: rgba(148, 163, 184, 0.055);
  color: var(--text-primary);
}

.co-check:has(input:checked) {
  border-color: rgba(72, 233, 226, 0.18);
  background: rgba(72, 233, 226, 0.055);
  color: var(--text-primary);
}

.co-check:last-child {
  margin-bottom: 0;
}

.co-check input[type='checkbox'] {
  display: grid;
  width: 18px;
  height: 18px;
  margin: 0;
  appearance: none;
  place-content: center;
  border: 1px solid rgba(148, 163, 184, 0.48) !important;
  border-radius: 5px !important;
  background: rgba(4, 8, 14, 0.72) !important;
  box-shadow: none !important;
  cursor: pointer;
  transition:
    border-color 0.16s ease,
    background-color 0.16s ease,
    box-shadow 0.16s ease;
}

.co-check input[type='checkbox']::before {
  width: 5px;
  height: 9px;
  border-right: 2px solid #061318;
  border-bottom: 2px solid #061318;
  content: '';
  opacity: 0;
  transform: translateY(-1px) rotate(45deg) scale(0.65);
  transition: opacity 0.14s ease, transform 0.14s ease;
}

.co-check input[type='checkbox']:checked {
  border-color: var(--accent) !important;
  background: var(--accent) !important;
  box-shadow: 0 0 12px rgba(72, 233, 226, 0.18) !important;
}

.co-check input[type='checkbox']:checked::before {
  opacity: 1;
  transform: translateY(-1px) rotate(45deg) scale(1);
}

.co-check input[type='checkbox']:focus-visible {
  outline: 2px solid rgba(72, 233, 226, 0.72);
  outline-offset: 3px;
}

.co-check > span {
  min-width: 0;
}

.co-check code {
  padding: 0.05rem 0.3rem;
  border-radius: 4px;
  background: rgba(148, 163, 184, 0.12);
  font-size: 0.9em;
}

/* ── Erste Nachricht ── */
.co-first-section {
  position: relative;
  margin-top: 1.15rem;
  padding: 1rem;
  overflow: hidden;
  border: 1px solid rgba(255, 60, 172, 0.2);
  border-radius: var(--radius-md, 11px);
  background:
    radial-gradient(circle at 100% 0, rgba(255, 60, 172, 0.11), transparent 42%),
    rgba(148, 163, 184, 0.025);
}

.co-first-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.co-first-eyebrow {
  display: block;
  margin-bottom: 0.18rem;
  color: #ff73c2;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.co-first-heading h4 {
  margin: 0;
  color: var(--text-primary);
  font-family: 'Outfit', var(--font-main);
  font-size: 0.98rem;
  font-weight: 750;
  letter-spacing: -0.01em;
}

.co-first-badge {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(255, 60, 172, 0.28);
  border-radius: 10px;
  background: rgba(255, 60, 172, 0.1);
  color: #ff73c2;
  box-shadow: 0 0 20px rgba(255, 60, 172, 0.1);
}

.co-first-description {
  margin: 0.45rem 0 0.85rem;
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

.co-first-toggle {
  margin-bottom: 0.85rem;
  background: rgba(255, 60, 172, 0.035);
}

.co-first-toggle:has(input:checked) {
  border-color: rgba(255, 60, 172, 0.22);
  background: rgba(255, 60, 172, 0.07);
}

.co-first-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(148, 163, 184, 0.1);
  transition: opacity 0.18s ease, filter 0.18s ease;
}

.co-first-controls > .form-group,
.co-first-box-only .form-group {
  min-width: 0;
  margin-bottom: 0;
}

.co-first-box-only {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.co-first-box-only[hidden],
.co-first-box-only.is-hidden {
  display: none;
}

.co-first-controls.is-disabled,
.co-first-controls[aria-disabled='true'] {
  opacity: 0.42;
  filter: saturate(0.45);
}

.co-first-controls.is-disabled :is(input, select),
.co-first-controls[aria-disabled='true'] :is(input, select) {
  pointer-events: none;
}

.co-first-controls :is(input, select):disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

/* ── Vorschau ── */
.co-side {
  position: sticky;
  top: 84px;
  display: flex;
  grid-column: 2;
  grid-row: 1 / span 2;
  min-width: 0;
  flex-direction: column;
  gap: 1.15rem;
}

.co-preview-card,
.co-url-card {
  padding: 1rem 1.1rem;
}

.co-preview-note {
  color: var(--text-muted);
  font-size: 0.73rem;
  font-weight: 600;
}

/* Schachbrett zeigt an, dass der Hintergrund transparent ist */
.co-preview-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin-top: 0.85rem;
  overflow: hidden;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md, 11px);
  background-color: #11151f;
  background-image:
    linear-gradient(45deg, rgba(255, 255, 255, 0.028) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, 0.028) 75%),
    linear-gradient(45deg, rgba(255, 255, 255, 0.028) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, 0.028) 75%);
  background-position: 0 0, 11px 11px;
  background-size: 22px 22px;
}

.co-preview-frame iframe {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  width: var(--co-preview-source-width, 1920px);
  height: var(--co-preview-source-height, 1080px);
  border: 0;
  transform: scale(var(--co-preview-scale, 1));
  transform-origin: top left;
}

/* ── URL-Ausgabe ── */
.co-url-card input[type='text'] {
  width: 100%;
  margin-top: 0.85rem;
  min-height: 38px;
  padding: 0.58rem 0.72rem;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm, 8px);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text-secondary);
  font-family: 'Roboto Mono', ui-monospace, monospace;
  font-size: 0.76rem;
  outline: none;
}

.co-url-status {
  min-height: 1.1rem;
  margin: 0.5rem 0 0;
  color: var(--text-muted);
  font-size: 0.72rem;
  line-height: 1.45;
}

.co-url-status.is-live {
  color: var(--accent);
}

.co-url-status.is-draft {
  color: #f6c85f;
}

.co-url-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.7rem;
}

.co-url-actions .btn {
  flex: 0 1 auto;
  justify-content: center;
  min-height: 34px;
  padding: 0.44rem 0.68rem;
  border-radius: 8px;
  font-size: 0.74rem;
}

.co-obs-steps {
  margin-top: 1.15rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.6;
}

.co-obs-steps strong {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--text-secondary);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.co-obs-steps ol {
  margin: 0;
  padding-left: 1.1rem;
}

/* ── Responsive ── */
@media (max-width: 1150px) {
  .co-profile-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .co-editor-toolbar {
    grid-template-columns: 1fr;
  }

  .co-editor-actions {
    justify-content: flex-start;
  }

  .co-test-console {
    grid-column: 1;
    grid-row: auto;
    grid-template-columns: 1fr;
    order: -2;
    padding-bottom: 1.35rem;
  }

  .co-studio {
    grid-template-columns: 1fr;
  }

  .co-side {
    position: static;
    display: contents;
    grid-column: auto;
    grid-row: auto;
  }

  .co-controls {
    grid-column: 1;
    grid-row: auto;
    order: 0;
  }

  .co-preview-card {
    order: -1;
  }

  .co-url-card {
    order: 1;
  }
}

@media (max-width: 820px) {
  .co-editor-toolbar,
  .co-editor-identity {
    grid-template-columns: 1fr;
  }

  .co-editor-actions {
    justify-content: flex-start;
  }

  .co-check-grid {
    grid-template-columns: 1fr;
  }

  .co-test-controls {
    grid-template-columns: 1fr 1fr;
  }

  .co-test-button,
  .co-test-random-button {
    grid-column: auto;
  }
}

@media (max-width: 620px) {
  .co-library-header {
    align-items: stretch;
    flex-direction: column;
  }

  .co-library-actions {
    justify-content: space-between;
  }

  .co-new-btn {
    width: auto;
  }

  .co-profile-grid {
    grid-template-columns: 1fr;
  }

  .co-test-controls {
    grid-template-columns: 1fr;
  }

  .co-test-button {
    grid-column: auto;
  }

  .co-editor-actions {
    flex-wrap: wrap;
    gap: 0.38rem;
  }

  .co-editor-actions .btn {
    width: auto;
    flex: 0 1 auto;
  }

  .co-editor-actions .btn,
  .co-new-btn,
  .co-url-actions .btn {
    min-height: 40px;
    font-size: 0.76rem;
  }

  .co-group .form-group.row {
    flex-direction: column;
    gap: 0.8rem;
  }

  .co-first-controls,
  .co-first-box-only {
    grid-template-columns: 1fr;
  }
}
