/* The public profile editor on the Profile tab and its crop dialog (public-profile.js), as approved in
   /mnt/project-files/public-profile/src/site/editor.html. Scoped to .ycp like /css/txlist.css, whose colours, fonts
   and .btn it uses. The sender's box preview is /css/profile-lookup.css. */
.pp-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ycp svg.i { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.pp { padding: 30px 32px 10px; max-width: 1180px; }
.pp-head { margin-bottom: 24px; }
.pp-head h1 { margin: 0; font-family: "titles", sans-serif !important; font-weight: 400; font-size: 32px; color: #E4E8EF; }
.pp-head p { margin: 8px 0 0; font-size: 15px; color: #A5ACB9; }
.pp-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.pp-grid > aside { min-width: 0; }
.pp-card { min-width: 0; padding: 22px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
.pp-card + .pp-card { margin-top: 18px; }
.pp-card h2 { margin: 0 0 4px; font-size: 16px; font-weight: 600; color: var(--text); }
.pp-card > .pp-sub { margin: 0 0 18px; font-size: 13px; color: var(--muted); line-height: 1.5; }
.pp-kicker { margin: 0 0 12px; font-size: 11px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--muted-2); }
.pp-notice { margin: -4px 0 18px; padding: 11px 14px; border-radius: 12px; font-size: 13px; line-height: 1.45; color: #F5C977; background: rgba(245, 185, 74, .08); border: 1px solid rgba(245, 185, 74, .25); white-space: pre-line; }

.pp-pic { display: flex; align-items: center; gap: 18px; padding-bottom: 20px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.pp-pic-actions { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; min-width: 0; }
.pp-pic-actions .row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.pp-pic-actions small { font-size: 12px; color: var(--muted); line-height: 1.45; max-width: 380px; }

.av { flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; overflow: hidden; background: var(--grad); color: #fff; font-weight: 600; line-height: 1; }
.av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.av.lg { width: 96px; height: 96px; font-size: 36px; }
.av.none { background: var(--surface-3); color: var(--muted); }

.pp-field { margin-bottom: 18px; min-width: 0; }
.pp-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.pp-field > label, .pp-label { display: block; margin: 0 0 7px; font-size: 13px; font-weight: 500; color: var(--text-2); }
.pp-field .opt { font-weight: 400; color: var(--muted-2); }
.ycp .pp-input { display: flex; align-items: center; gap: 2px; height: 44px; padding: 0 14px; border-radius: 11px; border: 1px solid var(--line-2); background: var(--bg); color: var(--muted); font-size: 14.5px; }
.ycp .pp-input:focus-within { border-color: #6B6BFF; box-shadow: 0 0 0 3px rgba(107, 107, 255, .16); }
.ycp .pp-input.bad { border-color: #E5566B; }
.ycp .pp-input input { width: 100%; flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; outline: 0; background: none; color: var(--text); font-size: 14.5px; }
.ycp .pp-input input[readonly] { color: var(--text-2); }
.ycp .pp-input .at { color: var(--muted-2); font-weight: 500; }
.ycp .pp-input .end { margin-left: 8px; display: inline-flex; color: var(--in); }
.ycp .pp-input .end.bad { color: #FF8A9A; }
.ycp .pp-input .end.wait { color: var(--muted); }
.ycp .pp-input .end.wait svg { animation: pp-spin .9s linear infinite; }
@keyframes pp-spin { to { transform: rotate(360deg); } }
.ycp textarea.pp-area { display: block; width: 100%; min-height: 84px; padding: 12px 14px; border-radius: 11px; border: 1px solid var(--line-2); background: var(--bg); color: var(--text); font-size: 14.5px; line-height: 1.5; resize: vertical; outline: 0; }
.ycp textarea.pp-area:focus { border-color: #6B6BFF; box-shadow: 0 0 0 3px rgba(107, 107, 255, .16); }
.ycp textarea.pp-area.bad { border-color: #E5566B; }
.ycp .pp-input input:disabled, .ycp textarea.pp-area:disabled { opacity: .6; }
.pp-hint { display: flex; justify-content: space-between; gap: 12px; margin-top: 7px; font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.pp-hint > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.pp-hint .count { flex: none; font-variant-numeric: tabular-nums; color: var(--muted-2); }
.pp-hint .count.over { color: #FF8A9A; }
.pp-hint.ok { color: var(--in); }
.pp-hint.bad { color: #FF8A9A; }
.pp-hint svg.i { margin: -2px 4px 0 0; }
.pp-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding-top: 4px; }
.ycp .btn.link { height: auto; padding: 0; border: 0; background: none; box-shadow: none; color: var(--link); font-weight: 500; }
.ycp .btn.link.muted { color: var(--muted); }
.ycp .btn.link:hover { color: var(--text); }

/* profile page link and the owner's switches */
.pp-page { margin: 4px 0 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.pp-link { display: flex; align-items: center; gap: 10px; min-width: 0; height: 46px; padding: 0 6px 0 14px; border-radius: 11px; border: 1px solid var(--line-2); background: var(--bg); color: var(--muted); margin-bottom: 8px; }
.pp-link .url { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); font-size: 14px; }
.ycp .pp-link .btn { height: 34px; padding: 0 12px; font-size: 13px; }
.pp-link-none { margin: 0 0 8px; padding: 12px 14px; border-radius: 11px; border: 1px dashed var(--line-2); font-size: 13px; color: var(--muted); }
.tg { display: flex; align-items: center; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.tg:last-child { border-bottom: 0; padding-bottom: 0; }
.tg-text { flex: 1; min-width: 0; }
.tg-text b { display: block; font-size: 14px; font-weight: 500; color: var(--text); }
.tg-text small { display: block; margin-top: 2px; font-size: 12.5px; line-height: 1.45; color: var(--muted); }
.ycp .sw { position: relative; flex: none; width: 42px; height: 24px; padding: 0; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--line-2); }
.ycp .sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #8A93A6; transition: left .15s; }
.ycp .sw[aria-checked="true"] { background: var(--grad); border-color: transparent; }
.ycp .sw[aria-checked="true"]::after { left: 20px; background: #fff; }
.ycp .sw:disabled { opacity: .55; cursor: default; }
/* The level switch (only while Levels and badges on public profiles are on) is the last row; while it is hidden the
   row above it is the last one. Its preview pill fades while the switch is off. */
.tg:has(+ .tg[hidden]:last-child) { border-bottom: 0; padding-bottom: 0; }
.lv-switch-preview { display: flex; margin-top: 8px; transition: opacity .15s; }
.tg:has(.sw[aria-checked="false"]) .lv-switch-preview { opacity: .4; }

/* the sender's view */
.ycp .pp-typed { margin-bottom: 10px; }
.pp-typed-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.pp-preview-none { margin: 0; font-size: 13px; line-height: 1.5; color: var(--muted); }

/* who sees what */
.pp-who { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.pp-who li { display: flex; gap: 10px; font-size: 13px; line-height: 1.5; color: var(--text-2); }
.pp-who svg.i { margin-top: 2px; color: var(--muted); }
.ycp .pp-stats-title { margin: 36px 0 0; font-size: 16px; font-weight: 600; color: var(--text); }

/* crop dialog */
.dlg-scrim[hidden] { display: none; }
.dlg-scrim { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(6, 8, 12, .72); overflow-y: auto; }
.dlg { width: 440px; max-width: 100%; margin: auto; padding: 22px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line-2); box-shadow: 0 30px 80px rgba(0,0,0,.5); }
.dlg h2 { margin: 0 0 4px; font-size: 17px; font-weight: 600; color: var(--text); }
.dlg > p { margin: 0 0 16px; font-size: 13px; color: var(--muted); line-height: 1.5; }
.crop { position: relative; width: 100%; aspect-ratio: 1; border-radius: 14px; overflow: hidden; background: #000; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
.crop.dragging { cursor: grabbing; }
.crop img { position: absolute; left: 0; top: 0; max-width: none; transform-origin: 0 0; pointer-events: none; -webkit-user-drag: none; }
.crop .mask { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle closest-side, transparent 0 92%, rgba(0,0,0,.62) 92.6%); }
.crop .ring { position: absolute; inset: 4%; pointer-events: none; border-radius: 50%; border: 2px solid rgba(255,255,255,.85); }
.zoom { display: flex; align-items: center; gap: 8px; margin: 16px 0 6px; color: var(--muted); }
.ycp .zoom-step { display: inline-flex; padding: 2px; border: 0; background: none; color: var(--muted); }
.ycp .zoom-step:hover { color: var(--text); }
.zoom input[type="range"] { --fill: 0%; flex: 1; min-width: 0; height: 18px; margin: 0; background: none; -webkit-appearance: none; appearance: none; cursor: pointer; }
.ycp .zoom input[type="range"]:focus-visible { outline-offset: 3px; border-radius: 9px; }
.zoom input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: linear-gradient(90deg, #9B7BFF, #3A8DF0) 0 / var(--fill) 100% no-repeat, var(--surface-3); }
.zoom input[type="range"]::-moz-range-track { height: 4px; border-radius: 4px; background: var(--surface-3); }
.zoom input[type="range"]::-moz-range-progress { height: 4px; border-radius: 4px; background: linear-gradient(90deg, #9B7BFF, #3A8DF0); }
.zoom input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; margin-top: -7px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.4); }
.zoom input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.4); }
.dlg-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.dlg .dlg-note { margin: 10px 0 0; font-size: 12px; color: var(--muted); line-height: 1.5; }
.dlg .dlg-err { margin: 12px 0 0; padding: 10px 12px; border-radius: 11px; font-size: 13px; line-height: 1.45; color: #FF9AA8; background: rgba(229, 86, 107, .08); border: 1px solid rgba(229, 86, 107, .25); }

@media (max-width: 1100px) { .pp-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 750px) {
  .pp-row { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .pp { padding: 20px 16px 10px; }
  .pp-head h1 { font-size: 26px; text-align: center; }
  .pp-head p { text-align: center; font-size: 14px; }
  .pp-card { padding: 18px; }
  .pp-pic { flex-direction: column; text-align: center; }
  .pp-pic-actions { align-items: center; }
  .pp-pic-actions .row { justify-content: center; }
  .pp-link { padding-left: 12px; }
  .pp-link .url { font-size: 13px; }
  .pp-link .lbl { display: none; }
  .pp-link > svg { display: none; }
  .ycp .pp-link .btn { width: 38px; padding: 0; justify-content: center; }
  .ycp .pp-stats-title { text-align: center; }
}
