:root {
  --dark: #0a0a08;
  --cream: #f3eddf;
  --cream-deep: #e8e0cc;
  --cream-mid: #ede7d5;
  --gold: #b8913a;
  --forest: #2c5e44;
  --forest-deep: #214734;
  --warm-mid: #7a6b55;
  --warm-light: rgba(10, 10, 8, 0.38);
  --line: rgba(10, 10, 8, 0.1);
  --shadow: 0 18px 48px rgba(10, 10, 8, 0.08);
  --font-display: "Cormorant Garamond", serif;
  --font-body: "Plus Jakarta Sans", sans-serif;
  --font-mono: "Space Mono", monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--dark);
  background: var(--cream);
}

a {
  color: inherit;
}

button,
input,
textarea {
  font: inherit;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.btn,
.copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 1.5px solid transparent;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-decoration: none;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    transform 0.18s ease;
}

.btn:hover,
.copy-btn:hover {
  transform: translateY(-1px);
}

.btn-small {
  padding: 0.7rem 1rem;
  font-size: 0.76rem;
}

.btn {
  padding: 0.8rem 1.15rem;
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.btn-outline {
  color: var(--warm-mid);
  border-color: rgba(10, 10, 8, 0.15);
  background: rgba(255, 255, 255, 0.42);
}

.btn-outline:hover {
  color: var(--dark);
  border-color: rgba(10, 10, 8, 0.28);
  background: rgba(255, 255, 255, 0.74);
}

.btn-primary {
  color: var(--cream);
  border-color: var(--forest);
  background: var(--forest);
}

.btn-primary:hover {
  border-color: var(--forest-deep);
  background: var(--forest-deep);
}

.btn-gold {
  color: var(--dark);
  border-color: var(--gold);
  background: var(--gold);
}

.btn-gold:hover {
  border-color: var(--gold-deep, var(--gold));
  background: var(--gold-deep, var(--gold));
  filter: brightness(0.95);
}

.btn-danger {
  color: #944331;
  border-color: rgba(148, 67, 49, 0.22);
  background: rgba(148, 67, 49, 0.06);
}

.btn-danger:hover {
  border-color: rgba(148, 67, 49, 0.4);
  background: rgba(148, 67, 49, 0.12);
}

.btn:disabled {
  cursor: default;
  opacity: 0.55;
  transform: none;
}

.workshop-label,
.text-type-label,
.files-sub,
.sidebar-section,
.sidebar-meta,
.main-step,
.field-label,
.live-label,
.preview-label,
.pc-step,
.viewer-updated,
.form-status {
  font-size: 0.69rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.workshop-label,
.text-type-label,
.files-sub,
.main-step,
.field-label,
.live-label,
.pc-step {
  font-weight: 500;
}

.pulse-dot,
.live-pip,
.pc-dot {
  border-radius: 50%;
  background: var(--forest);
  animation: pulse 2.4s ease-in-out infinite;
}

.pulse-dot {
  width: 0.45rem;
  height: 0.45rem;
}

.live-pip,
.pc-dot {
  width: 0.36rem;
  height: 0.36rem;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.35;
    transform: scale(0.72);
  }
}

.empty-state {
  padding: 1.2rem 0;
}

.empty-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 600;
  line-height: 1.1;
}

.empty-copy {
  margin: 0.45rem 0 0;
  font-size: 0.95rem;
  line-height: 1.7;
  color: rgba(10, 10, 8, 0.54);
}

.form-status {
  margin: 0;
  color: var(--warm-mid);
}

.form-status[data-state="success"] {
  color: var(--forest);
}

.form-status[data-state="error"] {
  color: #944331;
}

.field {
  display: grid;
  gap: 0.5rem;
}

.field-label {
  color: var(--warm-mid);
}

.field-input {
  width: 100%;
  padding: 0.95rem 1rem;
  border: 1.5px solid rgba(10, 10, 8, 0.1);
  background: rgba(255, 255, 255, 0.72);
  color: var(--dark);
  outline: none;
  transition:
    border-color 0.18s ease,
    background 0.18s ease;
}

.field-input:focus,
.field-textarea:focus {
  border-color: rgba(44, 94, 68, 0.42);
  background: #fff;
}

.field-input::placeholder,
.field-textarea::placeholder {
  color: rgba(10, 10, 8, 0.24);
}

.field-textarea {
  width: 100%;
  min-height: 14rem;
  padding: 0.95rem 1rem;
  border: 1.5px solid rgba(10, 10, 8, 0.1);
  background: rgba(255, 255, 255, 0.72);
  color: var(--dark);
  resize: vertical;
  line-height: 1.7;
  outline: none;
  transition:
    border-color 0.18s ease,
    background 0.18s ease;
}

.field-input-strong {
  min-height: 3.35rem;
  font-size: 1.05rem;
}

.body-login {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 1rem;
  background:
    radial-gradient(circle at top left, rgba(184, 145, 58, 0.18), transparent 30%),
    radial-gradient(circle at bottom right, rgba(44, 94, 68, 0.12), transparent 28%),
    var(--cream);
}

.login-shell {
  width: min(32rem, 100%);
}

.login-card {
  padding: 2rem;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(10, 10, 8, 0.08);
  box-shadow: var(--shadow);
}

.login-title {
  margin: 0.45rem 0 0;
  font-family: var(--font-display);
  font-size: clamp(2.7rem, 8vw, 4.2rem);
  font-weight: 600;
  line-height: 0.94;
  letter-spacing: -0.02em;
}

.login-copy {
  margin: 0.85rem 0 0;
  line-height: 1.7;
  color: rgba(10, 10, 8, 0.68);
}

.login-form {
  display: grid;
  gap: 1rem;
  margin-top: 1.5rem;
}

.login-button {
  width: 100%;
}

.body-participant {
  overflow: hidden;
}

.viewer-layout {
  display: flex;
  min-height: 100vh;
}

.viewer-text-panel {
  position: relative;
  width: 58%;
  display: flex;
  flex-direction: column;
  padding: 3.5rem 4rem;
  background: var(--cream);
}

.viewer-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.viewer-title-group {
  max-width: 44rem;
}

.workshop-label {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--forest);
}

.preset-title {
  margin: 0.65rem 0 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 3.7vw, 3rem);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.01em;
}

.viewer-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.viewer-updated {
  color: var(--warm-mid);
}

.divider,
.files-divider,
.pc-rule {
  width: 100%;
  height: 1px;
  background: var(--line);
}

.viewer-type-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 1.75rem 0 1rem;
}

.text-type-label {
  color: var(--warm-mid);
}

.copy-btn {
  padding: 0.72rem 1rem;
  color: var(--forest);
  border-color: rgba(44, 94, 68, 0.28);
  background: transparent;
}

.copy-btn:hover {
  background: rgba(44, 94, 68, 0.06);
  border-color: rgba(44, 94, 68, 0.5);
}

.copy-btn:disabled {
  cursor: default;
  opacity: 0.45;
  transform: none;
}

.copy-btn.copied {
  background: rgba(44, 94, 68, 0.1);
}

.text-box {
  position: relative;
  flex: 1;
  overflow-y: auto;
  padding: 0 1rem 5rem 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(10, 10, 8, 0.14) transparent;
}

.text-box::-webkit-scrollbar,
.files-list::-webkit-scrollbar,
.sidebar-preset-list::-webkit-scrollbar,
.form-area::-webkit-scrollbar,
.preview-area::-webkit-scrollbar {
  width: 3px;
}

.text-box::-webkit-scrollbar-thumb,
.files-list::-webkit-scrollbar-thumb,
.sidebar-preset-list::-webkit-scrollbar-thumb,
.form-area::-webkit-scrollbar-thumb,
.preview-area::-webkit-scrollbar-thumb {
  background: rgba(10, 10, 8, 0.12);
}

.text-content {
  max-width: 46rem;
  font-size: 1.1rem;
  line-height: 1.78;
  color: rgba(10, 10, 8, 0.78);
  white-space: pre-wrap;
  word-break: break-word;
}

.ghost-mark {
  position: absolute;
  right: -0.02em;
  bottom: -0.06em;
  font-family: var(--font-display);
  font-size: clamp(11rem, 19vw, 18rem);
  font-weight: 700;
  font-style: italic;
  line-height: 1;
  color: rgba(10, 10, 8, 0.035);
  user-select: none;
  pointer-events: none;
}

.viewer-files-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 3.5rem 3rem;
  background: var(--cream-deep);
  border-left: 1px solid rgba(10, 10, 8, 0.08);
}

.files-header {
  margin-bottom: 1.75rem;
}

.files-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.05;
}

.files-sub {
  margin-top: 0.35rem;
  color: var(--warm-mid);
}

.files-list {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.5rem;
  overflow-y: auto;
  padding-top: 1.5rem;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1rem 1.1rem;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(10, 10, 8, 0.08);
  text-decoration: none;
  cursor: grab;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

.file-item:hover {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(10, 10, 8, 0.16);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(10, 10, 8, 0.05);
}

.file-item:active {
  transform: scale(0.985);
  cursor: grabbing;
}

.file-icon-wrap,
.att-badge,
.pc-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--forest);
  flex-shrink: 0;
}

.file-icon-wrap {
  width: 2.25rem;
  height: 2.25rem;
}

.file-icon-wrap span,
.att-badge span,
.pc-badge span {
  color: rgba(243, 237, 223, 0.92);
  font-size: 0.54rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.file-meta {
  flex: 1;
  min-width: 0;
}

.file-name {
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.3;
  word-break: break-word;
}

.file-size {
  margin-top: 0.12rem;
  font-size: 0.72rem;
  color: var(--warm-mid);
}

.file-dl-arrow {
  font-size: 1.1rem;
  color: rgba(10, 10, 8, 0.24);
  transition:
    color 0.18s ease,
    transform 0.18s ease;
}

.file-item:hover .file-dl-arrow {
  color: var(--forest);
  transform: translateY(2px);
}

.drag-note {
  margin-top: 1.2rem;
  font-size: 0.76rem;
  text-align: center;
  color: rgba(10, 10, 8, 0.34);
}

.body-admin {
  overflow: hidden;
}

.admin-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 17.5rem;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--dark);
  color: var(--cream);
}

.sidebar-top {
  padding: 2.5rem 2rem 2rem;
  border-bottom: 1px solid rgba(243, 237, 223, 0.07);
}

.sidebar-logo {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.15;
}

.sidebar-sub {
  margin-top: 0.4rem;
  font-size: 0.74rem;
  color: rgba(243, 237, 223, 0.38);
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1.4rem 2rem 0.7rem;
}

.sidebar-section {
  color: rgba(243, 237, 223, 0.26);
}

.sidebar-meta {
  color: rgba(243, 237, 223, 0.34);
}

.sidebar-preset-list {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(243, 237, 223, 0.1) transparent;
}

.preset-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.85rem 2rem;
  border: 0;
  border-left: 2px solid transparent;
  background: transparent;
  color: rgba(243, 237, 223, 0.56);
  cursor: pointer;
  text-align: left;
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease;
}

.preset-item:hover {
  background: rgba(243, 237, 223, 0.05);
}

.preset-item.active {
  background: rgba(184, 145, 58, 0.08);
  border-left-color: var(--gold);
  color: var(--cream);
}

.preset-item.live {
  background: rgba(44, 94, 68, 0.12);
  border-left-color: var(--forest);
}

.preset-num {
  min-width: 1.1rem;
  font-size: 0.7rem;
  color: rgba(243, 237, 223, 0.22);
}

.preset-label {
  flex: 1;
  font-size: 0.82rem;
  line-height: 1.35;
}

.preset-item.active .preset-label,
.preset-item.live .preset-label {
  color: var(--cream);
}

.preset-spacer {
  width: 0.4rem;
  height: 0.4rem;
}

.sidebar-empty {
  padding: 0.25rem 2rem 0;
  font-size: 0.82rem;
  line-height: 1.7;
  color: rgba(243, 237, 223, 0.34);
}

.sidebar-bottom {
  padding: 1.25rem 2rem;
  border-top: 1px solid rgba(243, 237, 223, 0.07);
}

.btn-new-preset {
  width: 100%;
  padding: 0.82rem 1rem;
  border: 1px solid rgba(243, 237, 223, 0.1);
  background: rgba(243, 237, 223, 0.05);
  color: rgba(243, 237, 223, 0.48);
}

.btn-new-preset:hover {
  background: rgba(243, 237, 223, 0.09);
  color: rgba(243, 237, 223, 0.88);
}

.admin-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--cream);
}

.main-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 2.25rem 3rem 1.9rem;
  border-bottom: 1px solid rgba(10, 10, 8, 0.08);
}

.main-step {
  color: var(--forest);
}

.main-title {
  margin: 0.35rem 0 0;
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.01em;
}

.main-subtitle {
  margin: 0.55rem 0 0;
  max-width: 42rem;
  line-height: 1.65;
  color: rgba(10, 10, 8, 0.58);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.editor-body {
  display: flex;
  flex: 1;
  min-height: 0;
}

.form-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.65rem;
  overflow-y: auto;
  padding: 2.25rem 3rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(10, 10, 8, 0.1) transparent;
}

.field-group {
  display: grid;
  gap: 0.55rem;
}

.drop-zone {
  display: grid;
  gap: 0.3rem;
  justify-items: center;
  padding: 1.8rem 1.2rem;
  border: 2px dashed rgba(10, 10, 8, 0.12);
  background: rgba(255, 255, 255, 0.42);
  cursor: pointer;
  text-align: center;
  transition:
    border-color 0.18s ease,
    background 0.18s ease,
    transform 0.18s ease;
}

.drop-zone:hover,
.drop-zone.over {
  border-color: var(--forest);
  background: rgba(44, 94, 68, 0.04);
  transform: translateY(-1px);
}

.drop-icon {
  font-size: 1.55rem;
  line-height: 1;
  color: rgba(10, 10, 8, 0.24);
}

.drop-text {
  font-size: 0.84rem;
  line-height: 1.75;
  color: var(--warm-mid);
}

.drop-text strong {
  color: var(--forest);
}

.attached {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.attached-empty {
  margin: 0;
  font-size: 0.8rem;
  color: rgba(10, 10, 8, 0.44);
}

.attached-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem 0.95rem;
  border: 1px solid rgba(10, 10, 8, 0.08);
  background: rgba(255, 255, 255, 0.65);
}

.att-badge {
  width: 1.9rem;
  height: 1.9rem;
}

.att-name {
  flex: 1;
  min-width: 0;
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.35;
  word-break: break-word;
}

.att-size {
  font-size: 0.72rem;
  color: var(--warm-mid);
}

.att-remove {
  border: 0;
  background: transparent;
  color: rgba(10, 10, 8, 0.24);
  cursor: pointer;
  font-size: 1rem;
}

.att-remove:hover {
  color: #944331;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  line-height: 1.5;
  color: rgba(10, 10, 8, 0.72);
}

.checkbox-row input {
  width: 1rem;
  height: 1rem;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.right-panel {
  width: 20rem;
  display: flex;
  flex-direction: column;
  border-left: 1px solid rgba(10, 10, 8, 0.08);
  background: var(--cream-mid);
}

.live-status {
  padding: 1.5rem 1.75rem;
  background: var(--cream-deep);
  border-bottom: 1px solid rgba(10, 10, 8, 0.08);
}

.live-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.live-label {
  color: var(--forest);
}

.live-current {
  margin: 0.35rem 0 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.15;
}

.live-hint {
  margin: 0.3rem 0 0;
  font-size: 0.76rem;
  line-height: 1.6;
  color: var(--warm-mid);
}

.preview-area {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 1rem;
  overflow-y: auto;
  padding: 1.5rem 1.75rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(10, 10, 8, 0.1) transparent;
}

.preview-label {
  color: var(--warm-light);
}

.preview-card {
  padding: 1.1rem;
  border: 1px solid rgba(10, 10, 8, 0.09);
  background: #fff;
  box-shadow: 0 2px 12px rgba(10, 10, 8, 0.04);
}

.pc-step {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--forest);
}

.pc-title {
  margin: 0.5rem 0 0;
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1.12;
}

.pc-rule {
  margin: 0.8rem 0;
}

.pc-text {
  font-size: 0.8rem;
  line-height: 1.7;
  color: rgba(10, 10, 8, 0.58);
  white-space: pre-wrap;
  word-break: break-word;
}

.pc-files {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.85rem;
}

.pc-file {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid rgba(10, 10, 8, 0.07);
  background: rgba(243, 237, 223, 0.6);
}

.pc-badge {
  width: 1.4rem;
  height: 1.4rem;
}

.pc-fname {
  flex: 1;
  min-width: 0;
  font-size: 0.72rem;
  line-height: 1.35;
  color: rgba(10, 10, 8, 0.7);
  word-break: break-word;
}

.pc-arrow {
  font-size: 0.76rem;
  color: rgba(10, 10, 8, 0.22);
}

.preview-empty,
.preview-hint {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.65;
  color: rgba(10, 10, 8, 0.52);
}

.preview-actions {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

/* Kurze Fenster: ganze Admin-Seite scrollbar, damit der "Live schalten"-
   Button auch bei geringer Fensterhöhe immer erreichbar ist. */
@media (max-height: 900px) {
  .body-admin {
    overflow-y: auto;
  }

  .admin-layout {
    min-height: 100vh;
  }

  .editor-body {
    min-height: 0;
  }

  .form-area,
  .preview-area,
  .sidebar-preset-list {
    overflow: visible;
  }
}

@media (max-width: 1080px) {
  .body-participant,
  .body-admin {
    overflow: auto;
  }

  .viewer-layout,
  .admin-layout,
  .editor-body {
    flex-direction: column;
  }

  .viewer-text-panel,
  .viewer-files-panel,
  .sidebar,
  .right-panel {
    width: 100%;
  }

  .viewer-files-panel,
  .right-panel {
    border-left: 0;
    border-top: 1px solid rgba(10, 10, 8, 0.08);
  }

  .sidebar {
    min-height: 20rem;
  }

  .main-top,
  .viewer-panel-header {
    flex-direction: column;
    align-items: stretch;
  }

  .viewer-meta,
  .top-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 720px) {
  .viewer-text-panel,
  .viewer-files-panel,
  .form-area,
  .main-top,
  .sidebar-top,
  .sidebar-head,
  .sidebar-bottom,
  .live-status,
  .preview-area {
    padding-left: 1.2rem;
    padding-right: 1.2rem;
  }

  .viewer-text-panel,
  .viewer-files-panel {
    padding-top: 1.4rem;
    padding-bottom: 1.4rem;
  }

  .form-area,
  .main-top {
    padding-top: 1.4rem;
    padding-bottom: 1.4rem;
  }

  .viewer-type-row,
  .viewer-meta,
  .top-actions,
  .form-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn,
  .copy-btn {
    width: 100%;
  }

  .preset-title,
  .files-title,
  .main-title,
  .login-title {
    word-break: break-word;
  }

  .ghost-mark {
    font-size: 7rem;
  }
}
