.profile-screen {
  overflow: hidden;
}

#profileContent {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.profile-hero {
  display: flex;
  gap: 14px;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  background: var(--secondary);
  align-items: center;
}

.profile-hero .avatar {
  width: 64px;
  height: 64px;
}

.profile-hero-text {
  flex: 1;
  min-width: 0;
}

.profile-hero-name {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
}

.profile-hero-sub {
  font-size: 13px;
  color: var(--hint);
  line-height: 1.35;
}

.profile-nav {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.profile-nav button {
  flex: 1;
  min-width: 120px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.profile-section {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.profile-section h3 {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--hint);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.profile-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.profile-stat {
  background: var(--secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  font-size: 13px;
}

.profile-stat strong {
  display: block;
  font-size: 15px;
  margin-top: 4px;
}

.profile-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.profile-actions button {
  width: 100%;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  background: var(--secondary);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

.profile-actions button.danger {
  border-color: #b42318;
  color: #b42318;
}

.profile-actions button.primary {
  background: var(--button, #2aabee);
  color: var(--button-text, #fff);
  border-color: transparent;
  text-align: center;
  font-weight: 600;
}

.profile-actions button:disabled {
  opacity: 0.45;
  cursor: default;
}

.profile-events-error {
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(180, 35, 24, 0.08);
  border: 1px solid rgba(180, 35, 24, 0.25);
  color: #b42318;
  font-size: 13px;
  line-height: 1.4;
}

.profile-events {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.profile-event {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--secondary);
  font-size: 13px;
}

.profile-event-title {
  font-weight: 600;
  margin-bottom: 4px;
}

.profile-event-meta {
  color: var(--hint);
  margin-bottom: 8px;
}

.profile-event-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.profile-event-actions button {
  border: none;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  background: var(--btn);
  color: var(--btn-text);
  cursor: pointer;
}

.profile-event-actions button.secondary {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
}

.profile-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 20;
  padding: 16px;
}

.profile-modal[hidden] {
  display: none !important;
}

.profile-modal-card {
  width: 100%;
  max-width: 420px;
  background: var(--secondary);
  border-radius: 14px;
  padding: 16px;
}

.profile-modal-card h4 {
  margin: 0 0 12px;
  font-size: 16px;
}

.profile-modal-card input,
.profile-modal-card textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  background: var(--bg);
  color: var(--text);
  margin-bottom: 12px;
}

.profile-modal-actions {
  display: flex;
  gap: 8px;
}

.profile-modal-actions button {
  flex: 1;
  border: none;
  border-radius: 10px;
  padding: 10px;
  font: inherit;
  cursor: pointer;
}

.profile-modal-actions .primary {
  background: var(--btn);
  color: var(--btn-text);
}

.profile-modal-actions .ghost {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
}

.profile-loading {
  padding: 24px;
  text-align: center;
  color: var(--hint);
}

.profile-danger-card {
  background: rgba(180, 35, 24, 0.06);
}

.profile-danger-card p {
  margin: 0 0 10px;
  font-size: 14px;
  line-height: 1.4;
}

.profile-danger-card input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  background: var(--bg);
  color: var(--text);
}

.profile-delete-status {
  margin-top: 10px;
  font-size: 13px;
  color: #b42318;
}

.chat-header-tappable {
  cursor: pointer;
  flex: 1;
  min-width: 0;
}

.chat-header-tappable:active {
  opacity: 0.7;
}
