.profile-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 22px;
}

.profile-eyebrow,
.section-eyebrow {
  margin: 0 0 8px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #0f766e;
}

.profile-hero h1 {
  margin: 0;
  font-size: 2rem;
  line-height: 1;
  color: #1c1917;
  letter-spacing: -0.04em;
}

.profile-subtitle {
  margin: 10px 0 0;
  max-width: 720px;
  color: #57534e;
}

.profile-back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  border-radius: 999px;
  border: 1px solid #d6d3d1;
  background: #fff;
  color: #1c1917;
  text-decoration: none;
  font-weight: 700;
}

.profile-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 20px;
}

.profile-card {
  background: #fff;
  border: 1px solid #e7e5e4;
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 16px 34px rgba(28, 25, 23, 0.04);
}

.profile-card-full {
  grid-column: 1 / -1;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.section-head h2 {
  margin: 0;
  color: #1c1917;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
}

.card-copy,
.field-hint {
  color: #78716c;
  line-height: 1.55;
}

.field-hint {
  margin: 0;
  font-size: 0.9rem;
}

.profile-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.avatar-editor {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: center;
}

.profile-avatar {
  width: 96px;
  height: 96px;
  border-radius: 24px;
  overflow: hidden;
  background: linear-gradient(135deg, #0f766e, #d97706);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 800;
  flex-shrink: 0;
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.avatar-fields {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

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

.form-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-field span {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #57534e;
}

.form-field input {
  height: 46px;
  border-radius: 14px;
  border: 1px solid #d6d3d1;
  background: #fafaf9;
  padding: 0 14px;
  font: inherit;
  color: #1c1917;
}

.form-field input[type="file"] {
  height: auto;
  padding: 12px 14px;
}

.form-field input:disabled {
  color: #78716c;
  background: #f5f5f4;
}

.form-actions {
  display: flex;
  justify-content: flex-start;
}

.form-status {
  min-height: 24px;
  font-size: 0.92rem;
  color: #57534e;
}

.form-status.is-error {
  color: #b91c1c;
}

.form-status.is-success {
  color: #0f766e;
}

.empty-state.compact {
  padding: 16px;
  text-align: center;
  border: 1px dashed #d6d3d1;
  border-radius: 16px;
  color: #78716c;
  background: #fcfcfb;
}

.subscription-panel {
  display: grid;
  gap: 14px;
}

.subscription-summary {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid #e7e5e4;
  border-radius: 16px;
  background: linear-gradient(180deg, #fffbeb, #fff);
}

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

.subscription-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  color: #1c1917;
}

.subscription-copy {
  margin: 6px 0 0;
  color: #57534e;
}

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

.subscription-meta-item {
  padding: 12px 14px;
  border-radius: 14px;
  background: #fafaf9;
  border: 1px solid #e7e5e4;
}

.subscription-meta-label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #78716c;
}

.subscription-meta-value {
  color: #1c1917;
  font-weight: 700;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: capitalize;
}

.status-pill.is-success {
  background: #dcfce7;
  color: #166534;
}

.status-pill.is-pending {
  background: #fef3c7;
  color: #92400e;
}

.status-pill.is-failed {
  background: #fee2e2;
  color: #b91c1c;
}

.status-pill.is-canceled {
  background: #e7e5e4;
  color: #44403c;
}

.history-panel {
  display: grid;
  gap: 12px;
}

.history-table-wrap {
  overflow-x: auto;
  border: 1px solid #e7e5e4;
  border-radius: 18px;
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

.history-table th,
.history-table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid #f1efec;
  vertical-align: top;
}

.history-table th {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #78716c;
  background: #fcfcfb;
}

.history-table tbody tr:last-child td {
  border-bottom: 0;
}

.history-table strong {
  color: #1c1917;
}

.history-table small {
  display: block;
  margin-top: 4px;
  color: #78716c;
}

.history-links {
  display: inline-flex;
  gap: 10px;
  flex-wrap: wrap;
}

.history-links a {
  color: #0f766e;
  font-weight: 700;
  text-decoration: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 16px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: #1c1917;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.btn-primary {
  background: #1c1917;
  border-color: #1c1917;
  color: #fff;
}

.btn-ghost {
  background: #fff;
  border-color: #d6d3d1;
  color: #44403c;
}

.profile-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(28, 25, 23, 0.58);
}

.profile-modal-overlay.hidden {
  display: none;
}

.profile-modal {
  width: min(100%, 560px);
  padding: 24px;
  border-radius: 24px;
  background: #fff;
  border: 1px solid #e7e5e4;
  box-shadow: 0 28px 64px rgba(28, 25, 23, 0.18);
}

.profile-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.profile-modal-close {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: #f5f5f4;
  color: #44403c;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.profile-form textarea {
  width: 100%;
  min-height: 120px;
  border-radius: 14px;
  border: 1px solid #d6d3d1;
  background: #fafaf9;
  padding: 12px 14px;
  font: inherit;
  color: #1c1917;
  resize: vertical;
}

.profile-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

@media (max-width: 960px) {
  .profile-grid {
    grid-template-columns: 1fr;
  }

  .profile-card-full {
    grid-column: auto;
  }
}

@media (max-width: 720px) {
  .profile-hero,
  .avatar-editor,
  .form-row {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  .profile-back-link,
  .btn {
    width: 100%;
  }

  .subscription-meta {
    grid-template-columns: 1fr;
  }

  .profile-modal {
    padding: 20px;
  }

  .profile-modal-footer {
    flex-direction: column-reverse;
  }
}
