:root {
  color-scheme: light;
  --bg: #f6f3ef;
  --panel: #ffffff;
  --text: #171717;
  --muted: #68615a;
  --line: #ded7cf;
  --accent: #2f6b57;
  --danger: #9d2f2f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, sans-serif;
}

.wrap {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 56px;
}

.wrap.small {
  width: min(420px, calc(100% - 32px));
}

.top p,
.admin-head p {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 14px;
}

h1 {
  margin: 0 0 24px;
  font-size: 34px;
}

h2 {
  margin: 0 0 14px;
  font-size: 20px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.wide {
  grid-column: 1 / -1;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 11px;
  color: var(--text);
  font: inherit;
  background: #fff;
}

textarea {
  resize: vertical;
}

.media {
  display: grid;
  grid-template-columns: minmax(220px, 360px) 1fr;
  gap: 24px;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.avatar {
  width: 180px;
  height: 180px;
  object-fit: cover;
  border-radius: 50%;
  border: 1px solid var(--line);
  display: block;
  margin: 0 0 16px;
  background: #eee;
}

.choice {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
}

.choice input {
  width: auto;
}

button {
  border: 0;
  border-radius: 6px;
  padding: 11px 16px;
  margin-top: 22px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.preview-link {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  border-radius: 999px;
  padding: 12px 18px;
  margin: 22px 0 0 10px;
  background: #233d6d;
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

button.secondary {
  background: #5f5a54;
  margin-top: 0;
}

button.danger {
  background: var(--danger);
}

.notice {
  border-radius: 6px;
  padding: 12px 14px;
  margin: 0 0 16px;
}

.notice.ok {
  background: #e5f2ed;
  color: #245743;
}

.notice.error {
  background: #f7e8e8;
  color: var(--danger);
}

.notice.privacy {
  background: #eef6f2;
  color: #214f3e;
  line-height: 1.45;
}

.help-text {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.help-text p {
  margin: 0 0 10px;
}

.help-text a {
  color: var(--accent);
}

.template-note {
  margin: 14px 0 12px;
}

.notes-section {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.muted {
  color: var(--muted);
}

.uploaded-list {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.45;
}

.uploaded-list p {
  margin: 0 0 6px;
}

.uploaded-list ul {
  margin: 0;
  padding-left: 18px;
}

.slide-input-block {
  display: grid;
  gap: 10px;
  margin: 18px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.55);
}

.slide-input-block h3 {
  margin: 0;
  font-size: 16px;
}

.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

.editor-toolbar button,
button.add-slide {
  min-height: 0;
  margin: 0;
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 13px;
}

.editor-toolbar button[data-link] {
  min-width: 58px;
}

.rich-editor {
  min-height: 150px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  background: #fff;
  line-height: 1.5;
  outline: none;
}

.rich-editor ul,
.rich-editor ol {
  margin: 0.5em 0;
  padding-left: 1.45em;
}

.delete-file {
  display: inline-flex;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.delete-file input {
  width: auto;
}

.admin-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}

.add {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 14px;
  align-items: end;
  margin-bottom: 24px;
}

.add button {
  margin: 0;
}

.gate {
  max-width: 420px;
}

.password-form {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto auto;
  gap: 8px;
  align-items: center;
}

.password-form input {
  min-width: 150px;
}

.password-form button {
  margin: 0;
  padding: 9px 10px;
}

.table-wrap {
  overflow-x: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  max-width: 100%;
}

.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 16px;
}

.bulk-actions,
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.bulk-actions button {
  margin: 0;
  padding: 9px 11px;
}

.filters a,
.download-link {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 11px;
  background: var(--panel);
  color: var(--accent);
  text-decoration: none;
  font-size: 14px;
}

.filters a.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.download-link {
  background: #233d6d;
  border-color: #233d6d;
  color: #fff;
}

.download-link.disabled {
  opacity: 0.5;
  pointer-events: none;
}

table {
  width: 100%;
  min-width: 1180px;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

a {
  color: var(--accent);
  font-weight: 700;
}

.open-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  border-radius: 6px;
  padding: 8px 10px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
}

.order-panel {
  display: grid;
  gap: 18px;
}

.order-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.order-actions button {
  margin: 0;
}

.order-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.order-item {
  display: grid;
  grid-template-columns: 36px 48px 1fr auto;
  gap: 12px;
  align-items: center;
  min-height: 62px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
}

.order-item.dragging {
  opacity: 0.55;
}

.drag-handle {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: #f1ece6;
  color: var(--muted);
  cursor: grab;
  font-weight: 800;
}

.order-number {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 800;
}

.order-main {
  display: grid;
  gap: 3px;
}

.order-main small {
  color: var(--muted);
}

.compact-button {
  min-height: 34px;
  margin: 0;
  padding: 7px 10px;
}

.stop-create {
  display: grid;
  gap: 12px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.stop-create button {
  justify-self: start;
  margin: 0;
}

@media (max-width: 760px) {
  .grid,
  .media,
  .add,
  .password-form {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 28px;
  }
}

/* AI Pivko public-site styling for participant profile pages only. */
.profile-page {
  --profile-bg: #0f172a;
  --profile-panel: rgba(15, 23, 43, 0.78);
  --profile-panel-strong: rgba(2, 6, 24, 0.72);
  --profile-text: #f1f5f9;
  --profile-muted: #90a1b9;
  --profile-line: rgba(129, 140, 248, 0.2);
  --profile-primary: #818cf8;
  --profile-primary-glow: #6366f1;
  --profile-secondary: #2dd4bf;
  --profile-green: #00d294;
  --profile-danger: #ff6568;
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 12%, rgba(129, 140, 248, 0.2), transparent 30rem),
    radial-gradient(circle at 82% 0%, rgba(45, 212, 191, 0.13), transparent 26rem),
    linear-gradient(135deg, rgba(255, 255, 255, 0.035) 25%, transparent 25%) 0 0 / 32px 32px,
    #0f172a;
  color: var(--profile-text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  overflow-x: hidden;
}

.profile-page::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    linear-gradient(rgba(45, 212, 191, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(129, 140, 248, 0.035) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), transparent 88%);
}

.profile-page::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.22));
}

.profile-page .profile-wrap {
  position: relative;
  z-index: 1;
  width: min(980px, calc(100% - 32px));
  padding: 42px 0 72px;
}

.profile-page .profile-hero {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-bottom: 28px;
}

.profile-page .profile-logo {
  width: 92px;
  height: 92px;
  object-fit: contain;
  filter: drop-shadow(0 0 22px rgba(129, 140, 248, 0.28));
}

.profile-page .top p {
  margin: 0 0 8px;
  color: var(--profile-secondary);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.profile-page h1 {
  margin: 0;
  color: #ffffff;
  font-size: clamp(32px, 5vw, 56px);
  line-height: 1.05;
  font-weight: 800;
}

.profile-page h2 {
  color: #ffffff;
  font-size: 18px;
  font-weight: 800;
}

.profile-page .panel,
.profile-page .gate {
  position: relative;
  overflow: hidden;
  background: var(--profile-panel);
  border: 1px solid var(--profile-line);
  border-radius: 16px;
  padding: 26px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(18px);
}

.profile-page .panel::before,
.profile-page .gate::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(129, 140, 248, 0.85), transparent);
}

.profile-page .gate {
  max-width: 520px;
  margin: 0 auto;
}

.profile-page .grid {
  gap: 16px;
}

.profile-page label {
  color: var(--profile-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.profile-page input,
.profile-page textarea {
  border: 1px solid rgba(129, 140, 248, 0.28);
  border-radius: 12px;
  padding: 13px 14px;
  color: var(--profile-text);
  background: rgba(2, 6, 24, 0.64);
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.profile-page input::placeholder,
.profile-page textarea::placeholder {
  color: rgba(144, 161, 185, 0.78);
}

.profile-page input:focus,
.profile-page textarea:focus {
  border-color: var(--profile-primary);
  background: rgba(2, 6, 24, 0.86);
  box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.18), 0 0 24px rgba(129, 140, 248, 0.14);
}

.profile-page input[type="file"] {
  cursor: pointer;
}

.profile-page input[type="file"]::file-selector-button {
  border: 1px solid rgba(129, 140, 248, 0.35);
  border-radius: 10px;
  margin-right: 12px;
  padding: 9px 12px;
  background: rgba(129, 140, 248, 0.15);
  color: #ffffff;
  font-weight: 800;
  cursor: pointer;
}

.profile-page .media,
.profile-page .notes-section {
  border-top: 1px solid rgba(129, 140, 248, 0.18);
}

.profile-page .media {
  grid-template-columns: minmax(220px, 300px) 1fr;
}

.profile-page .avatar {
  width: 180px;
  height: 180px;
  border: 2px solid rgba(129, 140, 248, 0.38);
  background: rgba(2, 6, 24, 0.72);
  box-shadow: 0 0 0 8px rgba(129, 140, 248, 0.08), 0 18px 44px rgba(0, 0, 0, 0.36);
}

.profile-page .help-text {
  color: #cad5e2;
  font-size: 14px;
  line-height: 1.68;
}

.profile-page .help-text p {
  margin-bottom: 12px;
}

.profile-page .help-text a,
.profile-page a {
  color: var(--profile-secondary);
}

.profile-page .slide-input-block {
  border-color: rgba(129, 140, 248, 0.18);
  border-radius: 16px;
  background: rgba(2, 6, 24, 0.32);
}

.profile-page .slide-input-block h3 {
  margin: 0;
  color: #ffffff;
  font-size: 17px;
}

.profile-page .editor-toolbar button,
.profile-page button.add-slide {
  min-height: 34px;
  border-radius: 999px;
  padding: 7px 12px;
  box-shadow: none;
}

.profile-page .editor-toolbar button {
  background: rgba(129, 140, 248, 0.13);
  border-color: rgba(129, 140, 248, 0.3);
}

.profile-page .rich-editor {
  min-height: 170px;
  border: 1px solid rgba(129, 140, 248, 0.28);
  border-radius: 14px;
  color: var(--profile-text);
  background: rgba(2, 6, 24, 0.64);
}

.profile-page .rich-editor:focus {
  border-color: var(--profile-primary);
  box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.18), 0 0 24px rgba(129, 140, 248, 0.14);
}

.profile-page .delete-file {
  color: var(--profile-muted);
}

.profile-page .template-note {
  padding: 14px 16px;
  border: 1px solid rgba(45, 212, 191, 0.22);
  border-radius: 14px;
  background: rgba(45, 212, 191, 0.08);
}

.profile-page .notice {
  border-radius: 14px;
  border: 1px solid transparent;
  line-height: 1.55;
}

.profile-page .notice.ok {
  background: rgba(0, 210, 148, 0.12);
  border-color: rgba(0, 210, 148, 0.25);
  color: #5ee9b5;
}

.profile-page .notice.error {
  background: rgba(255, 101, 104, 0.12);
  border-color: rgba(255, 101, 104, 0.28);
  color: var(--profile-danger);
}

.profile-page .notice.privacy {
  background: rgba(129, 140, 248, 0.1);
  border-color: rgba(129, 140, 248, 0.22);
  color: #dbeafe;
}

.profile-page button {
  position: relative;
  min-height: 46px;
  border: 1px solid rgba(129, 140, 248, 0.4);
  border-radius: 999px;
  padding: 12px 20px;
  background: linear-gradient(135deg, var(--profile-primary), var(--profile-primary-glow));
  color: #ffffff;
  box-shadow: 0 0 28px rgba(129, 140, 248, 0.28);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.profile-page .preview-link {
  border: 1px solid rgba(45, 212, 191, 0.4);
  background: rgba(45, 212, 191, 0.12);
  color: var(--profile-secondary);
  box-shadow: 0 0 24px rgba(45, 212, 191, 0.12);
}

.profile-page button:hover {
  transform: translateY(-1px);
  border-color: rgba(45, 212, 191, 0.5);
  box-shadow: 0 0 34px rgba(129, 140, 248, 0.44);
}

.profile-page .muted {
  color: var(--profile-muted);
}

@media (max-width: 760px) {
  .profile-page .profile-wrap {
    width: min(100% - 24px, 640px);
    padding-top: 28px;
  }

  .profile-page .profile-hero {
    align-items: flex-start;
    gap: 14px;
  }

  .profile-page .profile-logo {
    width: 62px;
    height: 62px;
  }

  .profile-page .panel,
  .profile-page .gate {
    padding: 18px;
    border-radius: 14px;
  }

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