/* ══════════════════════════════════════════════
   PROFILE.CSS — /profile/ page only
   Layered on top of core.css.

   GALYM design system:
   - No decorative gradients (solid colors only)
   - No resting shadows on cards/buttons/badges
   - Hover-only shadows: 0 4px 14px rgba(45,106,79,0.15)
   - Radius: controls 4px · cards/panels 8px · icon btns 6px
     · circles 50% · pills 999px unchanged
   - Tech-student: mono labels, green instrument accents
   - Light motion (fade-up + hover lift), prefers-reduced-motion
   - Font fallbacks match site stack (Space Grotesk / Inter /
     JetBrains Mono). Dark theme via core tokens. Mobile-first.
══════════════════════════════════════════════ */

.profile-wrap {
  --profile-font-display: var(--font-display, "Space Grotesk", system-ui, sans-serif);
  --profile-font-body: var(--font-body, "Inter", system-ui, sans-serif);
  --profile-font-mono: var(--font-mono, "JetBrains Mono", ui-monospace, monospace);
  /* Hover-only elevation — never at rest */
  --profile-hover-shadow: 0 4px 14px rgba(45, 106, 79, 0.15);

  /* Error / danger red — one source for validation, danger zone, btn-danger */
  --profile-danger: #c0392b;
  --profile-danger-bg: rgba(192, 57, 43, 0.06);
  --profile-danger-ring: rgba(192, 57, 43, 0.22);
}

[data-theme="dark"] .profile-wrap {
  --profile-hover-shadow: 0 4px 14px rgba(76, 175, 125, 0.18);
  /* lighter red — #c0392b is too dim on the dark surface */
  --profile-danger: #ef6b5b;
  --profile-danger-bg: rgba(239, 107, 91, 0.10);
  --profile-danger-ring: rgba(239, 107, 91, 0.28);
}

/* ── Layout (mobile base) ──────────────────── */
.profile-wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: calc(var(--nav-h, 64px) + 24px) 4vw 56px;
  font-family: var(--profile-font-body);
}

@media (min-width: 720px) {
  .profile-wrap {
    padding: calc(var(--nav-h, 64px) + 40px) 5vw 72px;
  }
}

@media (min-width: 1100px) {
  .profile-wrap {
    padding-top: calc(var(--nav-h, 64px) + 56px);
  }
}

/* ── Loading / error ───────────────────────── */
.profile-loading,
.profile-error {
  font-family: var(--profile-font-body);
  color: var(--muted);
  padding: 48px 0;
  text-align: center;
  font-size: 14px;
  line-height: 1.6;
}

.profile-error .btn-secondary {
  margin-top: 1rem;
}

.profile-loading {
  animation: profile-pulse 1.4s ease-in-out infinite;
}

@keyframes profile-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.55; }
}

/* ── Entrance motion (matches core .fade-up) ─ */
.profile-card,
.profile-section,
.profile-inline-form:not([hidden]) {
  opacity: 0;
  transform: translateY(14px);
  transition:
    opacity 0.5s ease,
    transform 0.5s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.profile-card.profile-visible,
.profile-section.profile-visible,
.profile-inline-form.profile-visible:not([hidden]) {
  opacity: 1;
  transform: translateY(0);
}

.profile-section.profile-visible:nth-of-type(1) { transition-delay: 0.06s; }
.profile-section.profile-visible:nth-of-type(2) { transition-delay: 0.12s; }
.profile-section.profile-visible:nth-of-type(3) { transition-delay: 0.18s; }
.profile-section.profile-visible:nth-of-type(4) { transition-delay: 0.24s; }

@media (prefers-reduced-motion: reduce) {
  .profile-loading {
    animation: none;
  }

  .profile-card,
  .profile-section,
  .profile-inline-form:not([hidden]) {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .contact-row,
  .device-row,
  .edit-ic,
  .profile-avatar,
  .btn-secondary,
  .btn-danger,
  .profile-inline-form .btn-primary,
  .profile-section .btn-primary {
    transition: none !important;
  }

  .contact-row:hover,
  .device-row:hover {
    transform: none;
  }

  .btn-primary.is-loading::after,
  .btn-secondary.is-loading::after,
  .btn-danger.is-loading::after {
    animation: none;
  }
}

/* ── Header card (panel = 8px, no resting shadow) ─ */
.profile-card {
  display: flex;
  align-items: center; /* vertical center avatar with text block */
  gap: 14px;
  padding: 16px 14px;
  margin-bottom: 8px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  /* no box-shadow at rest */
}

@media (min-width: 480px) {
  .profile-card {
    gap: 20px;
    padding: 20px 20px;
    margin-bottom: 12px;
  }
}

/* ── Avatar ─────────────────────────────────── */
.profile-avatar {
  flex-shrink: 0;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: var(--bg3);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--profile-font-display);
  font-weight: 700;
  font-size: 28px;
  color: var(--accent2);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

@media (min-width: 480px) {
  .profile-avatar {
    width: 96px;
    height: 96px;
    font-size: 30px;
  }
}

@media (min-width: 720px) {
  .profile-avatar {
    width: 104px;
    height: 104px;
    font-size: 32px;
  }
}

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

.profile-card:hover .profile-avatar {
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: var(--profile-hover-shadow);
}

.profile-avatar.is-loading {
  opacity: 0.55;
  pointer-events: none;
}

.profile-avatar .avatar-edit-hint {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  transition: opacity 0.2s ease;
  border-radius: 50%;
}

.profile-avatar:hover .avatar-edit-hint,
.profile-avatar:focus-visible .avatar-edit-hint {
  opacity: 1;
}

.profile-avatar .avatar-edit-hint svg {
  width: 20px;
  height: 20px;
  stroke: #fff;
  fill: none;
}

@media (min-width: 480px) {
  .profile-avatar .avatar-edit-hint svg {
    width: 24px;
    height: 24px;
  }
}

/* Compact text actions under meta (not full secondary buttons) */
.avatar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  margin-top: 6px;
}

.avatar-actions .btn-text {
  background: none;
  border: none;
  padding: 0;
  font-family: var(--profile-font-body);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.15s ease;
}

.avatar-actions .btn-text:hover {
  color: var(--accent);
}

.avatar-actions .btn-text:focus-visible {
  outline: 2px solid var(--accent2);
  outline-offset: 2px;
  border-radius: 2px;
}

.avatar-actions .btn-text:disabled {
  opacity: 0.5;
  cursor: default;
}

.avatar-actions .field-status {
  flex-basis: 100%;
  margin-top: 0;
  font-size: 12px;
  min-height: 1.1em;
}

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

.profile-field {
  display: flex;
  align-items: center;
  gap: 8px;
}

.profile-name {
  font-family: var(--profile-font-display);
  font-weight: 700;
  font-size: clamp(17px, 4.5vw, 24px);
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--text);
}

.profile-meta-line {
  font-family: var(--profile-font-mono);
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
  word-break: break-word;
  letter-spacing: 0.01em;
  display: flex;
  flex-direction: column; /* always two rows: provider + date */
  align-items: flex-start;
  gap: 2px;
}

.profile-meta-line .meta-date {
  display: block;
}

/* Hide the middle dot when stacked vertically */
.profile-meta-line .dot-sep {
  display: none;
}

@media (min-width: 480px) {
  .profile-meta-line {
    font-size: 12px;
    margin-top: 5px;
    gap: 3px;
  }
}

/* Icon control = 6px radius, no resting shadow */
.edit-ic {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  /* no box-shadow at rest */
}

.edit-ic:hover {
  border-color: var(--accent);
  background: var(--glow);
  box-shadow: var(--profile-hover-shadow);
}

.edit-ic:focus-visible {
  outline: 2px solid var(--accent2);
  outline-offset: 2px;
}

.edit-ic svg {
  width: 13px;
  height: 13px;
  stroke: var(--muted);
  fill: none;
  transition: stroke 0.2s ease;
}

.edit-ic:hover svg {
  stroke: var(--accent);
}

/* ── Sections ────────────────────────────────
   Form-page density (tighter than marketing 40/64/80).
   Rhythm still scales with viewport. */
.profile-section {
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}

@media (min-width: 480px) {
  .profile-section {
    padding: 26px 0;
  }
}

@media (min-width: 720px) {
  .profile-section {
    padding: 30px 0;
  }
}

.profile-section:last-child {
  border-bottom: none;
}

.block-eyebrow {
  font-family: var(--profile-font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent2);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

@media (min-width: 480px) {
  .block-eyebrow {
    margin-bottom: 14px;
  }
}

.block-eyebrow .dash {
  width: 14px;
  height: 1px;
  background: var(--accent2);
  flex-shrink: 0;
}

/* Panel rows = 8px, no resting shadow */
.contact-row,
.device-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 12px;
  padding: 12px 14px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
  /* no box-shadow at rest */
}

.contact-row:hover,
.device-row:hover {
  border-color: var(--accent);
  box-shadow: var(--profile-hover-shadow);
  transform: translateY(-1px);
}

.device-row {
  margin-bottom: 10px;
}

.device-row:last-child {
  margin-bottom: 0;
}

.device-list {
  margin-bottom: 16px;
}

/* Device meta: chip sits under browser name on narrow screens */
.device-row .meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.device-row .device-current-chip {
  margin-left: 0;
  margin-top: 0;
}

.contact-k {
  font-family: var(--profile-font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.contact-v {
  font-family: var(--profile-font-display);
  font-size: 14px;
  font-weight: 600;
  margin-top: 3px;
  word-break: break-word;
  color: var(--text);
}

.device-row .contact-v {
  margin-top: 0;
}

/* Pill chip — radius left alone */
.verify-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--profile-font-mono);
  font-size: 10.5px;
  color: var(--accent);
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 9px;
  margin-left: 6px;
  letter-spacing: 0.02em;
  /* no shadow */
}

.muted {
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.6;
  font-family: var(--profile-font-body);
}

/* ── Inline forms ──────────────────────────── */
.profile-inline-form {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: stretch; /* input + buttons share one row height */
  gap: 10px;
}

/* Hint line above the input (e.g. "code sent to …") gets its own row */
.profile-inline-form > p {
  flex-basis: 100%;
  margin: 0;
}

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

.profile-inline-form input {
  flex: 1 1 100%;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 4px; /* control = 4px */
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: var(--profile-font-body);
  font-size: 14px;
  transition: border-color 0.2s ease;
  /* no shadow at rest */
}

@media (min-width: 480px) {
  .profile-inline-form input {
    flex: 1 1 220px;
  }
}

.profile-inline-form input:hover {
  border-color: var(--accent);
}

.profile-inline-form input:focus-visible {
  outline: 2px solid var(--accent2);
  outline-offset: 1px;
  border-color: var(--accent);
}

/* Status / validation message under a control.
   Body font (not mono): these are full Kazakh sentences and the mono
   stack falls back to a system font for ұ ғ қ ә ө і. */
.field-status {
  flex-basis: 100%;
  font-size: 13px;
  font-family: var(--profile-font-body);
  color: var(--muted);
  min-height: 1.3em;
  line-height: 1.4;
}

.field-status.field-status-ok {
  color: var(--accent);
}

/* Error — backend moderation, taken/reserved username, bad format, network */
.field-status.field-status-error {
  position: relative;
  display: block; /* inline flow so word chips sit inside the sentence */
  padding-left: 20px;
  color: var(--profile-danger);
  font-weight: 500;
}

.field-status.field-status-error::before {
  content: "!";
  position: absolute;
  left: 0;
  top: 2px;
  width: 14px;
  height: 14px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
}

/* Offending word(s) named by the backend (bio moderation) */
.field-status mark.bad-word {
  display: inline-block;
  padding: 0 6px;
  margin: 1px 1px;
  border: 1px solid var(--profile-danger-ring);
  border-radius: 4px;
  background: var(--profile-danger-bg);
  color: var(--profile-danger);
  font-family: var(--profile-font-mono);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  word-break: break-all;
}

/* Invalid control — set from JS via aria-invalid (see setStatus) */
.profile-inline-form input[aria-invalid="true"],
.profile-inline-form textarea[aria-invalid="true"] {
  border-color: var(--profile-danger);
  background: var(--profile-danger-bg);
}

.profile-inline-form input[aria-invalid="true"]:hover,
.profile-inline-form textarea[aria-invalid="true"]:hover {
  border-color: var(--profile-danger);
}

.profile-inline-form input[aria-invalid="true"]:focus-visible,
.profile-inline-form textarea[aria-invalid="true"]:focus-visible {
  border-color: var(--profile-danger);
  outline: 2px solid var(--profile-danger-ring);
  outline-offset: 1px;
}

/* ── Buttons: 4px radius, no resting shadow ── */
.btn-secondary,
.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1rem;
  border-radius: 4px;
  font-weight: 600;
  font-size: 13px;
  font-family: var(--profile-font-body);
  cursor: pointer;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  text-decoration: none;
  transition:
    border-color 0.2s ease,
    color 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
  white-space: nowrap;
  /* no box-shadow at rest */
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent2);
  background: var(--glow);
  box-shadow: var(--profile-hover-shadow);
}

.btn-secondary:focus-visible,
.btn-danger:focus-visible {
  outline: 2px solid var(--accent2);
  outline-offset: 2px;
}

.btn-danger {
  color: var(--profile-danger);
  border-color: var(--profile-danger-ring);
}

.btn-danger:hover {
  border-color: var(--profile-danger);
  background: var(--profile-danger-bg);
  box-shadow: 0 4px 14px var(--profile-danger-bg);
}

.profile-inline-form .btn-primary,
.profile-section .btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1rem;
  border-radius: 4px;
  font-weight: 600;
  font-size: 13px;
  font-family: var(--profile-font-body);
  cursor: pointer;
  border: none;
  background: var(--accent);
  color: var(--accent-foreground);
  white-space: nowrap;
  text-decoration: none;
  transition:
    opacity 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
  /* no box-shadow at rest */
  position: relative;
}

.profile-inline-form .btn-primary:hover,
.profile-section .btn-primary:hover {
  opacity: 0.92;
  transform: translateY(-1px);
  box-shadow: var(--profile-hover-shadow);
}

.profile-inline-form .btn-primary:active,
.profile-section .btn-primary:active {
  transform: translateY(0);
  box-shadow: none;
}

.profile-inline-form .btn-primary:focus-visible,
.profile-section .btn-primary:focus-visible {
  outline: 2.5px solid var(--accent2);
  outline-offset: 2px;
}

.profile-inline-form .btn-primary:disabled,
.profile-section .btn-primary:disabled,
.btn-secondary:disabled,
.btn-danger:disabled {
  opacity: 0.6;
  cursor: default;
  transform: none;
  box-shadow: none;
}

/* Subtle spinner while primary / danger actions are in flight */
.btn-primary.is-loading,
.btn-secondary.is-loading,
.btn-danger.is-loading {
  pointer-events: none;
}

.btn-primary.is-loading::after,
.btn-secondary.is-loading::after,
.btn-danger.is-loading::after {
  content: '';
  width: 12px;
  height: 12px;
  margin-left: 8px;
  border: 1.5px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: profile-btn-spin 0.65s linear infinite;
  flex-shrink: 0;
}

@keyframes profile-btn-spin {
  to { transform: rotate(360deg); }
}

/* ── Decode scramble (name, username, bio, contact, share link) ─
   JS freezes width/height while .is-scrambling so glyph widths can't
   push neighbours (pencil icon, buttons) around. */
.contact-v.decode-pending {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.is-scrambling {
  font-variant-numeric: tabular-nums;
}

.profile-name.is-scrambling,
#usernameDisplay.is-scrambling {
  white-space: nowrap;
}

/* Soft live pulse for verify chip (optional accent) */
.verify-chip .live-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  animation: profile-live-pulse 2.2s ease-in-out infinite;
}

@keyframes profile-live-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.35; }
}

@media (prefers-reduced-motion: reduce) {
  .verify-chip .live-dot {
    animation: none;
  }
  .profile-card:hover .profile-avatar {
    transform: none;
  }
}

/* ── Danger zone ───────────────────────────── */
.danger-zone {
  margin-top: 20px;
  padding-top: 28px;
  border-top: 1px solid rgba(192, 57, 43, 0.18);
  border-left: 3px solid rgba(192, 57, 43, 0.35);
  padding-left: 14px;
  margin-left: -2px;
}

@media (min-width: 480px) {
  .danger-zone {
    margin-top: 24px;
    padding-top: 32px;
    padding-left: 16px;
  }
}

.danger-zone .block-eyebrow {
  color: var(--profile-danger);
}

.danger-zone .block-eyebrow .dash {
  background: var(--profile-danger);
}

.danger-zone p {
  margin-bottom: 14px;
}

#deleteConfirm[hidden] {
  display: none !important;
}

#deleteConfirm:not([hidden]) {
  padding: 14px;
  background: var(--bg2);
  border: 1px solid rgba(192, 57, 43, 0.25);
  border-radius: 8px; /* panel */
  margin-top: 12px;
  /* no resting shadow */
}

#deleteConfirm p {
  margin-bottom: 12px;
  font-family: var(--profile-font-body);
  font-size: 14px;
  color: var(--text);
  flex-basis: 100%;
}

/* Mobile: stack the two confirm buttons full-width for easier tapping */
@media (max-width: 479px) {
  #deleteConfirm:not([hidden]) {
    flex-direction: column;
    align-items: stretch;
  }
  #deleteConfirm .btn-danger,
  #deleteConfirm .btn-secondary {
    width: 100%;
    justify-content: center;
  }
}


/* ── Public profile section (mobile-first) ──── */
.public-section-lead {
  margin-bottom: 12px;
  font-size: 13px;
  line-height: 1.5;
}

.visibility-card {
  padding: 12px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 14px;
}

.visibility-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.visibility-status {
  font-family: var(--profile-font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 2px 8px;
  border-radius: 999px;
}

.visibility-status.is-private {
  color: var(--muted);
  background: rgba(0, 0, 0, 0.06);
}

.visibility-status.is-public {
  color: #1a5c3a;
  background: rgba(46, 125, 80, 0.12);
}

/* Compact segmented control — fits one row on narrow phones */
.visibility-seg {
  display: inline-flex;
  width: 100%;
  max-width: 100%;
  padding: 3px;
  gap: 0;
  margin-bottom: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-sizing: border-box;
}

.visibility-opt {
  appearance: none;
  flex: 1 1 0;
  min-width: 0;
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: var(--profile-font-body);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  padding: 7px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.visibility-opt:hover:not(:disabled):not(.is-active) {
  color: var(--text);
}

.visibility-opt.is-active {
  background: var(--accent);
  color: var(--accent-foreground);
}

.visibility-opt:disabled {
  opacity: 0.55;
  cursor: default;
}

.visibility-hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
}

.public-fields {
  margin-bottom: 4px;
}

/* Slightly roomier segment on larger screens — still compact */
@media (min-width: 480px) {
  .visibility-card {
    padding: 12px 14px;
  }

  .visibility-seg {
    width: auto;
    min-width: 200px;
    max-width: 240px;
  }

  .visibility-opt {
    padding: 7px 14px;
    font-size: 13px;
  }
}

@media (min-width: 720px) {
  .public-section-lead {
    font-size: 13.5px;
    margin-bottom: 14px;
  }
}

/* Share link card */
.share-hint {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
}

.share-link-block {
  margin-top: 14px;
  padding: 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg2);
}

.share-link-block-ready {
  border-color: rgba(46, 125, 80, 0.28);
  background: rgba(46, 125, 80, 0.06);
}

.share-link-block-warn {
  border-style: dashed;
}

.share-link-block .contact-k {
  margin-bottom: 8px;
}

.share-link-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.share-link-url {
  flex: 1 1 160px;
  min-width: 0;
  font-family: var(--profile-font-mono, ui-monospace, monospace);
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  word-break: break-all;
  line-height: 1.4;
}

.share-link-url:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.share-link-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.share-link-actions .btn-secondary {
  padding: 6px 12px;
  font-size: 12.5px;
  text-decoration: none;
}

.share-link-block .field-status {
  margin-top: 8px;
}

/* Public-profile textarea (edit bio) */
.profile-inline-form textarea {
  flex: 1 1 100%;
  width: 100%;
  min-height: 72px;
  padding: 10px 12px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: var(--profile-font-body);
  font-size: 14px;
  line-height: 1.45;
  resize: vertical;
  transition: border-color 0.2s ease;
}

.profile-inline-form textarea:hover {
  border-color: var(--accent);
}

.profile-inline-form textarea:focus-visible {
  outline: 2px solid var(--accent2, var(--accent));
  outline-offset: 1px;
  border-color: var(--accent);
}

/* Bio read-more + char counter */
.bio-display-wrap {
  min-width: 0;
}

.bio-text {
  white-space: pre-wrap;
  word-break: break-word;
}

/* line-clamp does not work well with pre-wrap — use normal when collapsed */
.bio-text.is-collapsed {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow: hidden;
  white-space: normal;
}

.bio-more-btn,
button.bio-more-btn,
.btn-text.bio-more-btn {
  display: inline-block;
  margin-top: 6px;
  padding: 0;
  border: none;
  background: none;
  font-family: var(--profile-font-body);
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  line-height: 1.3;
}

.bio-more-btn:hover {
  color: var(--accent2, var(--accent));
}

.bio-more-btn:focus-visible {
  outline: 2px solid var(--accent2);
  outline-offset: 2px;
  border-radius: 2px;
}

.bio-char-count {
  flex-basis: 100%;
  font-size: 12px;
  margin-top: 2px;
}