#personas-page {
  position: relative;
  min-height: 0;
  flex: 1 1 auto;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden;
}

.personas-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

#personas-content-shell {
  transition: filter 0.18s ease;
}

#personas-page.personas-locked #personas-content-shell {
  filter: blur(4px);
  pointer-events: none;
  user-select: none;
}

.personas-admin-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(12, 16, 22, 0.4);
  backdrop-filter: blur(2px);
}

.personas-admin-overlay[hidden] {
  display: none !important;
}

.personas-admin-dialog {
  width: min(540px, 100%);
  background: rgba(255, 255, 255, 0.96);
  border: 2px solid rgba(0, 0, 0, 0.12);
  border-radius: 24px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.personas-admin-dialog h3 {
  margin: 0;
}

#persona-admin-passcode {
  width: 100%;
  border-radius: 12px;
  border: 2px solid #d5d5d5;
  padding: 10px 12px;
  font-size: 15px;
  font-family: "Comic Sans MS", "Comic Sans", sans-serif;
  background: #fff6ec;
  color: #000;
}

.personas-card {
  background: rgba(255, 255, 255, 0.86);
  border-radius: 24px;
  padding: 20px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.personas-card h3 {
  margin: 0;
}

.personas-card-title-row {
  justify-content: space-between;
}

.personas-card-title-row h3 {
  margin: 0;
}

.personas-inline-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  width: 100%;
  min-width: 0;
}

.personas-actions-row {
  justify-content: flex-end;
}

#personas-page-name,
#personas-page-prompt,
#personas-test-input {
  width: 100%;
  border-radius: 12px;
  border: 2px solid #d5d5d5;
  padding: 10px 12px;
  font-size: 15px;
  font-family: "Comic Sans MS", "Comic Sans", sans-serif;
  background: #fff6ec;
  color: #000;
}

#personas-page-prompt {
  min-height: 180px;
  resize: vertical;
}

#personas-test-input {
  min-height: 90px;
  resize: vertical;
}

.personas-button {
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: bold;
  font-size: 14px;
  background: linear-gradient(135deg, #7efc59 0%, #36c75a 100%);
  color: #051b04;
  cursor: pointer;
}

.personas-button.subtle {
  background: rgba(255, 255, 255, 0.85);
  color: #1a1a1a;
  border: 1px solid rgba(0, 0, 0, 0.15);
}

.personas-button.danger {
  background: #ff6b6b;
  color: #fff;
}

.personas-button.small {
  padding: 6px 14px;
  font-size: 13px;
}

.personas-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.personas-status {
  margin: 0;
  min-height: 18px;
  font-size: 13px;
  color: #222;
}

.personas-test-output {
  min-height: 80px;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: rgba(255, 255, 255, 0.9);
  padding: 12px;
  white-space: pre-wrap;
}

.personas-list-help {
  margin: 0;
  font-size: 13px;
  color: #363636;
}

.personas-list-empty {
  margin: 0;
  font-size: 14px;
  color: #444;
}

.personas-list {
  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.personas-list-item {
  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 14px;
  background: #fff6ec;
  padding: 10px 12px;
}

.personas-list-item.is-selected {
  border-color: rgba(54, 199, 90, 0.95);
  box-shadow: 0 0 0 2px rgba(126, 252, 89, 0.24);
}

.personas-list-item.is-expanded {
  border-color: rgba(54, 199, 90, 0.65);
}

.personas-list-row {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  cursor: pointer;
}

.personas-list-row:focus-visible {
  outline: 2px solid rgba(54, 199, 90, 0.8);
  outline-offset: 4px;
  border-radius: 10px;
}

.personas-list-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.personas-list-name {
  font-size: 15px;
  font-weight: 700;
  color: #1a1a1a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.personas-list-meta {
  font-size: 12px;
  color: #4a4a4a;
}

.personas-list-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.personas-list-expanded {
  width: 100%;
  min-width: 0;
  border-top: 1px solid rgba(0, 0, 0, 0.12);
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.personas-list-prompt {
  margin: 0;
  width: 100%;
  min-width: 0;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: rgba(255, 255, 255, 0.9);
  padding: 10px 12px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: #1a1a1a;
  font-size: 14px;
  line-height: 1.45;
}

@media (max-width: 768px) {
  .personas-admin-overlay {
    padding: 14px;
  }

  .personas-admin-dialog {
    border-radius: 16px;
    padding: 16px;
  }

  .personas-card {
    border-radius: 18px;
    padding: 14px;
  }

  .personas-card-title-row {
    align-items: flex-start;
  }

  .personas-list-row {
    grid-template-columns: 1fr;
    align-items: flex-start;
  }

  .personas-list-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .personas-button {
    padding: 8px 14px;
  }
}
