/* User profile (eToro-style) — cabuser.php?v=profile */
.cab-prof {
  --prof-card: #1c2128;
  --prof-card2: #222830;
  --prof-line: rgba(255, 255, 255, 0.08);
  --prof-green: #13c45c;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 8px 48px;
}

.cab-prof-overlay,
.cab-prof-modal {
  --prof-green: #13c45c;
  --prof-line: rgba(255, 255, 255, 0.08);
}

.cab-prof-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 4px 18px;
  border-bottom: 1px solid var(--prof-line);
  margin-bottom: 8px;
}

.cab-prof-identity {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.cab-prof-avatar {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  overflow: hidden;
  background: linear-gradient(135deg, #e11d48, #3b82f6 55%, #f8fafc);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: #fff;
  padding: 0;
  border: 0;
  cursor: pointer;
}

button.cab-prof-avatar:hover {
  outline: 2px solid rgba(19, 196, 92, 0.55);
  outline-offset: 2px;
}
button.cab-prof-avatar.is-lightbox {
  cursor: zoom-in;
}

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

.cab-prof-avatar svg {
  width: 24px;
  height: 24px;
  opacity: 0.9;
}

.cab-prof-avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
  color: #fff;
  text-transform: uppercase;
  user-select: none;
}

/* Club framed avatar on profile header (reuse shell hex + frame) */
.cab-prof-avatar.cab-avatar-club {
  position: relative;
  width: 56px;
  height: 64px;
  border-radius: 0;
  overflow: visible;
  background: transparent;
  outline: none;
}
button.cab-prof-avatar.cab-avatar-club:hover {
  outline: none;
  filter: brightness(1.06);
}
.cab-prof-avatar.cab-avatar-club .cab-avatar-club-inner {
  position: absolute;
  inset: 9% 12% 9% 12%;
  display: grid;
  place-items: center;
  overflow: hidden;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  -webkit-clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  background: linear-gradient(135deg, #3a3f4b, #1e2430);
}
.cab-prof-avatar.cab-avatar-club .cab-avatar-club-inner img,
.cab-prof-avatar.cab-avatar-club .cab-avatar-club-inner svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.cab-prof-avatar.cab-avatar-club .cab-avatar-club-inner svg {
  width: 60%;
  height: 60%;
  place-self: center;
}
.cab-prof-avatar.cab-avatar-club .cab-avatar-club-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  z-index: 2;
}

/* Smaller framed avatars on wall composer + posts */
.cab-prof-composer .cab-prof-avatar.cab-avatar-club,
.cab-prof-compose-row .cab-prof-avatar.cab-avatar-club,
.cab-prof-post-user .cab-prof-avatar.cab-avatar-club {
  width: 44px;
  height: 50px;
  cursor: default;
}

.cab-prof-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
}

.cab-prof-uname {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cab-prof-meta .cab-club-badge img {
  width: 80px;
  height: auto;
}

.cab-prof-menu-wrap {
  position: relative;
  flex-shrink: 0;
}

.cab-prof-head-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

.cab-prof-dm-btn {
  position: relative;
}

.cab-prof-dm-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #e11d48;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  pointer-events: none;
}

.cab-prof-menu-btn {
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 8px;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.cab-prof-menu-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.cab-prof-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 230px;
  background: #252b34;
  border: 1px solid var(--prof-line);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  padding: 6px;
  z-index: 40;
  display: none;
}

.cab-prof-menu.is-open {
  display: block;
}

.cab-prof-menu-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.92rem;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
}

.cab-prof-menu-row:hover {
  background: rgba(255, 255, 255, 0.05);
}

.cab-prof-menu-row .opt-left {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.cab-prof-toggle {
  position: relative;
  width: 40px;
  height: 22px;
  border-radius: 999px;
  background: #3a424e;
  border: 0;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  transition: background 0.15s ease;
}

.cab-prof-toggle::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.15s ease;
}

.cab-prof-toggle.is-on {
  background: var(--prof-green);
}

.cab-prof-toggle.is-on::after {
  transform: translateX(18px);
}

.cab-prof-tabs {
  display: flex;
  justify-content: center;
  gap: 28px;
  padding: 14px 0 18px;
  border-bottom: 1px solid var(--prof-line);
  margin-bottom: 20px;
}

.cab-prof-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  padding: 8px 4px 12px;
  cursor: pointer;
  position: relative;
}

.cab-prof-tab svg {
  width: 18px;
  height: 18px;
  opacity: 0.85;
}

.cab-prof-tab.is-active {
  color: #fff;
}

.cab-prof-tab.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
}

.cab-prof-panel[hidden] {
  display: none !important;
}

.cab-prof-activity-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 4px;
}
.cab-notif-pnl.is-pos { color: #4ade80; font-weight: 600; }
.cab-notif-pnl.is-neg { color: #f87171; font-weight: 600; }
.cab-prof-activity .cab-bell-item {
  border-radius: 12px;
}
.cab-prof-activity-empty {
  margin: 12px 4px 4px;
  font-size: 13px;
  color: var(--muted, #9aa3af);
}
.cab-prof-activity-more {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.03);
  color: #fff;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}
.cab-prof-activity-more:hover {
  background: rgba(19, 196, 92, .1);
  border-color: rgba(19, 196, 92, .35);
}
.cab-prof-activity-more[hidden] {
  display: none !important;
}
.cab-prof-tab[hidden] {
  display: none !important;
}

.cab-prof-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 18px;
  align-items: start;
}

.cab-prof-main {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.cab-prof-card {
  background: var(--prof-card);
  border-radius: 12px;
  padding: 16px 18px;
  border: 1px solid transparent;
}

.cab-prof-card-title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 12px;
  color: var(--text);
}

.cab-prof-perf-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.cab-prof-perf-head .cab-prof-card-title {
  margin: 0;
}
.cab-prof-perf-ranges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.cab-prof-perf-range {
  min-width: 40px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 650;
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.cab-prof-perf-range:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.28);
}
.cab-prof-perf-range.is-active {
  border-color: rgba(19, 196, 92, 0.35);
  background: rgba(19, 196, 92, 0.1);
  color: #13c45c;
}
html[data-theme="light"] .cab-prof-perf-range {
  border-color: rgba(15, 23, 42, 0.14);
}
html[data-theme="light"] .cab-prof-perf-range:hover {
  border-color: rgba(15, 23, 42, 0.28);
  color: #0f172a;
}
html[data-theme="light"] .cab-prof-perf-range.is-active {
  border-color: rgba(19, 196, 92, 0.4);
  background: rgba(19, 196, 92, 0.12);
  color: #0f9f4a;
}

.cab-prof-perf-chart {
  min-height: 180px;
  border-radius: 8px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px) 0 0 / 100% 28px,
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px) 0 0 / 40px 100%,
    #171b22;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 14px;
  overflow: hidden;
}
.cab-prof-perf-chart[hidden] {
  display: none !important;
}

.cab-prof-perf-chart.has-data {
  place-items: stretch;
  padding: 8px 4px 0;
  color: inherit;
}

.cab-prof-perf-svg {
  display: block;
  width: 100%;
  height: 180px;
}

.cab-prof-perf-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 20px;
}

.cab-prof-metric .lbl {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.8rem;
  margin-bottom: 4px;
}

.cab-prof-metric .lbl .i {
  width: 14px;
  height: 14px;
  opacity: 0.55;
}

.cab-prof-metric .val {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
}

.cab-prof-metric .val.box {
  display: inline-flex;
  min-width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--prof-line);
  border-radius: 4px;
  font-size: 0.9rem;
}

.cab-prof-composer {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cab-prof-composer-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cab-prof-composer-input {
  flex: 1;
  min-height: 44px;
  border-radius: 10px;
  border: 1px solid var(--prof-line);
  background: #171b22;
  color: var(--muted);
  padding: 12px 14px;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.cab-prof-composer-input:hover {
  border-color: rgba(255, 255, 255, 0.16);
}

.cab-prof-composer-actions {
  display: flex;
  gap: 8px;
}

.cab-prof-chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
}

.cab-prof-chip-btn:hover,
.cab-prof-chip-btn.is-on {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.cab-prof-chip-btn svg {
  width: 16px;
  height: 16px;
}

.cab-prof-pinned-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.cab-prof-pinned-body p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
  max-width: 360px;
}

.cab-prof-pinned-illu {
  width: 120px;
  height: 72px;
  border-radius: 10px;
  background: linear-gradient(160deg, #2a3140, #1a1f28);
  border: 1px solid var(--prof-line);
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.cab-prof-pinned-illu::before {
  content: "";
  position: absolute;
  inset: 12px 18px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
}

.cab-prof-pinned-illu::after {
  content: "⋮";
  position: absolute;
  top: 18px;
  right: 28px;
  color: rgba(255, 255, 255, 0.45);
  font-size: 14px;
}

.cab-prof-disc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.cab-prof-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cab-prof-pill {
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
}

.cab-prof-pill.is-active {
  background: #fff;
  color: #111;
  border-color: #fff;
}

.cab-prof-empty {
  display: grid;
  place-items: center;
  padding: 28px 12px 12px;
}

.cab-prof-empty[hidden] {
  display: none !important;
}

.cab-prof-empty img {
  width: min(280px, 70vw);
  height: min(280px, 70vw);
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.cab-prof-feed {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cab-prof-post {
  background: #171b22;
  border: 1px solid var(--prof-line);
  border-radius: 12px;
  padding: 14px;
}

.cab-prof-post-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.cab-prof-post-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cab-prof-post-user .meta b {
  display: block;
  font-size: 0.92rem;
}

.cab-prof-post-user .meta small {
  color: var(--muted);
  font-size: 0.78rem;
}

.cab-prof-post-body {
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.45;
  margin: 0 0 10px;
}

/* News repost — full news-item style (media on top, text below) */
.cab-prof-post.is-news-repost {
  padding: 12px 12px 10px;
  overflow: hidden;
}
.cab-prof-news-item {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0 0 8px;
}
.cab-prof-news-media {
  display: block;
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  background: #0b0e13;
  border: 1px solid var(--prof-line);
  line-height: 0;
}
.cab-prof-news-media img,
.cab-prof-news-media video {
  display: block;
  width: 100%;
  max-height: 520px;
  object-fit: cover;
  background: #0b0e13;
}
.cab-prof-news-media.is-video video {
  max-height: 560px;
  object-fit: contain;
  background: #000;
}
.cab-prof-news-media.is-gallery {
  display: grid;
  gap: 4px;
  border: 0;
  background: transparent;
  border-radius: 0;
}
.cab-prof-news-media.is-gallery[data-count="2"] {
  grid-template-columns: 1fr 1fr;
}
.cab-prof-news-media.is-gallery[data-count="3"],
.cab-prof-news-media.is-gallery[data-count="4"] {
  grid-template-columns: 1fr 1fr;
}
.cab-prof-news-shot {
  display: block;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--prof-line);
  background: #0b0e13;
  min-height: 140px;
}
.cab-prof-news-shot img {
  width: 100%;
  height: 100%;
  min-height: 140px;
  max-height: 260px;
  object-fit: cover;
}
.cab-prof-news-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 2px;
}
.cab-prof-news-text {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.5;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}
.cab-prof-news-more {
  align-self: flex-start;
  font-size: 0.86rem;
  font-weight: 650;
  color: #13c45c;
  text-decoration: none;
}
.cab-prof-news-more:hover {
  text-decoration: underline;
}

.cab-prof-post-gallery {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}
.cab-prof-post-gallery[data-count="1"] {
  grid-template-columns: 1fr;
}
.cab-prof-post-gallery[data-count="2"] {
  grid-template-columns: 1fr 1fr;
}
.cab-prof-post-gallery[data-count="3"],
.cab-prof-post-gallery[data-count="4"] {
  grid-template-columns: 1fr 1fr;
}
.cab-prof-post-img {
  display: block;
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 0;
  cursor: zoom-in;
  background: #0f1318;
  content-visibility: auto;
  contain-intrinsic-size: 400px 220px;
}
.cab-prof-post-gallery[data-count="1"] .cab-prof-post-img {
  max-height: 420px;
}
.cab-prof-post-gallery:not([data-count="1"]) .cab-prof-post-img {
  max-height: 220px;
  aspect-ratio: 1 / 1;
}
.cab-prof-post-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-top: 4px;
}
.cab-prof-post-like {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.82rem;
  padding: 4px 6px;
  border-radius: 8px;
  cursor: pointer;
  line-height: 1;
  transition: color .15s ease;
}
.cab-prof-post-like:hover {
  color: #fb7185;
}
.cab-prof-post-like svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.cab-prof-post-like.is-liked {
  color: #f43f5e;
}
.cab-prof-post-like.is-liked svg {
  fill: currentColor;
  stroke: currentColor;
}
.cab-prof-post-like:active:not(:disabled) svg {
  transform: scale(1.15);
}

.cab-prof-emoji-pop {
  position: absolute;
  left: 18px;
  bottom: 64px;
  z-index: 5;
  width: min(320px, calc(100% - 36px));
  max-height: 180px;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid var(--prof-line);
  background: #1a1f28;
  box-shadow: 0 12px 32px rgba(0,0,0,.4);
}
.cab-prof-emoji-pop[hidden] {
  display: none !important;
}
.cab-prof-emoji-pop button {
  border: 0;
  background: transparent;
  border-radius: 8px;
  font-size: 1.2rem;
  line-height: 1.4;
  cursor: pointer;
  padding: 4px;
}
.cab-prof-emoji-pop button:hover {
  background: rgba(255,255,255,.06);
}
.cab-prof-modal {
  position: relative;
}
.cab-prof-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
}
.cab-prof-preview-grid img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}

.cab-prof-lightbox {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.cab-prof-lightbox[hidden] {
  display: none !important;
}
.cab-prof-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.82);
}
.cab-prof-lightbox-stage {
  position: relative;
  z-index: 1;
  max-width: min(920px, calc(100vw - 48px));
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cab-prof-lightbox-stage img {
  display: block;
  width: auto;
  height: auto;
  max-width: min(100%, calc(100vw - 48px));
  max-height: 85vh;
  margin: 0 auto;
  border-radius: 10px;
  object-fit: contain;
  background: #0b0d10;
  /* Never upscale past intrinsic size — shrink only to fit viewport */
  image-rendering: auto;
}
.cab-prof-lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: rgba(0,0,0,.55);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}
.cab-prof-lightbox-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(0,0,0,.55);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}
.cab-prof-lightbox-nav.is-prev { left: 16px; }
.cab-prof-lightbox-nav.is-next { right: 16px; }
.cab-prof-lightbox-nav[hidden] { display: none !important; }
.cab-prof-lightbox-counter {
  position: absolute;
  left: 50%;
  bottom: -28px;
  transform: translateX(-50%);
  color: rgba(255,255,255,.8);
  font-size: 0.85rem;
  white-space: nowrap;
}
body.cab-prof-lightbox-open {
  overflow: hidden;
}

.cab-prof-poll {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cab-prof-poll-opt {
  position: relative;
  border: 1px solid var(--prof-line);
  border-radius: 8px;
  overflow: hidden;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  padding: 10px 12px;
  cursor: pointer;
}

.cab-prof-poll-opt .bar {
  position: absolute;
  inset: 0 auto 0 0;
  background: rgba(19, 196, 92, 0.18);
  pointer-events: none;
}

.cab-prof-poll-opt .row {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  z-index: 1;
}

.cab-prof-poll-opt.is-mine {
  border-color: var(--prof-green);
}

.cab-prof-post-menu {
  position: relative;
}

.cab-prof-post-menu-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: 6px;
}

.cab-prof-post-menu-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.cab-prof-post-dd {
  position: absolute;
  right: 0;
  top: 100%;
  min-width: 140px;
  background: #252b34;
  border: 1px solid var(--prof-line);
  border-radius: 10px;
  padding: 4px;
  z-index: 5;
  display: none;
}

.cab-prof-post-dd.is-open {
  display: block;
}

.cab-prof-post-dd button {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.86rem;
  text-align: left;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
}

.cab-prof-post-dd button:hover {
  background: rgba(255, 255, 255, 0.06);
}

.cab-prof-about .hint {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
  margin: 0 0 14px;
}

.cab-prof-about .bio-text {
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.5;
  margin: 0 0 14px;
  white-space: pre-wrap;
}

.cab-prof-btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  border: 1.5px solid var(--prof-green);
  color: var(--prof-green);
  background: transparent;
  font: inherit;
  font-weight: 600;
  font-size: 0.92rem;
  padding: 10px 14px;
  border-radius: 999px;
  cursor: pointer;
}

.cab-prof-btn-outline:hover {
  background: rgba(19, 196, 92, 0.1);
}

.cab-prof-about-stats {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 0;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--prof-line);
  text-align: center;
}

.cab-prof-about-stats span {
  flex: 1;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}

.cab-prof-about-stats .sep {
  width: 1px;
  background: var(--prof-line);
  flex: 0 0 1px;
}

.cab-prof-about .cab-prof-copy-actions {
  margin-top: 14px;
}

.cab-prof-about .cab-prof-copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  box-sizing: border-box;
  border: 1.5px solid var(--prof-green, #13c45c);
  color: var(--prof-green, #13c45c);
  background: rgba(19, 196, 92, 0.1);
  font: inherit;
  font-weight: 600;
  font-size: 0.92rem;
  padding: 10px 14px;
  border-radius: 999px;
  cursor: pointer;
}

.cab-prof-about .cab-prof-copy-btn:hover {
  filter: brightness(1.06);
  background: rgba(19, 196, 92, 0.16);
}

.cab-prof-about .cab-prof-copy-btn.is-copying {
  background: rgba(19, 196, 92, 0.22);
  border-color: #2f6b4f;
}

/* Modals */
.cab-prof-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 16px;
}

.cab-prof-overlay[hidden] {
  display: none !important;
}

.cab-prof-modal {
  width: min(560px, 100%);
  background: #1a1e26;
  border: 1px solid var(--prof-line);
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  max-height: min(90vh, 760px);
  overflow: auto;
}

.cab-prof-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 8px;
}

.cab-prof-modal-head h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
}

.cab-prof-modal-x {
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.cab-prof-modal-x:hover {
  background: rgba(255, 255, 255, 0.06);
}

.cab-prof-modal-body {
  padding: 8px 18px 16px;
}

.cab-prof-compose-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.cab-prof-compose-row textarea {
  flex: 1;
  min-height: 90px;
  resize: vertical;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  outline: none;
}

.cab-prof-compose-row textarea::placeholder {
  color: var(--muted);
}

.cab-prof-poll-box {
  margin-top: 12px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 10px;
  padding: 12px;
}

.cab-prof-poll-box-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  font-weight: 600;
}

.cab-prof-poll-box-head .x {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: transparent;
  color: #fff;
  cursor: pointer;
}

.cab-prof-opt {
  position: relative;
  margin-bottom: 8px;
}

.cab-prof-opt input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--prof-line);
  background: #14181f;
  color: var(--text);
  border-radius: 8px;
  padding: 12px 52px 12px 12px;
  font: inherit;
}

.cab-prof-opt .cnt {
  position: absolute;
  right: 10px;
  bottom: 10px;
  font-size: 0.75rem;
  color: var(--muted);
}

.cab-prof-add-opt {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  border: 1.5px solid var(--prof-green);
  color: var(--prof-green);
  background: transparent;
  font: inherit;
  font-weight: 600;
  font-size: 0.88rem;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
}

.cab-prof-preview {
  margin-top: 10px;
  position: relative;
  display: none;
}

.cab-prof-preview.is-on {
  display: block;
}

.cab-prof-preview img {
  max-width: 100%;
  max-height: 220px;
  border-radius: 10px;
  display: block;
}

.cab-prof-preview .rm {
  position: absolute;
  top: 8px;
  right: 8px;
  border: 0;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  border-radius: 999px;
  width: 28px;
  height: 28px;
  cursor: pointer;
}

.cab-prof-modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px 16px;
  border-top: 1px solid var(--prof-line);
}

.cab-prof-modal-foot .left {
  display: flex;
  gap: 4px;
}

.cab-prof-modal-foot .right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cab-prof-char {
  color: var(--muted);
  font-size: 0.82rem;
}

.cab-prof-post-btn {
  border: 0;
  background: #2a313c;
  color: #8b939e;
  font: inherit;
  font-weight: 700;
  padding: 10px 22px;
  border-radius: 999px;
  cursor: not-allowed;
  min-width: 88px;
}

.cab-prof-post-btn.is-ready {
  background: #13c45c !important;
  color: #04140a !important;
  cursor: pointer;
}

.cab-prof-post-btn.is-ready:hover {
  filter: brightness(1.08);
}

.cab-prof-bio-link {
  color: #13c45c;
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-all;
}

.cab-prof-about .bio-text a.cab-prof-bio-link {
  color: #13c45c;
}

.cab-prof-bio-modal textarea {
  width: 100%;
  min-height: 140px;
  box-sizing: border-box;
  border: 1px solid var(--prof-line, rgba(255,255,255,.08));
  background: #14181f;
  color: var(--text, #f4f5f7);
  border-radius: 10px;
  padding: 12px;
  font: inherit;
  resize: vertical;
}

.cab-prof-share-modal .social-share {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 8px 4px 4px;
}

.cab-prof-share-modal .share-label {
  width: 100%;
  text-align: center;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 4px;
}

.cab-prof-share-modal .share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #242a33;
  border: 1px solid var(--prof-line);
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.cab-prof-share-modal .share-btn:hover {
  transform: translateY(-2px);
  background: #2c3440;
}

.cab-prof-tab-portfolio .page-title-row,
.cab-prof-tab-portfolio .btn-ghost {
  display: none;
}

.cab-prof-tab-portfolio .pp-open-positions-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.cab-prof-tab-portfolio .pp-open-positions-head .pm-section-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.cab-prof-chart .wl-toolbar,
.cab-prof-chart .wl-head-alert,
.cab-prof-chart #wl-add-toggle,
.cab-prof-chart .wl-picker,
.cab-prof-chart .wl-alert-btn {
  display: none !important;
}

/* Desktop chart board — no alert column (same as watchlist minus last col).
   Do NOT use !important: mobile @media in cab-shell.css must win. */
.cab-prof-chart .wl-head,
.cab-prof-chart .wl-row {
  grid-template-columns: minmax(160px, 1.35fr) minmax(110px, 0.85fr) minmax(100px, 0.9fr) minmax(88px, 0.7fr) minmax(88px, 0.7fr) minmax(140px, 1fr);
}

.cab-prof-chart .wl-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}

.cab-prof-chart .wl-board {
  margin-top: 0;
}

.cab-prof-chart .pf-section {
  margin-top: 0;
}

.cab-prof-chart .pf-section h2 {
  font-size: 1.05rem;
  margin: 0 0 12px;
}

/* Match watchlist mobile board layout (cab-shell.css @900px) */
@media (max-width: 900px) {
  .cab-prof-chart .wl-head {
    display: none;
  }
  .cab-prof-chart .wl-row {
    grid-template-columns: 1fr 1fr;
    gap: 12px 10px;
    padding: 16px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 0;
  }
  .cab-prof-chart .wl-mkt {
    grid-column: 1 / -1;
  }
  .cab-prof-chart .wl-chg {
    text-align: left;
  }
  .cab-prof-chart .wl-spark-cell {
    justify-content: flex-end;
  }
  .cab-prof-chart .wl-range {
    grid-column: 1 / -1;
  }
}

@media (max-width: 960px) {
  .cab-prof-grid {
    grid-template-columns: 1fr;
  }
  /* About card above posts / performance on mobile */
  .cab-prof-about {
    order: -1;
  }
  .cab-prof-tabs {
    gap: 16px;
  }
}

/* Direct messages */
.cab-prof-dm-modal {
  width: min(560px, 100%);
  max-height: min(92vh, 780px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
}

.cab-prof-dm-head {
  gap: 8px;
  flex-shrink: 0;
}

.cab-prof-dm-head-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.cab-prof-dm-head-main h3 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cab-prof-dm-back {
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  color: var(--text, #fff);
  border-radius: 8px;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.cab-prof-dm-back:hover {
  background: rgba(255, 255, 255, 0.06);
}

.cab-prof-dm-peer-av {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(135deg, #e11d48, #3b82f6 55%, #f8fafc);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
}

.cab-prof-dm-peer-av img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cab-prof-dm-panels {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.cab-prof-dm-inbox {
  flex: 1;
  min-height: 280px;
  max-height: min(60vh, 480px);
  overflow-y: auto;
  padding: 4px 8px 16px;
}

.cab-prof-dm-empty {
  padding: 36px 20px;
  text-align: center;
  color: var(--muted, #9aa4b2);
}

.cab-prof-dm-empty p {
  margin: 0 0 6px;
  font-weight: 600;
  color: var(--text, #fff);
}

.cab-prof-dm-empty .sub {
  font-weight: 400;
  font-size: 0.88rem;
  color: var(--muted, #9aa4b2);
}

.cab-prof-dm-inbox-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 10px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  border-radius: 10px;
  cursor: pointer;
}

.cab-prof-dm-inbox-row:hover {
  background: rgba(255, 255, 255, 0.05);
}

.cab-prof-dm-inbox-row .av {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(135deg, #e11d48, #3b82f6 55%, #f8fafc);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: #fff;
  font-weight: 700;
}

.cab-prof-dm-inbox-row .av img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cab-prof-dm-inbox-row .meta {
  min-width: 0;
  flex: 1;
}

.cab-prof-dm-inbox-row .name {
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cab-prof-dm-inbox-row .preview {
  font-size: 0.86rem;
  color: var(--muted, #9aa4b2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.cab-prof-dm-inbox-row .when {
  font-size: 0.75rem;
  color: var(--muted, #9aa4b2);
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: 2px;
}

.cab-prof-dm-inbox-row .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #1d9bf0;
  flex-shrink: 0;
}

.cab-prof-dm-thread {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.cab-prof-dm-msgs {
  flex: 1;
  min-height: 220px;
  max-height: min(48vh, 420px);
  overflow-y: auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cab-prof-dm-bubble {
  max-width: 82%;
  padding: 10px 12px;
  border-radius: 16px;
  background: #252b34;
  color: var(--text, #fff);
  font-size: 0.95rem;
  line-height: 1.35;
  word-break: break-word;
  align-self: flex-start;
}

.cab-prof-dm-bubble.is-mine {
  align-self: flex-end;
  background: #1d9bf0;
  color: #fff;
  border-bottom-right-radius: 4px;
}

.cab-prof-dm-bubble:not(.is-mine) {
  border-bottom-left-radius: 4px;
}

.cab-prof-dm-bubble .dm-time {
  display: block;
  margin-top: 4px;
  font-size: 0.7rem;
  opacity: 0.7;
}

.cab-prof-dm-bubble .dm-imgs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 6px;
  margin-top: 6px;
}

.cab-prof-dm-bubble .dm-imgs img {
  width: 100%;
  border-radius: 10px;
  display: block;
  cursor: pointer;
}

.cab-prof-dm-compose {
  margin: 0 12px 12px;
  padding: 10px 12px 8px;
  border: 1px solid var(--prof-line);
  border-radius: 12px;
  background: var(--prof-card2, #222830);
  position: relative;
  flex-shrink: 0;
}

.cab-prof-dm-compose .cab-prof-compose-row {
  margin-top: 4px;
}

.cab-prof-dm-compose .cab-prof-compose-row textarea {
  min-height: 56px;
}

.cab-prof-dm-foot {
  padding: 8px 0 0;
  border-top: 0;
  margin-top: 4px;
}

.cab-prof-dm-compose .cab-prof-emoji-pop {
  bottom: 52px;
  left: 12px;
}

.cab-prof-dm-msgs-empty {
  margin: auto;
  text-align: center;
  color: var(--muted, #9aa4b2);
  padding: 24px;
  font-size: 0.9rem;
}

@media (max-width: 640px) {
  .cab-prof-perf-metrics {
    grid-template-columns: 1fr;
  }
  .cab-prof-tabs {
    overflow-x: auto;
    justify-content: flex-start;
  }
  .cab-prof-dm-modal {
    width: 100%;
    max-height: 94vh;
  }
}
