/* Yapper Plus — device accent + profile background editor */

:root {
  --yapper-plus-gold: #5C77FF;
  --yapper-plus-panel: color-mix(in srgb, var(--card) 94%, transparent);
  --yapper-plus-soft: color-mix(in srgb, var(--primary) 11%, var(--bubble));
}

/* ---------------- Device accent ---------------- */
.plus-accent-block {
  position: relative;
  overflow: hidden;
}

.plus-accent-heading-row,
.plus-profile-card-heading,
.plus-editor-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.plus-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 3px 9px;
  border: 1px solid color-mix(in srgb, var(--primary) 58%, var(--border));
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 18%, var(--button));
  color: var(--text);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.plus-accent-choice-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 12px;
}

.plus-accent-choice-row button {
  width: 100%;
  min-height: 46px;
}

.plus-accent-choice-row button.active {
  background: var(--primary);
  color: var(--primary-text);
  border-color: var(--primary);
}

.plus-custom-accent-controls {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.plus-custom-accent-controls.hidden {
  display: none !important;
}

.plus-native-color-input {
  width: 48px !important;
  min-width: 48px !important;
  height: 46px !important;
  min-height: 46px !important;
  padding: 4px !important;
  margin: 0 !important;
  border-radius: 14px !important;
  cursor: pointer;
}

.plus-hex-input {
  margin: 0 !important;
  text-transform: uppercase;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.plus-inline-status {
  display: none;
  min-height: 0;
  margin: 10px 0 0;
  padding: 0 14px;
  border: 1px solid color-mix(in srgb, var(--border) 82%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--bubble) 88%, transparent);
  color: var(--secondary-text);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  align-items: center;
  min-width: 0;
  height: 38px;
  box-sizing: border-box;
}

.plus-inline-status:not(.is-empty) {
  display: flex;
}

.plus-inline-status.success {
  border-color: color-mix(in srgb, var(--primary) 56%, var(--border));
  background: color-mix(in srgb, var(--primary) 12%, var(--bubble));
  color: var(--text);
}

.plus-inline-status.error {
  border-color: color-mix(in srgb, var(--primary) 48%, var(--border));
  background: color-mix(in srgb, var(--primary) 10%, var(--bubble));
  color: var(--text);
}

/* ---------------- Edit Profile entry card ---------------- */
.plus-profile-background-card {
  margin: 14px 0 4px;
  padding: 15px;
  border: 1px solid color-mix(in srgb, var(--primary) 34%, var(--border));
  border-radius: 24px;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--primary) 10%, transparent), transparent 52%),
    var(--bubble);
  text-align: left;
}

.plus-profile-background-card h3 {
  margin: 0;
  font-size: 17px;
}

.plus-profile-background-card p {
  margin: 7px 0 12px;
  color: var(--secondary-text);
  font-size: 12px;
  line-height: 1.45;
}

.plus-profile-background-card button {
  width: 100%;
}

.plus-profile-background-card.is-locked button {
  opacity: .72;
}

/* ---------------- Saved profile background ---------------- */
#profileViewSection {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-radius: 25px;
}

#profileViewSection > :not(#profileBackgroundLayer) {
  position: relative;
  z-index: 2;
}

.profile-background-layer {
  position: absolute;
  z-index: 0;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
  pointer-events: none;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  opacity: 0;
  transition: opacity .18s ease;
}

#profileViewSection.plus-background-active {
  padding: 22px 16px 16px;
  border: 1px solid color-mix(in srgb, var(--primary) 34%, var(--border));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.14);
}

#profileViewSection.plus-background-active .profile-background-layer {
  opacity: 1;
}

#profileViewSection.plus-background-active .profile-display-name,
#profileViewSection.plus-background-active .profile-handle,
#profileViewSection.plus-background-active .profile-bio {
  width: fit-content;
  max-width: 96%;
  margin-left: auto;
  margin-right: auto;
  padding: 5px 11px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--card) 68%, transparent);
  text-shadow: 0 1px 3px rgba(0,0,0,.48);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12);
}

#profileViewSection.plus-background-active .profile-handle {
  margin-top: 6px;
}

#profileViewSection.plus-background-active .profile-bio {
  margin-top: 14px;
  margin-bottom: 14px;
}

#profileViewSection.plus-background-active .profile-stats,
#profileViewSection.plus-background-active .profile-connections-panel,
#profileViewSection.plus-background-active .profile-main-actions > button {
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.plus-saved-overlay {
  position: absolute;
  left: calc(var(--overlay-x, 50) * 1%);
  top: calc(var(--overlay-y, 50) * 1%);
  display: grid;
  place-items: center;
  width: var(--overlay-size, 16%);
  aspect-ratio: 1;
  container-type: inline-size;
  color: var(--overlay-color, #ffffff);
  transform:
    translate(-50%, -50%)
    rotate(var(--overlay-rotation, 0deg))
    scaleX(var(--overlay-flip-x, 1));
  transform-origin: center;
  line-height: 1;
  filter: drop-shadow(0 2px 5px rgba(0,0,0,.34));
}

.plus-saved-overlay > .plus-overlay-art,
.plus-saved-overlay > .plus-overlay-art > svg,
.plus-saved-overlay > .plus-overlay-art > span {
  width: 100%;
  height: 100%;
}

.plus-saved-overlay > .plus-overlay-art > span {
  display: grid;
  place-items: center;
  font-size: 88cqi;
  font-family: "Segoe UI Symbol", "Arial Unicode MS", sans-serif;
  color: currentColor;
  line-height: 1;
}

/* ---------------- Full editor shell ---------------- */
.plus-profile-editor-overlay {
  z-index: 2147483640 !important;
  padding: 12px !important;
  overscroll-behavior: contain;
}

.plus-profile-editor-modal {
  position: relative;
  width: min(1480px, calc(100vw - 24px));
  height: min(900px, calc(100dvh - 24px));
  max-width: none !important;
  max-height: none !important;
  padding: 0 !important;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden !important;
  border-radius: 30px !important;
  background: var(--card);
}

.plus-editor-header {
  min-width: 0;
  padding: 16px 66px 13px 20px;
  border-bottom: 1px solid var(--border);
}

.plus-editor-header h2 {
  margin: 0;
  font-size: clamp(22px, 3vw, 30px);
  line-height: 1.1;
}

.plus-editor-header p {
  margin: 5px 0 0;
  color: var(--secondary-text);
  font-size: 12px;
}

.plus-editor-preview-modes {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  min-width: 200px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bubble);
}

.plus-editor-preview-modes button {
  min-height: 36px;
  padding-inline: 14px;
  border: 0;
  box-shadow: none;
}

.plus-editor-preview-modes button.active {
  background: var(--primary);
  color: var(--primary-text);
}

.plus-mobile-tabs {
  display: none;
}

.plus-editor-body {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(270px, .82fr) minmax(420px, 1.35fr) minmax(280px, .88fr);
  background: color-mix(in srgb, var(--background) 62%, var(--card));
}

.plus-editor-panel {
  min-width: 0;
  min-height: 0;
  padding: 15px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.plus-editor-panel + .plus-editor-panel {
  border-left: 1px solid var(--border);
}

.plus-editor-panel h3,
.plus-editor-panel h4 {
  margin: 0;
}

.plus-editor-panel-description {
  margin: 5px 0 12px;
  color: var(--secondary-text);
  font-size: 12px;
  line-height: 1.45;
}

.plus-editor-section {
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--card);
  box-shadow: inset 0 1px 0 color-mix(in srgb, white 10%, transparent);
}

.plus-editor-section + .plus-editor-section {
  margin-top: 11px;
}

.plus-option-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.plus-option-grid.plus-background-type-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.plus-option-grid button {
  width: 100%;
  min-height: 42px;
  padding: 8px 9px;
  font-size: 12px;
}

.plus-option-grid button.active,
.plus-gradient-style-button.active {
  background: var(--primary);
  color: var(--primary-text);
  border-color: var(--primary);
}

.plus-control-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  margin-top: 10px;
}

.plus-control-row input[type="color"] {
  width: 48px !important;
  min-width: 48px !important;
  height: 43px !important;
  min-height: 43px !important;
  padding: 4px !important;
  margin: 0 !important;
  border-radius: 13px !important;
}

.plus-control-row input[type="text"] {
  margin: 0 !important;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-transform: uppercase;
}

.plus-gradient-preview {
  width: 100%;
  height: 54px;
  margin: 4px 0 10px;
  border: 1px solid color-mix(in srgb, var(--primary) 36%, var(--border));
  border-radius: 18px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12);
}

.plus-gradient-stop-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.plus-gradient-stop {
  display: grid;
  grid-template-columns: 34px 43px minmax(0, 1fr) 36px 36px 36px;
  gap: 6px;
  align-items: center;
}

.plus-gradient-stop-index {
  display: grid;
  place-items: center;
  height: 34px;
  border-radius: 10px;
  background: var(--bubble);
  font-size: 11px;
  font-weight: 900;
}

.plus-gradient-stop input[type="color"] {
  width: 43px !important;
  min-width: 43px !important;
  height: 38px !important;
  min-height: 38px !important;
  margin: 0 !important;
  padding: 3px !important;
  border-radius: 11px !important;
}

.plus-gradient-stop input[type="text"] {
  min-width: 0;
  margin: 0 !important;
  padding-inline: 9px !important;
  font-size: 11px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.plus-mini-icon-button {
  width: 36px !important;
  min-width: 36px !important;
  height: 36px !important;
  min-height: 36px !important;
  padding: 0 !important;
  border-radius: 50% !important;
  display: grid !important;
  place-items: center;
  font-size: 16px !important;
}

.plus-add-gradient-color {
  width: 100%;
  margin-top: 8px;
}

.plus-gradient-style-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 9px;
}

.plus-gradient-style-button {
  width: 100%;
  min-height: 40px;
  font-size: 11px;
}

.plus-image-picker {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.plus-image-picker label,
.plus-image-picker button {
  width: 100%;
}

.plus-image-picker-note {
  margin: 0;
  color: var(--secondary-text);
  font-size: 11px;
  line-height: 1.4;
}

.plus-editor-preview-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
}

.plus-canvas-shell {
  min-height: 0;
  display: grid;
  place-items: center;
  align-self: stretch;
  padding: 8px;
  overflow: hidden;
}

.plus-profile-canvas {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  width: min(100%, 680px);
  aspect-ratio: 16 / 10;
  border: 1px solid color-mix(in srgb, var(--primary) 38%, var(--border));
  border-radius: 25px;
  background: var(--bubble);
  box-shadow: 0 18px 50px var(--shadow), inset 0 1px 0 rgba(255,255,255,.16);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.plus-profile-canvas[data-preview-mode="phone"] {
  width: min(100%, 430px);
  aspect-ratio: 4 / 5;
}

.plus-canvas-background {
  position: absolute;
  z-index: 0;
  inset: 0;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.plus-canvas-overlays {
  position: absolute;
  z-index: 1;
  inset: 0;
  overflow: hidden;
}

.plus-canvas-profile-content {
  position: absolute;
  z-index: 5;
  inset: 0;
  padding: clamp(15px, 4%, 28px);
  display: grid;
  grid-template-rows: auto auto auto 1fr auto auto;
  justify-items: center;
  align-items: start;
  pointer-events: none;
  text-align: center;
}

.plus-preview-avatar {
  width: clamp(64px, 14%, 104px);
  aspect-ratio: 1;
  overflow: hidden;
  border: 3px solid var(--primary);
  border-radius: 50%;
  background: var(--button);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 22%, transparent), 0 8px 24px rgba(0,0,0,.35);
}

.plus-preview-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.plus-preview-name,
.plus-preview-handle,
.plus-preview-bio {
  max-width: 90%;
  margin: 7px 0 0;
  padding: 4px 9px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--card) 66%, transparent);
  -webkit-backdrop-filter: blur(9px);
  backdrop-filter: blur(9px);
  color: var(--text);
  text-shadow: 0 1px 3px rgba(0,0,0,.45);
}

.plus-preview-name {
  font-size: clamp(20px, 4vw, 31px);
  font-weight: 900;
}

.plus-preview-handle {
  margin-top: 4px;
  color: var(--secondary-text);
  font-size: clamp(11px, 2vw, 14px);
  font-weight: 800;
}

.plus-preview-bio {
  align-self: center;
  font-size: clamp(11px, 2vw, 14px);
  line-height: 1.35;
}

.plus-preview-stats {
  width: min(92%, 500px);
  padding: 9px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  border: 1px solid color-mix(in srgb, white 14%, var(--border));
  border-radius: 18px;
  background: color-mix(in srgb, var(--card) 68%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.plus-preview-stats strong,
.plus-preview-stats span {
  display: block;
}

.plus-preview-stats strong {
  font-size: clamp(14px, 2.8vw, 20px);
}

.plus-preview-stats span {
  margin-top: 2px;
  color: var(--secondary-text);
  font-size: 9px;
  font-weight: 800;
}

.plus-preview-actions {
  width: min(92%, 500px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

.plus-preview-actions span {
  min-height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--button) 78%, transparent);
  font-size: 11px;
  font-weight: 850;
}

.plus-preview-actions span:last-child {
  background: var(--primary);
  color: var(--primary-text);
}

.plus-overlay-object {
  position: absolute;
  left: calc(var(--object-x, 50) * 1%);
  top: calc(var(--object-y, 50) * 1%);
  width: var(--object-size, 16%);
  aspect-ratio: 1;
  container-type: inline-size;
  display: grid;
  place-items: center;
  color: var(--object-color, #ffffff);
  transform:
    translate(-50%, -50%)
    rotate(var(--object-rotation, 0deg))
    scaleX(var(--object-flip-x, 1));
  transform-origin: center;
  cursor: grab;
  touch-action: none;
  filter: drop-shadow(0 2px 5px rgba(0,0,0,.34));
}

.plus-overlay-object:active {
  cursor: grabbing;
}

.plus-overlay-object.is-hidden {
  display: none;
}

.plus-overlay-object.is-locked {
  cursor: not-allowed;
}

.plus-overlay-object > .plus-overlay-art,
.plus-overlay-object > .plus-overlay-art > svg,
.plus-overlay-object > .plus-overlay-art > span {
  width: 100%;
  height: 100%;
}

.plus-overlay-art {
  display: grid;
  place-items: center;
  pointer-events: none;
}

.plus-overlay-art > span {
  display: grid;
  place-items: center;
  font-size: 88cqi;
  line-height: 1;
  font-family: "Segoe UI Symbol", "Arial Unicode MS", sans-serif;
  color: currentColor;
}

.plus-overlay-object.is-selected {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: 10px;
}

.plus-overlay-handle {
  position: absolute;
  z-index: 8;
  width: 28px;
  height: 28px;
  display: none;
  place-items: center;
  border: 2px solid var(--card);
  border-radius: 50%;
  background: var(--primary);
  color: var(--primary-text);
  box-shadow: 0 3px 9px rgba(0,0,0,.35);
  font-size: 13px;
  font-weight: 900;
  touch-action: none;
}

.plus-overlay-object.is-selected:not(.is-locked) .plus-overlay-handle {
  display: grid;
}

.plus-overlay-resize-handle {
  right: -17px;
  bottom: -17px;
  cursor: nwse-resize;
}

.plus-overlay-rotate-handle {
  left: 50%;
  top: -42px;
  transform: translateX(-50%);
  cursor: grab;
}

.plus-overlay-delete-handle {
  top: -17px;
  right: -17px;
  border: 2px solid var(--card);
  background: var(--primary);
  color: var(--primary-text);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

.plus-overlay-object.is-selected .plus-overlay-delete-handle {
  display: grid;
}

.plus-canvas-guide {
  position: absolute;
  z-index: 4;
  display: none;
  background: var(--primary);
  pointer-events: none;
  box-shadow: 0 0 7px color-mix(in srgb, var(--primary) 58%, transparent);
}

.plus-canvas-guide.visible {
  display: block;
}

.plus-canvas-guide-x {
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
}

.plus-canvas-guide-y {
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
}

.plus-canvas-help {
  margin: 0;
  color: var(--secondary-text);
  font-size: 11px;
  text-align: center;
  line-height: 1.4;
}

.plus-overlay-search {
  margin: 10px 0 !important;
}

.plus-overlay-category {
  margin-top: 12px;
}

.plus-overlay-category h4 {
  margin-bottom: 7px;
  color: var(--secondary-text);
  font-size: 11px;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.plus-overlay-library-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.plus-overlay-library-button {
  min-width: 0;
  min-height: 72px;
  padding: 7px 4px !important;
  display: grid !important;
  place-items: center;
  align-content: center;
  gap: 5px;
  border-radius: 16px !important;
  font-size: 10px !important;
  line-height: 1.1;
}

.plus-overlay-library-button .plus-library-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  color: var(--primary);
  font-size: 25px;
  line-height: 1;
}

.plus-overlay-library-button .plus-library-icon svg {
  width: 100%;
  height: 100%;
}

.plus-selected-empty,
.plus-layers-empty {
  margin: 8px 0 0;
  padding: 16px 10px;
  border: 1px dashed var(--border);
  border-radius: 16px;
  color: var(--secondary-text);
  font-size: 12px;
  text-align: center;
}

.plus-selected-controls.hidden {
  display: none !important;
}

.plus-selected-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.plus-selected-title .plus-library-icon {
  width: 28px;
  height: 28px;
  color: var(--primary);
}

.plus-selected-title strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plus-range-label {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  color: var(--secondary-text);
  font-size: 11px;
  font-weight: 800;
}

.plus-range-label input[type="range"] {
  width: 100%;
  margin: 0;
  accent-color: var(--primary);
}

.plus-size-stepper {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 36px;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.plus-size-stepper button {
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  border-radius: 999px;
  font-size: 20px;
  line-height: 1;
}

.plus-object-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 10px;
}

.plus-object-actions button {
  min-height: 40px;
  padding: 7px 8px;
  font-size: 11px;
}

.plus-object-actions button.active {
  background: var(--primary);
  color: var(--primary-text);
}

.plus-danger-button {
  grid-column: 1 / -1;
  border-color: color-mix(in srgb, var(--primary) 52%, var(--border)) !important;
  background: color-mix(in srgb, var(--primary) 12%, var(--button)) !important;
  color: var(--text) !important;
  border-radius: 999px !important;
}

.plus-layer-list {
  display: grid;
  gap: 7px;
  margin-top: 9px;
}

.plus-layer-item {
  min-width: 0;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) repeat(5, 31px);
  gap: 5px;
  align-items: center;
  padding: 7px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--bubble);
}

.plus-layer-item.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 17%, transparent);
}

.plus-layer-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  color: var(--layer-color, var(--primary));
  font-size: 23px;
}

.plus-layer-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.plus-layer-item button {
  width: 31px !important;
  min-width: 31px !important;
  height: 31px !important;
  min-height: 31px !important;
  padding: 0 !important;
  display: grid !important;
  place-items: center;
  border-radius: 50% !important;
  font-size: 13px !important;
}

.plus-layer-item[draggable="true"] {
  cursor: grab;
}

.plus-layer-item.dragging {
  opacity: .46;
}

.plus-editor-footer {
  min-width: 0;
  padding: 11px 15px;
  display: grid;
  grid-template-columns: auto auto auto 1fr auto auto;
  gap: 8px;
  align-items: center;
  border-top: 1px solid var(--border);
  background: var(--card);
}

.plus-editor-footer button {
  min-height: 42px;
}

.plus-editor-save-button {
  min-width: 150px;
}

.plus-editor-status {
  min-width: 0;
  margin: 0 8px;
  color: var(--secondary-text);
  font-size: 11px;
  text-align: center;
  overflow-wrap: anywhere;
}

.plus-editor-status.error {
  color: #ff5f66;
}

.plus-editor-status.success {
  color: #3fd67a;
}

/* Tablet: prioritize canvas while still showing controls. */
@media (max-width: 1040px) and (min-width: 901px) {
  .plus-profile-editor-modal {
    width: calc(100vw - 18px);
    height: calc(100dvh - 18px);
  }

  .plus-editor-body {
    grid-template-columns: minmax(240px, .82fr) minmax(360px, 1.28fr);
  }

  .plus-editor-right-panel {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(240px, .8fr) minmax(0, 1.2fr);
    gap: 10px;
    border-top: 1px solid var(--border);
    border-left: 0 !important;
    max-height: 280px;
  }

  .plus-editor-right-panel .plus-editor-section + .plus-editor-section {
    margin-top: 0;
  }
}

/* Phone layout: one clear task at a time, no crushed three-column UI. */
@media (max-width: 900px), (max-height: 700px) and (max-width: 1100px) {
  .plus-profile-editor-overlay {
    padding: 0 !important;
    align-items: stretch !important;
  }

  .plus-profile-editor-modal {
    width: 100vw !important;
    height: 100dvh !important;
    border: 0 !important;
    border-radius: 0 !important;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
  }

  .plus-editor-header {
    padding: calc(10px + env(safe-area-inset-top)) 54px 9px 13px;
  }

  .plus-editor-heading-row {
    align-items: flex-start;
  }

  .plus-editor-header h2 {
    font-size: 21px;
  }

  .plus-editor-header p {
    display: none;
  }

  .plus-editor-preview-modes {
    min-width: 144px;
  }

  .plus-editor-preview-modes button {
    min-height: 33px;
    padding-inline: 9px;
    font-size: 11px;
  }

  .plus-profile-editor-modal > .modal-close-button {
    top: calc(8px + env(safe-area-inset-top));
    right: 8px;
  }

  .plus-mobile-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
    padding: 7px 8px;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    background: var(--card);
  }

  .plus-mobile-tabs button {
    min-width: 0;
    min-height: 38px;
    padding: 6px 3px;
    font-size: 10px;
  }

  .plus-mobile-tabs button.active {
    background: var(--primary);
    color: var(--primary-text);
  }

  .plus-editor-body {
    display: block;
    min-height: 0;
    overflow: hidden;
  }

  .plus-editor-panel {
    display: none;
    height: 100%;
    padding: 10px;
    border: 0 !important;
    overflow-y: auto;
  }

  .plus-editor-panel.mobile-active {
    display: block;
  }

  .plus-editor-preview-panel.mobile-active {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
  }

  .plus-editor-preview-panel > .plus-editor-section:first-child {
    display: none;
  }

  .plus-canvas-shell {
    padding: 2px;
  }

  .plus-profile-canvas,
  .plus-profile-canvas[data-preview-mode="phone"] {
    width: min(100%, 430px);
    max-height: calc(100dvh - 240px);
    aspect-ratio: 4 / 5;
  }

  .plus-profile-canvas[data-preview-mode="desktop"] {
    width: 100%;
    aspect-ratio: 16 / 10;
  }

  .plus-canvas-help {
    padding: 2px 10px 4px;
  }

  .plus-option-grid.plus-background-type-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .plus-gradient-stop {
    grid-template-columns: 30px 40px minmax(0, 1fr) 34px 34px;
  }

  .plus-gradient-stop .plus-remove-gradient-stop {
    grid-column: 5;
  }

  .plus-gradient-stop .plus-gradient-down {
    display: none;
  }

  .plus-overlay-library-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .plus-overlay-library-button {
    min-height: 68px;
  }

  .plus-layer-item {
    grid-template-columns: 34px minmax(0, 1fr) repeat(4, 34px);
  }

  .plus-layer-item .plus-layer-down {
    display: none;
  }

  .plus-editor-footer {
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
    grid-template-columns: repeat(3, 40px) minmax(0, 1fr) minmax(92px, auto);
    gap: 6px;
  }

  .plus-editor-footer button {
    min-height: 40px;
    padding: 6px 8px;
    font-size: 11px;
  }

  .plus-editor-footer .plus-editor-undo,
  .plus-editor-footer .plus-editor-redo,
  .plus-editor-footer .plus-editor-reset {
    width: 40px;
    min-width: 40px;
    padding: 0;
    border-radius: 50% !important;
    font-size: 0;
  }

  .plus-editor-footer .plus-editor-undo::after { content: "↶"; font-size: 19px; }
  .plus-editor-footer .plus-editor-redo::after { content: "↷"; font-size: 19px; }
  .plus-editor-footer .plus-editor-reset::after { content: "⟲"; font-size: 18px; }

  .plus-editor-status {
    margin: 0 2px;
    font-size: 9px;
  }

  .plus-editor-cancel-button {
    display: none;
  }

  .plus-editor-save-button {
    min-width: 92px;
  }

  .plus-overlay-handle {
    width: 32px;
    height: 32px;
  }

  .plus-overlay-resize-handle {
    right: -20px;
    bottom: -20px;
  }

  .plus-overlay-rotate-handle {
    top: -46px;
  }
}

/* =========================================================
   V219 — PLUS SECTIONS WITHOUT THE REDUNDANT ACCESS WRAPPER
   Status, redemption, and generation sit directly in the Plus view. Each
   real setting keeps its own calm card; there is no card-around-cards.
   ========================================================= */
.plus-code-layout {
  box-sizing: border-box;
  display: grid;
  gap: 14px;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.plus-code-redeem-panel,
.plus-code-developer-panel {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  border-radius: 26px !important;
}

.plus-code-redeem-panel > h4 {
  margin: 0 0 9px;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
}

.generated-plus-code-card {
  border-radius: 24px !important;
}

.plus-code-history-item,
.plus-code-history-empty {
  border-radius: 22px !important;
}

.plus-code-history-item.status-active .plus-code-status-badge,
.plus-code-history-item.status-active .plus-code-revoke-button {
  position: relative;
  top: -2px;
}

@media (hover: hover) and (pointer: fine) {
  #plusProfileEditorModal button.plus-overlay-library-button:hover {
    transform: scale(1.018) !important;
  }
}

#plusProfileEditorModal button.plus-overlay-library-button:active {
  transform: scale(.975) !important;
}

@media (max-width: 540px) {
  .plus-code-layout {
    gap: 12px;
  }

  .plus-code-redeem-panel,
  .plus-code-developer-panel {
    border-radius: 22px !important;
  }

  .generated-plus-code-card,
  .plus-code-history-item,
  .plus-code-history-empty {
    border-radius: 20px !important;
  }
}

/* V220 final Plus shapes. */
.yapper-plus-modal .plus-code-redeem-panel,
.yapper-plus-modal .plus-code-developer-panel { border-radius: 32px !important; }
.yapper-plus-modal .generated-plus-code-card { border-radius: 28px !important; }
.yapper-plus-modal .plus-code-history-item,
.yapper-plus-modal .plus-code-history-empty { border-radius: 9999px !important; }
@media (max-width: 540px) {
  .yapper-plus-modal .plus-code-redeem-panel,
  .yapper-plus-modal .plus-code-developer-panel { border-radius: 30px !important; }
  .yapper-plus-modal .generated-plus-code-card { border-radius: 27px !important; }
  .yapper-plus-modal .plus-code-history-item,
  .yapper-plus-modal .plus-code-history-empty { border-radius: 9999px !important; }
}

@media (max-width: 390px) {
  .plus-editor-preview-modes {
    min-width: 126px;
  }

  .plus-mobile-tabs button {
    font-size: 9px;
  }

  .plus-overlay-library-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .plus-object-actions {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .profile-background-layer,
  .plus-profile-editor-modal,
  .plus-overlay-object {
    transition: none !important;
    animation: none !important;
  }
}

/* Final high-specificity mobile overrides: Yapper's legacy bottom-sheet rules use
   !important, so the Plus editor explicitly wins here instead of being squeezed. */
@media (max-width: 900px), (max-height: 700px) and (max-width: 1100px) {
  .plus-profile-editor-overlay > .plus-profile-editor-modal.modal-surface {
    width: 100vw !important;
    min-width: 100vw !important;
    max-width: none !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    overflow: hidden !important;
    transform: none !important;
  }

  .plus-profile-editor-modal .plus-editor-heading-row {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 7px !important;
  }

  .plus-profile-editor-modal .plus-editor-header {
    padding: calc(9px + env(safe-area-inset-top)) 54px 8px 12px !important;
  }

  .plus-profile-editor-modal .plus-editor-preview-modes {
    width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
  }

  .plus-profile-editor-modal .plus-editor-preview-modes button,
  .plus-profile-editor-modal .plus-mobile-tabs button {
    min-width: 0 !important;
    padding: 5px 2px !important;
    font-size: 9px !important;
    white-space: nowrap !important;
  }

  .plus-profile-editor-modal .plus-mobile-tabs {
    min-width: 0 !important;
    padding: 6px 7px !important;
  }

  .plus-profile-editor-modal .plus-editor-footer {
    min-width: 0 !important;
  }

  .plus-profile-editor-modal .plus-editor-footer .plus-editor-undo,
  .plus-profile-editor-modal .plus-editor-footer .plus-editor-redo,
  .plus-profile-editor-modal .plus-editor-footer .plus-editor-reset {
    width: 40px !important;
    min-width: 40px !important;
    max-width: 40px !important;
    height: 40px !important;
    min-height: 40px !important;
    max-height: 40px !important;
    padding: 0 !important;
    border-radius: 50% !important;
    color: transparent !important;
    font-size: 0 !important;
    line-height: 0 !important;
  }

  .plus-profile-editor-modal .plus-editor-footer .plus-editor-undo::after,
  .plus-profile-editor-modal .plus-editor-footer .plus-editor-redo::after,
  .plus-profile-editor-modal .plus-editor-footer .plus-editor-reset::after {
    color: var(--text) !important;
    line-height: 1 !important;
  }
}

/* ---------------- Yapper Plus six-digit access codes ---------------- */
.plus-code-block {
  display: grid;
  gap: 14px;
}

.plus-membership-status {
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0 15px;
  min-height: 44px;
  border: 1px solid color-mix(in srgb, var(--border) 82%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--bubble) 86%, transparent);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.plus-membership-status.active {
  border-color: color-mix(in srgb, var(--primary) 58%, var(--border));
  background: color-mix(in srgb, var(--primary) 12%, var(--bubble));
  color: var(--text);
}

.plus-code-redeem-panel,
.plus-code-developer-panel {
  border: 1px solid color-mix(in srgb, var(--border) 86%, transparent);
  border-radius: 26px;
  background: color-mix(in srgb, var(--card) 95%, transparent);
  padding: 15px;
}

.plus-code-redeem-panel > label {
  display: block;
  margin-bottom: 9px;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
}

.plus-code-entry-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 118px;
  gap: 10px;
  align-items: center;
}

.plus-code-input {
  width: 100%;
  min-width: 0;
  height: 52px;
  padding: 0 18px;
  border: 1px solid color-mix(in srgb, var(--border) 90%, transparent);
  border-radius: 999px;
  background: var(--input);
  color: var(--text);
  font: inherit;
  font-size: 21px;
  font-weight: 900;
  letter-spacing: .22em;
  text-align: center;
  font-variant-numeric: tabular-nums;
  outline: none;
}

.plus-code-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent);
}

.plus-code-input::placeholder {
  color: color-mix(in srgb, var(--muted) 72%, transparent);
  opacity: 1;
}

.plus-code-input:disabled {
  opacity: .58;
}

.plus-code-action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  box-sizing: border-box;
  height: 52px;
  min-height: 52px;
  min-width: 118px;
  padding: 0 18px;
  border-radius: 999px;
  white-space: nowrap;
}

.plus-code-developer-panel {
  display: grid;
  gap: 14px;
  border-color: color-mix(in srgb, var(--primary) 34%, var(--border));
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--primary) 8%, transparent), transparent 42%),
    color-mix(in srgb, var(--card) 96%, transparent);
}

.plus-code-developer-panel.hidden {
  display: none !important;
}

.plus-code-developer-heading,
.plus-code-history-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.plus-code-developer-copy {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.plus-code-developer-heading h4,
.plus-code-history-heading h4 {
  margin: 0;
  color: var(--text);
  font-size: 15px;
}

.plus-code-helper-pill {
  display: block;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.4;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

.generated-plus-code-card {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 17px;
  border: 1px solid color-mix(in srgb, var(--primary) 58%, var(--border));
  border-radius: 26px;
  background: color-mix(in srgb, var(--primary) 10%, var(--bubble));
  text-align: center;
}

.generated-plus-code-card.hidden {
  display: none !important;
}

.generated-plus-code-card > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.generated-plus-code-card strong {
  color: var(--text);
  font-size: clamp(30px, 7vw, 42px);
  line-height: 1;
  font-weight: 950;
  letter-spacing: .16em;
  font-variant-numeric: tabular-nums;
}

.generated-plus-code-card p {
  max-width: 470px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.generated-plus-code-card button,
.plus-code-history-heading button,
.plus-code-revoke-button {
  border: 1px solid color-mix(in srgb, var(--border) 88%, transparent);
  border-radius: 999px;
  background: var(--bubble);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
}

.generated-plus-code-card button {
  min-height: 40px;
  padding: 0 17px;
}

.plus-code-history-heading button {
  min-height: 34px;
  padding: 0 12px;
}

.plus-code-history {
  display: grid;
  gap: 8px;
}

.plus-code-history-empty {
  margin: 0;
  padding: 14px;
  border-radius: 20px;
  background: color-mix(in srgb, var(--bubble) 84%, transparent);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.plus-code-history-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 9px;
  align-items: center;
  min-width: 0;
  padding: 12px 12px;
  border: 1px solid color-mix(in srgb, var(--border) 82%, transparent);
  border-radius: 22px;
  background: color-mix(in srgb, var(--bubble) 88%, transparent);
}

.plus-code-history-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.plus-code-history-copy strong {
  color: var(--text);
  font-size: 14px;
  letter-spacing: .08em;
  font-variant-numeric: tabular-nums;
}

.plus-code-history-copy span {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plus-code-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 27px;
  padding: 0 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--border) 62%, transparent);
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.plus-code-history-item.status-active .plus-code-status-badge {
  background: color-mix(in srgb, var(--primary) 18%, var(--bubble));
  color: var(--text);
}

.plus-code-revoke-button {
  min-height: 36px;
  padding: 0 13px;
  border-color: color-mix(in srgb, var(--primary) 56%, var(--border));
  background: color-mix(in srgb, var(--primary) 12%, var(--bubble));
  color: var(--text);
}

.plus-code-revoke-button:disabled,
.plus-code-history-heading button:disabled,
.generated-plus-code-card button:disabled {
  cursor: default;
  opacity: .55;
}

@media (max-width: 540px) {
  .plus-code-redeem-panel,
  .plus-code-developer-panel {
    border-radius: 22px;
    padding: 12px;
  }

  .plus-membership-status,
  .plus-code-helper-pill,
  .plus-inline-status {
    font-size: 11px;
  }

  .plus-code-entry-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .plus-code-action-button {
    width: 100%;
  }

  .plus-code-developer-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .plus-code-developer-heading .plus-code-action-button {
    width: 100%;
  }

  .generated-plus-code-card strong {
    font-size: 31px;
    letter-spacing: .12em;
  }

  .plus-code-history-item {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .plus-code-revoke-button {
    grid-column: 1 / -1;
    width: 100%;
  }
}

@media (max-width: 350px) {
  .plus-code-input {
    font-size: 18px;
    letter-spacing: .16em;
  }

  .generated-plus-code-card strong {
    font-size: 27px;
    letter-spacing: .1em;
  }
}


/* =========================================================
   YAPPER CLASSIC CONFIRMATION — no browser/Google dialogs
   ========================================================= */
.plus-confirm-overlay {
  z-index: 2147483646 !important;
  padding: 18px;
  background: rgba(0, 0, 0, .68);
  opacity: 0;
  transition: opacity 180ms ease;
}

.plus-confirm-overlay.is-open { opacity: 1; }

.plus-confirm-modal.modal-surface {
  width: min(430px, calc(100vw - 30px)) !important;
  max-width: 430px !important;
  margin: auto !important;
  padding: 25px !important;
  border: 1px solid color-mix(in srgb, var(--primary) 52%, var(--border)) !important;
  border-radius: 30px !important;
  background: linear-gradient(145deg, color-mix(in srgb, var(--primary) 9%, transparent), transparent 48%), var(--card) !important;
  box-shadow: 0 24px 72px rgba(0,0,0,.52), inset 0 1px 0 rgba(255,255,255,.1) !important;
  text-align: left;
  transform: translateY(8px) scale(.985);
  transition: transform 180ms ease;
}

.plus-confirm-overlay.is-open .plus-confirm-modal { transform: translateY(0) scale(1); }

.plus-confirm-symbol {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 13px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--primary-text);
  font-size: 22px;
  font-weight: 950;
}

.plus-confirm-modal h2 { margin: 0; color: var(--text); font-size: 24px; line-height: 1.15; }
.plus-confirm-modal p { margin: 9px 0 0; color: var(--secondary-text); font-size: 14px; line-height: 1.45; }

.plus-confirm-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  margin-top: 20px;
}

.plus-confirm-actions button {
  width: 100%;
  min-width: 0;
  height: 48px;
  min-height: 48px;
  border-radius: 999px !important;
}

@media (max-width: 540px) {
  .plus-confirm-modal.modal-surface {
    width: min(390px, calc(100vw - 24px)) !important;
    padding: 22px 18px 18px !important;
    border-radius: 27px !important;
  }
  .plus-confirm-modal h2 { font-size: 22px; }
}


/* =========================================================
   FINAL MOBILE EDITOR + SAVED PROFILE CORRECTIONS — v69
   ========================================================= */

/* No decorative exclamation badge in Yapper confirmations. */
.plus-confirm-symbol {
  display: none !important;
}

.plus-confirm-modal.modal-surface {
  padding-top: 23px !important;
}

/* Every editor handle remains a true circle even when legacy mobile button
   rules try to add a large minimum height. */
.plus-profile-editor-modal .plus-overlay-handle,
.plus-profile-editor-modal .plus-overlay-delete-handle,
.plus-profile-editor-modal .plus-overlay-resize-handle,
.plus-profile-editor-modal .plus-overlay-rotate-handle {
  box-sizing: border-box !important;
  width: 30px !important;
  min-width: 30px !important;
  max-width: 30px !important;
  height: 30px !important;
  min-height: 30px !important;
  max-height: 30px !important;
  padding: 0 !important;
  border-radius: 50% !important;
  place-items: center !important;
  line-height: 1 !important;
}

.plus-profile-editor-modal .plus-overlay-delete-handle {
  top: -15px !important;
  right: -15px !important;
  font-size: 18px !important;
}

.plus-profile-editor-modal .plus-overlay-resize-handle {
  right: -15px !important;
  bottom: -15px !important;
}

.plus-profile-editor-modal .plus-overlay-rotate-handle {
  top: -39px !important;
}

/* The editor close button is compact and circular, never a giant pill. */
#closePlusProfileEditorButton.modal-close-button {
  box-sizing: border-box !important;
  width: 36px !important;
  min-width: 36px !important;
  max-width: 36px !important;
  height: 36px !important;
  min-height: 36px !important;
  max-height: 36px !important;
  padding: 0 !important;
  border-radius: 50% !important;
  display: grid !important;
  place-items: center !important;
  font-size: 25px !important;
  line-height: 1 !important;
}

/* Footer history controls: force the glyph into the mathematical center. */
.plus-profile-editor-modal .plus-editor-footer .plus-editor-undo,
.plus-profile-editor-modal .plus-editor-footer .plus-editor-redo,
.plus-profile-editor-modal .plus-editor-footer .plus-editor-reset {
  display: grid !important;
  place-items: center !important;
  text-align: center !important;
  padding: 0 !important;
}

.plus-profile-editor-modal .plus-editor-footer .plus-editor-undo::after,
.plus-profile-editor-modal .plus-editor-footer .plus-editor-redo::after,
.plus-profile-editor-modal .plus-editor-footer .plus-editor-reset::after {
  display: block !important;
  width: 1em !important;
  height: 1em !important;
  margin: 0 !important;
  text-align: center !important;
  line-height: 1 !important;
  transform: none !important;
}

/* Names and handles are actual capsules. Multiline bios remain rounded cards. */
.plus-preview-name,
.plus-preview-handle,
#profileViewSection.plus-background-active .profile-display-name,
#profileViewSection.plus-background-active .profile-handle {
  border-radius: 999px !important;
}

#profileViewSection.plus-background-active .profile-display-name,
#profileViewSection.plus-background-active .profile-handle {
  display: inline-flex !important;
  width: auto !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 3px !important;
}

#profileViewSection.plus-background-active .profile-bio {
  border-radius: 22px !important;
}

/* One saved-profile frame, not a profile card inside another profile card. */
.profile-modal.plus-profile-shell-active {
  overflow: hidden !important;
}

.profile-modal.plus-profile-shell-active #profileViewSection.plus-background-active {
  margin: -24px !important;
  padding: 54px 24px 24px !important;
  border: 0 !important;
  border-radius: inherit !important;
  box-shadow: none !important;
}

.profile-modal.plus-profile-shell-active #profileViewSection.plus-background-active .profile-background-layer {
  border-radius: inherit !important;
}

/* A desktop preview on a phone is a scaled desktop card, not a tall empty
   phone canvas with the profile stranded at the bottom. */
@media (max-width: 900px) {
  .plus-profile-canvas[data-preview-mode="desktop"] {
    width: min(100%, 680px) !important;
    max-height: none !important;
    aspect-ratio: 16 / 10 !important;
  }

  .plus-profile-canvas[data-preview-mode="desktop"] .plus-canvas-profile-content {
    padding: 10px 14px !important;
    grid-template-rows: repeat(6, auto) !important;
    align-content: center !important;
    justify-content: center !important;
    gap: 3px !important;
  }

  .plus-profile-canvas[data-preview-mode="desktop"] .plus-preview-avatar {
    width: 52px !important;
  }

  .plus-profile-canvas[data-preview-mode="desktop"] .plus-preview-name {
    margin-top: 3px !important;
    padding: 3px 9px !important;
    font-size: 16px !important;
    line-height: 1.05 !important;
  }

  .plus-profile-canvas[data-preview-mode="desktop"] .plus-preview-handle {
    margin-top: 2px !important;
    padding: 3px 8px !important;
    font-size: 10px !important;
  }

  .plus-profile-canvas[data-preview-mode="desktop"] .plus-preview-bio {
    max-width: 72% !important;
    margin-top: 4px !important;
    padding: 4px 9px !important;
    font-size: 10px !important;
    line-height: 1.2 !important;
  }

  .plus-profile-canvas[data-preview-mode="desktop"] .plus-preview-stats {
    width: min(78%, 430px) !important;
    margin-top: 4px !important;
    padding: 5px !important;
    border-radius: 14px !important;
  }

  .plus-profile-canvas[data-preview-mode="desktop"] .plus-preview-stats strong {
    font-size: 13px !important;
  }

  .plus-profile-canvas[data-preview-mode="desktop"] .plus-preview-stats span {
    font-size: 8px !important;
  }

  .plus-profile-canvas[data-preview-mode="desktop"] .plus-preview-actions {
    width: min(78%, 430px) !important;
    margin-top: 4px !important;
  }

  .plus-profile-canvas[data-preview-mode="desktop"] .plus-preview-actions span {
    min-height: 27px !important;
    font-size: 9px !important;
  }

  .profile-modal.plus-profile-shell-active #profileViewSection.plus-background-active {
    margin: -18px !important;
    padding: 62px 18px 18px !important;
  }
}

/* =========================================================
   PROFILE + EDITOR REGRESSION FIX — v70
   Keep the real profile layout intact, restore mobile scrolling,
   and preserve Yapper's rounded visual language.
   ========================================================= */

/* Name and username must be separate centered rows, never adjacent inline boxes. */
#profileViewSection.plus-background-active .profile-display-name,
#profileViewSection.plus-background-active .profile-handle {
  display: flex !important;
  width: fit-content !important;
  max-width: calc(100% - 24px) !important;
  margin-left: auto !important;
  margin-right: auto !important;
  align-items: center !important;
  justify-content: center !important;
  flex-wrap: nowrap !important;
}

#profileViewSection.plus-background-active .profile-display-name {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

#profileViewSection.plus-background-active .profile-handle {
  margin-top: 7px !important;
  margin-bottom: 0 !important;
}

/* One visible saved-profile surface. The outer modal is only the positioning
   shell; the background section is the one rounded card the user sees. */
.profile-modal.plus-profile-shell-active {
  padding: 0 !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  overscroll-behavior: contain !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.profile-modal.plus-profile-shell-active #profileViewSection.plus-background-active {
  box-sizing: border-box !important;
  width: 100% !important;
  min-height: 100% !important;
  margin: 0 !important;
  padding: 56px 24px 24px !important;
  border: 1px solid color-mix(in srgb, var(--primary) 34%, var(--border)) !important;
  border-radius: var(--ui-radius-surface, 42px) !important;
  box-shadow: 0 24px 70px var(--shadow), inset 0 1px 0 rgba(255,255,255,.14) !important;
}

.profile-modal.plus-profile-shell-active #profileViewSection.plus-background-active .profile-background-layer {
  border-radius: inherit !important;
}

/* Restore the softer rounded Edit Profile / Profile Background look. */
#profileEditSection,
.profile-picture-editor,
.plus-profile-background-card {
  border-radius: var(--ui-radius-panel, 34px) !important;
  background-clip: padding-box !important;
}

.plus-profile-background-card {
  padding: 18px !important;
}

.plus-profile-background-card button,
.profile-edit-actions button {
  border-radius: 999px !important;
}

.profile-field input {
  border-radius: 999px !important;
}

.profile-field textarea {
  border-radius: var(--ui-radius-field, 30px) !important;
}

/* Empty canvas space scrolls normally on phones; actual overlay objects still
   own drag/pinch/twist gestures through touch-action:none. */
.plus-profile-canvas {
  touch-action: pan-y !important;
}

.plus-overlay-object,
.plus-overlay-handle {
  touch-action: none !important;
}

@media (max-width: 900px), (max-height: 700px) and (max-width: 1100px) {
  .plus-profile-editor-modal {
    min-height: 0 !important;
  }

  .plus-editor-body {
    min-height: 0 !important;
    overflow: hidden !important;
  }

  .plus-editor-panel.mobile-active {
    display: block !important;
    min-height: 0 !important;
    height: 100% !important;
    max-height: 100% !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior-y: contain !important;
    touch-action: pan-y !important;
  }

  .plus-editor-preview-panel.mobile-active {
    display: grid !important;
    grid-template-rows: minmax(min-content, 1fr) auto !important;
    align-content: start !important;
  }

  .plus-canvas-shell {
    min-height: min-content !important;
    overflow: visible !important;
  }

  .profile-overlay {
    padding: 12px !important;
  }

  .profile-modal.plus-profile-shell-active {
    width: min(100%, 580px) !important;
    max-height: calc(100dvh - 24px) !important;
  }

  .profile-modal.plus-profile-shell-active #profileViewSection.plus-background-active {
    min-height: auto !important;
    padding: 58px 16px 18px !important;
    border-radius: 34px !important;
  }
}

/* =========================================================
   PROFILE EDITOR / ACCOUNT ACCENT FINAL QA — v72
   One saved profile surface, deterministic phone/desktop previews,
   and correctly centred history controls.
   ========================================================= */

/* The actual profile is one rounded surface. The background layer fills that
   surface instead of creating a second card/square inside the modal. */
.profile-modal.plus-profile-shell-active {
  position: relative !important;
  box-sizing: border-box !important;
  padding: 0 !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  border: 1px solid color-mix(in srgb, var(--primary) 38%, var(--border)) !important;
  border-radius: 42px !important;
  background: var(--card) !important;
  box-shadow: 0 24px 70px var(--shadow), inset 0 1px 0 rgba(255,255,255,.14) !important;
}

.profile-modal.plus-profile-shell-active > .modal-close-button {
  z-index: 30 !important;
}

.profile-modal.plus-profile-shell-active #profileViewSection.plus-background-active {
  box-sizing: border-box !important;
  width: 100% !important;
  min-height: 100% !important;
  margin: 0 !important;
  padding: 58px 24px 24px !important;
  border: 0 !important;
  border-radius: inherit !important;
  background: transparent !important;
  box-shadow: none !important;
}

.profile-modal.plus-profile-shell-active #profileViewSection.plus-background-active .profile-background-layer {
  inset: 0 !important;
  border-radius: inherit !important;
}

/* The preview viewport reserves the transformed canvas's real visual height.
   The canvas itself uses fixed reference dimensions, so choosing Desktop on a
   phone shows a scaled desktop layout rather than a responsive phone layout. */
.plus-canvas-shell {
  display: flex !important;
  align-items: flex-start !important;
  justify-content: center !important;
  min-width: 0 !important;
  min-height: 0 !important;
  overflow: visible !important;
}

.plus-canvas-viewport {
  position: relative;
  display: flex;
  width: 100%;
  min-width: 0;
  align-items: flex-start;
  justify-content: center;
  overflow: visible;
}

.plus-profile-canvas {
  flex: 0 0 auto !important;
  max-width: none !important;
  max-height: none !important;
  transform-origin: top center !important;
  will-change: transform;
}

.plus-profile-canvas[data-preview-mode="desktop"] {
  width: 760px !important;
  height: auto !important;
  aspect-ratio: auto !important;
}

.plus-profile-canvas[data-preview-mode="phone"] {
  width: 390px !important;
  height: 720px !important;
  aspect-ratio: auto !important;
}

/* Shared preview content foundation. */
.plus-profile-canvas .plus-canvas-profile-content {
  box-sizing: border-box !important;
  display: grid !important;
  justify-items: center !important;
  align-items: start !important;
  align-content: center !important;
  gap: 5px !important;
  pointer-events: none !important;
}

.plus-profile-canvas .plus-preview-name,
.plus-profile-canvas .plus-preview-handle,
.plus-profile-canvas .plus-preview-bio {
  width: fit-content !important;
  max-width: 90% !important;
  border-radius: 999px !important;
}

.plus-profile-canvas .plus-preview-actions {
  grid-template-columns: minmax(0, 1fr) !important;
}

/* Real desktop reference layout. */
.plus-profile-canvas[data-preview-mode="desktop"] .plus-canvas-profile-content {
  inset: 0 !important;
  padding: 26px 42px !important;
  grid-template-rows: repeat(6, auto) !important;
}

.plus-profile-canvas[data-preview-mode="desktop"] .plus-preview-avatar {
  width: 98px !important;
}

.plus-profile-canvas[data-preview-mode="desktop"] .plus-preview-name {
  margin-top: 5px !important;
  padding: 5px 12px !important;
  font-size: 28px !important;
  line-height: 1.05 !important;
}

.plus-profile-canvas[data-preview-mode="desktop"] .plus-preview-handle {
  margin-top: 2px !important;
  padding: 4px 10px !important;
  font-size: 14px !important;
}

.plus-profile-canvas[data-preview-mode="desktop"] .plus-preview-bio {
  max-width: 74% !important;
  margin-top: 7px !important;
  padding: 7px 12px !important;
  font-size: 14px !important;
  line-height: 1.25 !important;
}

.plus-profile-canvas[data-preview-mode="desktop"] .plus-preview-stats {
  width: min(92%, 690px) !important;
  margin-top: 9px !important;
  padding: 10px !important;
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  gap: 7px !important;
  border-radius: 24px !important;
}

.plus-profile-canvas[data-preview-mode="desktop"] .plus-preview-stats > div {
  grid-column: auto !important;
  min-width: 0 !important;
  padding: 7px 4px !important;
  border-radius: 999px !important;
  background: color-mix(in srgb, var(--button) 50%, transparent) !important;
}

.plus-profile-canvas[data-preview-mode="desktop"] .plus-preview-stats strong {
  font-size: 18px !important;
}

.plus-profile-canvas[data-preview-mode="desktop"] .plus-preview-stats span {
  font-size: 9px !important;
}

.plus-profile-canvas[data-preview-mode="desktop"] .plus-preview-actions {
  width: min(62%, 470px) !important;
  margin-top: 8px !important;
}

.plus-profile-canvas[data-preview-mode="desktop"] .plus-preview-actions span {
  min-height: 42px !important;
  font-size: 12px !important;
  background: var(--primary) !important;
  color: var(--primary-text) !important;
}

/* Real phone reference layout: two top stats, three bottom stats, one action. */
.plus-profile-canvas[data-preview-mode="phone"] .plus-canvas-profile-content {
  inset: 0 !important;
  padding: 54px 20px 24px !important;
  grid-template-rows: repeat(6, auto) !important;
  align-content: start !important;
  gap: 7px !important;
}

.plus-profile-canvas[data-preview-mode="phone"] .plus-preview-avatar {
  width: 96px !important;
}

.plus-profile-canvas[data-preview-mode="phone"] .plus-preview-name {
  margin-top: 8px !important;
  padding: 6px 13px !important;
  font-size: 28px !important;
  line-height: 1.05 !important;
}

.plus-profile-canvas[data-preview-mode="phone"] .plus-preview-handle {
  margin-top: 2px !important;
  padding: 5px 11px !important;
  font-size: 14px !important;
}

.plus-profile-canvas[data-preview-mode="phone"] .plus-preview-bio {
  max-width: 92% !important;
  margin-top: 10px !important;
  padding: 9px 13px !important;
  font-size: 15px !important;
  line-height: 1.25 !important;
}

.plus-profile-canvas[data-preview-mode="phone"] .plus-preview-stats {
  width: 94% !important;
  margin-top: 10px !important;
  padding: 10px !important;
  grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  gap: 7px !important;
  border-radius: 26px !important;
}

.plus-profile-canvas[data-preview-mode="phone"] .plus-preview-stats > div {
  min-width: 0 !important;
  padding: 11px 3px !important;
  border-radius: 999px !important;
  background: color-mix(in srgb, var(--button) 56%, transparent) !important;
}

.plus-profile-canvas[data-preview-mode="phone"] .plus-preview-stats > div:nth-child(1),
.plus-profile-canvas[data-preview-mode="phone"] .plus-preview-stats > div:nth-child(2) {
  grid-column: span 3 !important;
}

.plus-profile-canvas[data-preview-mode="phone"] .plus-preview-stats > div:nth-child(n+3) {
  grid-column: span 2 !important;
}

.plus-profile-canvas[data-preview-mode="phone"] .plus-preview-stats strong {
  font-size: 20px !important;
}

.plus-profile-canvas[data-preview-mode="phone"] .plus-preview-stats span {
  font-size: 10px !important;
}

.plus-profile-canvas[data-preview-mode="phone"] .plus-preview-actions {
  width: 94% !important;
  margin-top: 12px !important;
}

.plus-profile-canvas[data-preview-mode="phone"] .plus-preview-actions span {
  min-height: 48px !important;
  font-size: 13px !important;
  background: var(--primary) !important;
  color: var(--primary-text) !important;
}

/* Desktop history buttons are true pills with an icon and label. */
.plus-profile-editor-modal .plus-editor-footer .plus-editor-undo,
.plus-profile-editor-modal .plus-editor-footer .plus-editor-redo,
.plus-profile-editor-modal .plus-editor-footer .plus-editor-reset {
  box-sizing: border-box !important;
  display: inline-flex !important;
  width: auto !important;
  min-width: 92px !important;
  height: 44px !important;
  min-height: 44px !important;
  max-height: 44px !important;
  padding: 0 16px !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 7px !important;
  border-radius: 999px !important;
  color: var(--text) !important;
  font-size: 12px !important;
  line-height: 1 !important;
}

.plus-profile-editor-modal .plus-editor-footer .plus-editor-undo::after,
.plus-profile-editor-modal .plus-editor-footer .plus-editor-redo::after,
.plus-profile-editor-modal .plus-editor-footer .plus-editor-reset::after {
  content: none !important;
  display: none !important;
}

.plus-history-icon,
.plus-history-label {
  display: inline-grid;
  place-items: center;
  margin: 0 !important;
  line-height: 1 !important;
}

.plus-history-icon {
  width: 18px;
  height: 18px;
  font-size: 20px;
  transform: translateY(-.5px);
}

.plus-history-label {
  font-weight: 850;
}

@media (max-width: 900px), (max-height: 700px) and (max-width: 1100px) {
  .profile-modal.plus-profile-shell-active {
    border-radius: 34px !important;
  }

  .profile-modal.plus-profile-shell-active #profileViewSection.plus-background-active {
    min-height: auto !important;
    padding: 58px 16px 18px !important;
  }

  .plus-editor-preview-panel.mobile-active {
    display: grid !important;
    grid-template-rows: auto auto !important;
    align-content: start !important;
    overflow-y: auto !important;
  }

  .plus-canvas-shell {
    align-self: start !important;
    padding: 8px 2px 4px !important;
  }

  .plus-canvas-viewport {
    align-self: start !important;
  }

  .plus-profile-editor-modal .plus-editor-footer .plus-editor-undo,
  .plus-profile-editor-modal .plus-editor-footer .plus-editor-redo,
  .plus-profile-editor-modal .plus-editor-footer .plus-editor-reset {
    display: grid !important;
    width: 42px !important;
    min-width: 42px !important;
    max-width: 42px !important;
    height: 42px !important;
    min-height: 42px !important;
    max-height: 42px !important;
    padding: 0 !important;
    border-radius: 50% !important;
    place-items: center !important;
    gap: 0 !important;
    font-size: 0 !important;
  }

  .plus-profile-editor-modal .plus-history-label {
    display: none !important;
  }

  .plus-profile-editor-modal .plus-history-icon {
    display: grid !important;
    width: 22px !important;
    height: 22px !important;
    place-items: center !important;
    color: var(--text) !important;
    font-size: 24px !important;
    line-height: 1 !important;
    transform: none !important;
  }
}

/* =========================================================
   EDIT PROFILE SURFACE + PLUS CODE HISTORY — v73
   The saved-profile shell must never flatten/squeeze the edit form.
   ========================================================= */

/* Editing is its own rounded modal surface, even when the viewed profile has
   a Plus background and the outer shell class is still present. */
.profile-modal:has(#profileEditSection:not(.hidden)),
.profile-modal.plus-profile-shell-active:has(#profileEditSection:not(.hidden)) {
  position: relative !important;
  box-sizing: border-box !important;
  width: min(780px, calc(100vw - 48px)) !important;
  max-width: 780px !important;
  min-width: 0 !important;
  max-height: min(90dvh, 820px) !important;
  margin: auto !important;
  padding: 28px 30px 30px !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  border: 1px solid color-mix(in srgb, var(--primary) 38%, var(--border)) !important;
  border-radius: 42px !important;
  background: var(--card) !important;
  box-shadow: 0 24px 70px var(--shadow), inset 0 1px 0 rgba(255,255,255,.14) !important;
  -webkit-overflow-scrolling: touch !important;
}

/* The edit form is content, not a second square/card inside the modal. */
.profile-modal:has(#profileEditSection:not(.hidden)) #profileEditSection,
.profile-modal.plus-profile-shell-active:has(#profileEditSection:not(.hidden)) #profileEditSection {
  display: block !important;
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: visible !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.profile-modal:has(#profileEditSection:not(.hidden)) #profileEditSection > h2 {
  display: flex !important;
  align-items: center !important;
  min-height: 46px !important;
  margin: 0 62px 16px 0 !important;
  padding: 0 !important;
  color: var(--text) !important;
  font-size: 25px !important;
  line-height: 1.1 !important;
  text-align: left !important;
  overflow: visible !important;
}

/* Give the X a reserved corner instead of letting it squeeze the heading. */
.profile-modal:has(#profileEditSection:not(.hidden)) > #closeProfileButton.modal-close-button {
  position: absolute !important;
  top: 16px !important;
  right: 16px !important;
  left: auto !important;
  bottom: auto !important;
  z-index: 50 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 42px !important;
  min-width: 42px !important;
  max-width: 42px !important;
  height: 42px !important;
  min-height: 42px !important;
  max-height: 42px !important;
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 50% !important;
  line-height: 0 !important;
  transform: none !important;
}

.profile-modal:has(#profileEditSection:not(.hidden)) .profile-picture-editor,
.profile-modal.profile-editing-active .profile-picture-editor {
  margin-top: 0 !important;
  border-radius: 40px !important;
}

.profile-modal:has(#profileEditSection:not(.hidden)) .plus-profile-background-card {
  border-radius: 34px !important;
}

/* Recent codes shows roughly two rows, then scrolls instead of growing forever. */
.plus-code-history {
  max-height: 146px !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  padding-right: 4px !important;
  overscroll-behavior: contain !important;
  scrollbar-gutter: stable !important;
  -webkit-overflow-scrolling: touch !important;
}

.plus-code-history-item {
  min-height: 66px !important;
  box-sizing: border-box !important;
}

.plus-code-history::-webkit-scrollbar {
  width: 7px;
}

.plus-code-history::-webkit-scrollbar-track {
  border-radius: 999px;
  background: color-mix(in srgb, var(--bubble) 74%, transparent);
}

.plus-code-history::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 58%, var(--border));
}

@media (max-width: 700px) {
  .profile-overlay:has(#profileEditSection:not(.hidden)) {
    align-items: center !important;
    justify-content: center !important;
    padding: max(10px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left)) !important;
    overflow: auto !important;
  }

  .profile-modal:has(#profileEditSection:not(.hidden)),
  .profile-modal.plus-profile-shell-active:has(#profileEditSection:not(.hidden)) {
    width: min(94vw, 560px) !important;
    max-width: 560px !important;
    max-height: calc(100dvh - 20px) !important;
    padding: 18px !important;
    border-radius: 34px !important;
  }

  .profile-modal:has(#profileEditSection:not(.hidden)) #profileEditSection > h2 {
    min-height: 44px !important;
    margin: 0 54px 14px 0 !important;
    font-size: 23px !important;
  }

  .profile-modal:has(#profileEditSection:not(.hidden)) > #closeProfileButton.modal-close-button {
    top: 12px !important;
    right: 12px !important;
    width: 40px !important;
    min-width: 40px !important;
    max-width: 40px !important;
    height: 40px !important;
    min-height: 40px !important;
    max-height: 40px !important;
  }

  .profile-modal:has(#profileEditSection:not(.hidden)) .profile-picture-editor,
  .profile-modal.profile-editing-active .profile-picture-editor {
    border-radius: 34px !important;
  }

  .profile-modal:has(#profileEditSection:not(.hidden)) .plus-profile-background-card {
    border-radius: 29px !important;
  }

  .plus-code-history {
    max-height: 164px !important;
  }
}

/* Class-based equivalent for the edit mode, set by yapper-online.js. */
.profile-modal.profile-editing-active,
.profile-modal.plus-profile-shell-active.profile-editing-active {
  position: relative !important;
  box-sizing: border-box !important;
  width: min(780px, calc(100vw - 48px)) !important;
  max-width: 780px !important;
  min-width: 0 !important;
  max-height: min(90dvh, 820px) !important;
  margin: auto !important;
  padding: 28px 30px 30px !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  border: 1px solid color-mix(in srgb, var(--primary) 38%, var(--border)) !important;
  border-radius: 42px !important;
  background: var(--card) !important;
  box-shadow: 0 24px 70px var(--shadow), inset 0 1px 0 rgba(255,255,255,.14) !important;
}

.profile-modal.profile-editing-active #profileEditSection {
  display: block !important;
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: visible !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.profile-modal.profile-editing-active #profileEditSection > h2 {
  display: flex !important;
  align-items: center !important;
  min-height: 46px !important;
  margin: 0 62px 16px 0 !important;
  padding: 0 !important;
  font-size: 25px !important;
  line-height: 1.1 !important;
  text-align: left !important;
}

.profile-modal.profile-editing-active > #closeProfileButton.modal-close-button {
  top: 16px !important;
  right: 16px !important;
  left: auto !important;
  width: 42px !important;
  min-width: 42px !important;
  max-width: 42px !important;
  height: 42px !important;
  min-height: 42px !important;
  max-height: 42px !important;
  margin: 0 !important;
  padding: 0 0 2px !important;
  border-radius: 50% !important;
}

@media (max-width: 700px) {
  .profile-modal.profile-editing-active,
  .profile-modal.plus-profile-shell-active.profile-editing-active {
    width: min(94vw, 560px) !important;
    max-width: 560px !important;
    max-height: calc(100dvh - 20px) !important;
    padding: 18px !important;
    border-radius: 34px !important;
  }

  .profile-modal.profile-editing-active #profileEditSection > h2 {
    min-height: 44px !important;
    margin: 0 54px 14px 0 !important;
    font-size: 23px !important;
  }

  .profile-modal.profile-editing-active > #closeProfileButton.modal-close-button {
    top: 12px !important;
    right: 12px !important;
    width: 40px !important;
    min-width: 40px !important;
    max-width: 40px !important;
    height: 40px !important;
    min-height: 40px !important;
    max-height: 40px !important;
  }
}

@media (max-width: 540px) {
  /* Keep active-code actions on one row so two complete codes fit in the
     fixed history viewport instead of one tall card consuming it. */
  .plus-code-history {
    max-height: 146px !important;
  }

  .plus-code-history-item {
    grid-template-columns: minmax(0, 1fr) auto auto !important;
  }

  .plus-code-revoke-button {
    grid-column: auto !important;
    width: auto !important;
    min-width: 0 !important;
  }
}


/* =========================================================
   MOBILE OVERLAY DRAG PERFORMANCE — v75
   Keep overlay nodes alive while dragging. Android Chromium can flash the
   backdrop-filter layers when a transformed child is recreated every frame,
   so the compact editor uses stable compositor layers and opaque glass.
   ========================================================= */
.plus-profile-canvas,
.plus-canvas-background,
.plus-canvas-profile-content,
.plus-canvas-overlays {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.plus-profile-canvas {
  contain: layout paint style;
}

.plus-canvas-background,
.plus-canvas-profile-content {
  transform: translateZ(0);
}

.plus-overlay-object {
  will-change: left, top, transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.plus-profile-canvas.is-manipulating .plus-overlay-object {
  filter: none !important;
}

.plus-profile-canvas.is-manipulating .plus-overlay-object:not(.is-selected) {
  will-change: auto;
}

@media (max-width: 900px), (pointer: coarse) {
  .plus-profile-canvas .plus-preview-name,
  .plus-profile-canvas .plus-preview-handle,
  .plus-profile-canvas .plus-preview-bio,
  .plus-profile-canvas .plus-preview-stats,
  .plus-profile-canvas .plus-preview-actions span {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }

  .plus-profile-canvas .plus-preview-name,
  .plus-profile-canvas .plus-preview-handle,
  .plus-profile-canvas .plus-preview-bio {
    background: color-mix(in srgb, var(--card) 88%, transparent) !important;
  }

  .plus-profile-canvas .plus-preview-stats {
    background: color-mix(in srgb, var(--card) 90%, transparent) !important;
  }

  .plus-profile-canvas .plus-preview-actions span {
    background: color-mix(in srgb, var(--button) 92%, transparent) !important;
  }

  .plus-profile-canvas .plus-preview-actions span:last-child {
    background: var(--primary) !important;
  }
}

/* =========================================================
   EXACT PROFILE PREVIEW — v76
   The editor preview is the real rendered profile DOM, not a lookalike.
   ========================================================= */

/* Let the cloned profile determine the canvas height and shape. */
.plus-profile-canvas,
.plus-profile-canvas[data-preview-mode="desktop"],
.plus-profile-canvas[data-preview-mode="phone"] {
  height: auto !important;
  min-height: 0 !important;
  aspect-ratio: auto !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.plus-profile-canvas[data-preview-mode="desktop"] {
  width: 760px !important;
  border-radius: 42px !important;
}

.plus-profile-canvas[data-preview-mode="phone"] {
  width: 390px !important;
  border-radius: 34px !important;
}

.plus-profile-canvas .plus-canvas-profile-content {
  position: relative !important;
  inset: auto !important;
  z-index: 5 !important;
  display: block !important;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  padding: 0 !important;
  pointer-events: none !important;
  text-align: center !important;
}

.plus-preview-profile-shell.profile-modal.plus-profile-shell-active {
  position: relative !important;
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  border: 1px solid color-mix(in srgb, var(--primary) 38%, var(--border)) !important;
  border-radius: inherit !important;
  background: transparent !important;
  box-shadow: 0 24px 70px var(--shadow), inset 0 1px 0 rgba(255,255,255,.14) !important;
}

.plus-preview-profile-shell > .plus-preview-profile-close.modal-close-button {
  position: absolute !important;
  top: 13px !important;
  right: 13px !important;
  left: auto !important;
  z-index: 30 !important;
  display: grid !important;
  place-items: center !important;
  width: 42px !important;
  min-width: 42px !important;
  max-width: 42px !important;
  height: 42px !important;
  min-height: 42px !important;
  max-height: 42px !important;
  margin: 0 !important;
  padding: 0 0 2px !important;
  border-radius: 50% !important;
  line-height: 1 !important;
  transform: none !important;
}

/* Alias the id-only real-profile rules onto the id-free clone. */
.plus-preview-profile-view {
  position: relative !important;
  isolation: isolate !important;
  box-sizing: border-box !important;
  width: 100% !important;
  min-height: 100% !important;
  margin: 0 !important;
  padding: 58px 24px 24px !important;
  overflow: hidden !important;
  border: 0 !important;
  border-radius: inherit !important;
  background: transparent !important;
  box-shadow: none !important;
  text-align: center !important;
}

.plus-preview-profile-view > * {
  position: relative;
  z-index: 2;
}

.plus-preview-profile-view.plus-background-active .profile-display-name,
.plus-preview-profile-view.plus-background-active .profile-handle,
.plus-preview-profile-view.plus-background-active .profile-bio {
  width: fit-content !important;
  max-width: calc(100% - 24px) !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding: 5px 11px !important;
  background: color-mix(in srgb, var(--card) 68%, transparent) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  backdrop-filter: blur(10px) !important;
  text-shadow: 0 1px 3px rgba(0,0,0,.48) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12) !important;
}

.plus-preview-profile-view.plus-background-active .profile-display-name,
.plus-preview-profile-view.plus-background-active .profile-handle {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-wrap: nowrap !important;
  border-radius: 999px !important;
}

.plus-preview-profile-view.plus-background-active .profile-display-name {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

.plus-preview-profile-view.plus-background-active .profile-handle {
  margin-top: 7px !important;
  margin-bottom: 0 !important;
}

.plus-preview-profile-view.plus-background-active .profile-bio {
  margin-top: 14px !important;
  margin-bottom: 14px !important;
  border-radius: 22px !important;
}

.plus-preview-profile-view.plus-background-active .profile-stats,
.plus-preview-profile-view.plus-background-active .profile-connections-panel,
.plus-preview-profile-view.plus-background-active .profile-main-actions > button {
  -webkit-backdrop-filter: blur(12px) !important;
  backdrop-filter: blur(12px) !important;
}

/* Phone mode uses the exact saved-profile phone geometry regardless of the
   physical device currently running the editor. */
.plus-profile-canvas[data-preview-mode="phone"] .plus-preview-profile-view {
  padding: 58px 16px 18px !important;
}

.plus-profile-canvas[data-preview-mode="phone"] .profile-avatar-large {
  width: 84px !important;
  height: 84px !important;
}

.plus-profile-canvas[data-preview-mode="phone"] .profile-stats {
  display: grid !important;
  grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  grid-auto-flow: row !important;
  gap: 8px !important;
  width: 100% !important;
  padding: 10px !important;
  overflow: hidden !important;
}

.plus-profile-canvas[data-preview-mode="phone"] .profile-stats > .profile-stat:nth-child(1) {
  grid-column: 2 / span 2 !important;
}

.plus-profile-canvas[data-preview-mode="phone"] .profile-stats > .profile-stat:nth-child(2) {
  grid-column: 4 / span 2 !important;
}

.plus-profile-canvas[data-preview-mode="phone"] .profile-stats > .profile-stat:nth-child(3),
.plus-profile-canvas[data-preview-mode="phone"] .profile-stats > .profile-stat:nth-child(4),
.plus-profile-canvas[data-preview-mode="phone"] .profile-stats > .profile-stat:nth-child(5) {
  grid-column: span 2 !important;
}

.plus-profile-canvas[data-preview-mode="phone"] .profile-stat {
  width: 100% !important;
  min-width: 0 !important;
  min-height: 66px !important;
  padding: 8px 3px !important;
  gap: 3px !important;
  border-radius: 16px !important;
  box-sizing: border-box !important;
}

.plus-profile-canvas[data-preview-mode="phone"] .profile-stat strong {
  font-size: 22px !important;
  line-height: 1 !important;
}

.plus-profile-canvas[data-preview-mode="phone"] .profile-stat span {
  max-width: 100% !important;
  font-size: 11px !important;
  line-height: 1.15 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.plus-profile-canvas[data-preview-mode="phone"] .profile-main-actions {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)) !important;
  gap: 7px !important;
  width: 100% !important;
  margin: 14px auto 0 !important;
}

.plus-profile-canvas[data-preview-mode="phone"] .profile-main-actions > button:not(.hidden) {
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  height: 46px !important;
  min-height: 46px !important;
  margin: 0 !important;
  padding-inline: 5px !important;
  font-size: 14px !important;
  line-height: 1.15 !important;
}

/* Desktop mode is the exact normal 580px profile modal geometry. */
.plus-profile-canvas[data-preview-mode="desktop"] .profile-main-actions {
  display: flex !important;
  align-items: stretch !important;
  justify-content: center !important;
  flex-wrap: nowrap !important;
  gap: 10px !important;
  width: min(100%, 450px) !important;
  margin: 28px auto 0 !important;
}

.plus-profile-canvas[data-preview-mode="desktop"] .profile-main-actions > button:not(.hidden) {
  flex: 1 1 0 !important;
  width: 0 !important;
  min-width: 0 !important;
  max-width: none !important;
  height: 46px !important;
  min-height: 46px !important;
  margin: 0 !important;
  padding: 0 10px !important;
  white-space: nowrap !important;
}

/* Beat the older mode-specific preview padding/grid rules. The real profile
   shell itself owns every pixel of the canvas. */
.plus-profile-canvas[data-preview-mode="phone"] .plus-canvas-profile-content,
.plus-profile-canvas[data-preview-mode="desktop"] .plus-canvas-profile-content {
  position: relative !important;
  inset: auto !important;
  display: block !important;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  align-content: normal !important;
  align-items: normal !important;
  justify-content: normal !important;
  justify-items: normal !important;
  gap: 0 !important;
}


/* =========================================================
   EXACT PROFILE PREVIEW — v78 ROUNDING + CLIPPING FIX
   The live preview background and overlays must live inside the
   same rounded shell as the real profile, not the raw canvas.
   ========================================================= */
.plus-profile-canvas,
.plus-profile-canvas[data-preview-mode="desktop"],
.plus-profile-canvas[data-preview-mode="phone"] {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

.plus-preview-profile-shell.profile-modal.plus-profile-shell-active {
  position: relative !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: visible !important;
  border: 0 !important;
  border-radius: inherit !important;
  background: transparent !important;
  box-shadow: none !important;
}

.plus-preview-surface {
  position: relative !important;
  isolation: isolate !important;
  width: 100% !important;
  min-height: 100% !important;
  overflow: hidden !important;
  border: 1px solid color-mix(in srgb, var(--primary) 38%, var(--border)) !important;
  border-radius: inherit !important;
  background: var(--card) !important;
  box-shadow: 0 24px 70px var(--shadow), inset 0 1px 0 rgba(255,255,255,.14) !important;
}

.plus-preview-surface > #plusCanvasBackground,
.plus-preview-surface > #plusCanvasOverlays {
  position: absolute !important;
  inset: 0 !important;
  border-radius: inherit !important;
}

.plus-preview-surface > #plusCanvasBackground {
  z-index: 0 !important;
}

.plus-preview-surface > #plusCanvasOverlays {
  z-index: 1 !important;
  overflow: hidden !important;
  pointer-events: auto !important;
}

.plus-preview-surface > .plus-preview-profile-view {
  position: relative !important;
  z-index: 5 !important;
}

.plus-profile-canvas .plus-canvas-profile-content {
  overflow: visible !important;
}

.plus-profile-canvas[data-preview-mode="phone"] .profile-stats > .profile-stat:nth-child(1),
.plus-profile-canvas[data-preview-mode="phone"] .profile-stats > .profile-stat:nth-child(2) {
  grid-column: span 3 !important;
}

.plus-profile-canvas[data-preview-mode="phone"] .profile-stats > .profile-stat:nth-child(3),
.plus-profile-canvas[data-preview-mode="phone"] .profile-stats > .profile-stat:nth-child(4),
.plus-profile-canvas[data-preview-mode="phone"] .profile-stats > .profile-stat:nth-child(5) {
  grid-column: span 2 !important;
}

.plus-profile-canvas[data-preview-mode="phone"] .profile-main-actions {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)) !important;
  grid-auto-flow: row !important;
  gap: 7px !important;
  width: 100% !important;
  margin: 14px auto 0 !important;
}

.plus-profile-canvas[data-preview-mode="phone"] .profile-main-actions > button:not(.hidden) {
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
}


/* =========================================================
   LIVE PREVIEW NO-FLASH — v79
   Keep the persistent rounded preview on stable compositor layers. The
   expensive glass filters are deliberately disabled because transformed
   backdrop-filter descendants flash black on some Android Chromium GPUs.
   ========================================================= */
#profileViewSection.plus-background-active .profile-display-name,
#profileViewSection.plus-background-active .profile-handle,
#profileViewSection.plus-background-active .profile-bio,
#profileViewSection.plus-background-active .profile-stats,
#profileViewSection.plus-background-active .profile-connections-panel,
#profileViewSection.plus-background-active .profile-main-actions > button,
.plus-preview-profile-view.plus-background-active .profile-display-name,
.plus-preview-profile-view.plus-background-active .profile-handle,
.plus-preview-profile-view.plus-background-active .profile-bio,
.plus-preview-profile-view.plus-background-active .profile-stats,
.plus-preview-profile-view.plus-background-active .profile-connections-panel,
.plus-preview-profile-view.plus-background-active .profile-main-actions > button {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

.profile-background-layer,
.plus-canvas-background {
  filter: none !important;
  -webkit-filter: none !important;
  image-rendering: auto !important;
}

.plus-preview-surface,
.plus-preview-surface > #plusCanvasBackground,
.plus-preview-surface > #plusCanvasOverlays,
.plus-preview-surface > .plus-preview-profile-view {
  backface-visibility: hidden !important;
  -webkit-backface-visibility: hidden !important;
}

.plus-preview-surface,
.plus-preview-surface > #plusCanvasBackground {
  transform: translateZ(0);
}

.plus-preview-surface {
  contain: layout paint style;
}

.plus-profile-canvas.is-manipulating .plus-preview-surface,
.plus-profile-canvas.is-manipulating .plus-preview-profile-view {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}


/* v80 selection hit-test fix: overlay objects remain the actual pointer target. */
.plus-preview-surface > #plusCanvasOverlays {
  pointer-events: auto !important;
}

.plus-preview-surface .plus-overlay-object,
.plus-preview-surface .plus-overlay-handle {
  pointer-events: auto !important;
}

/* =========================================================
   YAPPER COLOR PICKER — v81
   Fully custom picker. No browser/Chrome/Google color popup.
   ========================================================= */
.plus-color-trigger {
  --picker-color: var(--primary);
  box-sizing: border-box !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  width: 100% !important;
  min-width: 0 !important;
  height: 43px !important;
  min-height: 43px !important;
  margin: 0 !important;
  padding: 4px !important;
  border: 1px solid color-mix(in srgb, var(--picker-color) 48%, var(--border)) !important;
  border-radius: 13px !important;
  background: color-mix(in srgb, var(--bubble) 90%, transparent) !important;
  color: var(--text) !important;
  cursor: pointer;
  overflow: hidden;
}

.plus-color-trigger:hover,
.plus-color-trigger:focus-visible {
  border-color: var(--picker-color) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--picker-color) 20%, transparent) !important;
}

.plus-color-trigger-swatch {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 30px;
  border-radius: 9px;
  background:
    linear-gradient(var(--picker-color), var(--picker-color)),
    conic-gradient(#ddd 25%, #fff 0 50%, #ddd 0 75%, #fff 0);
  background-size: auto, 12px 12px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35), inset 0 0 0 1px rgba(0,0,0,.28);
}

.plus-color-trigger-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  font-weight: 850;
}

.plus-control-row .plus-color-trigger,
.plus-custom-accent-controls .plus-color-trigger {
  width: 48px !important;
  min-width: 48px !important;
}

.plus-control-row .plus-color-trigger-value,
.plus-custom-accent-controls .plus-color-trigger-value,
.plus-gradient-color-trigger .plus-color-trigger-value {
  display: none;
}

.plus-gradient-color-trigger {
  width: 43px !important;
  min-width: 43px !important;
  height: 38px !important;
  min-height: 38px !important;
  border-radius: 11px !important;
}

.plus-yapper-color-overlay {
  position: fixed;
  z-index: 2147483646;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0,0,0,.68);
  overscroll-behavior: contain;
}

.plus-yapper-color-overlay.hidden {
  display: none !important;
}

.plus-yapper-color-panel {
  box-sizing: border-box;
  width: min(420px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  overflow: auto;
  padding: 16px;
  border: 1px solid color-mix(in srgb, var(--primary) 45%, var(--border));
  border-radius: 28px;
  background: var(--card);
  box-shadow: 0 30px 90px rgba(0,0,0,.62), inset 0 1px 0 rgba(255,255,255,.13);
}

.plus-yapper-color-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.plus-yapper-color-header h3 {
  margin: 2px 0 0;
  font-size: 22px;
  line-height: 1.1;
}

.plus-yapper-color-kicker {
  color: var(--primary);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .14em;
}

.plus-yapper-color-close {
  flex: 0 0 42px;
  width: 42px !important;
  min-width: 42px !important;
  height: 42px !important;
  min-height: 42px !important;
  padding: 0 0 2px !important;
  border-radius: 50% !important;
  font-size: 24px !important;
  line-height: 1 !important;
}

.plus-yapper-color-sv {
  --picker-hue: #ff0000;
  position: relative;
  width: 100%;
  aspect-ratio: 1.55 / 1;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 20px;
  background:
    linear-gradient(to top, #000, transparent),
    linear-gradient(to right, #fff, transparent),
    var(--picker-hue);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.22);
  cursor: crosshair;
  touch-action: none;
}

.plus-yapper-color-sv:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 45%, transparent);
  outline-offset: 3px;
}

.plus-yapper-color-sv-thumb {
  --picker-color: #ffffff;
  position: absolute;
  width: 22px;
  height: 22px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--picker-color);
  box-shadow: 0 2px 9px rgba(0,0,0,.75), inset 0 0 0 1px rgba(0,0,0,.24);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.plus-yapper-hue-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  margin-top: 15px;
  color: var(--secondary-text);
  font-size: 11px;
  font-weight: 900;
}

#plusYapperHueSlider {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 18px;
  margin: 0;
  border: 2px solid var(--border);
  border-radius: 999px;
  background: linear-gradient(90deg, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00);
  cursor: pointer;
}

#plusYapperHueSlider::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: transparent;
  box-shadow: 0 2px 7px rgba(0,0,0,.72);
}

#plusYapperHueSlider::-moz-range-thumb {
  width: 19px;
  height: 19px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: transparent;
  box-shadow: 0 2px 7px rgba(0,0,0,.72);
}

.plus-yapper-color-value-row {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: end;
  gap: 10px;
  margin-top: 15px;
}

.plus-yapper-color-preview {
  --picker-color: var(--primary);
  display: block;
  width: 54px;
  height: 48px;
  border: 1px solid color-mix(in srgb, var(--picker-color) 55%, var(--border));
  border-radius: 14px;
  background: var(--picker-color);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.32);
}

.plus-yapper-color-value-row label {
  display: grid;
  gap: 5px;
  color: var(--secondary-text);
  font-size: 10px;
  font-weight: 900;
}

#plusYapperColorHex {
  margin: 0 !important;
  text-transform: uppercase;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.plus-yapper-color-footer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 16px;
}

.plus-yapper-color-footer button {
  min-height: 46px;
}

body.yapper-color-picker-open {
  overflow: hidden !important;
}

/* Layer arrows now obey screen direction: ↑ actually moves the row up and
   ↓ actually moves it down. Keep both controls visible on phones. */
@media (max-width: 900px) {
  .plus-layer-item {
    grid-template-columns: 30px minmax(0, 1fr) repeat(5, 30px) !important;
    gap: 4px !important;
  }

  .plus-layer-item .plus-layer-up,
  .plus-layer-item .plus-layer-down {
    display: grid !important;
  }

  .plus-layer-item button {
    width: 30px !important;
    min-width: 30px !important;
    height: 30px !important;
    min-height: 30px !important;
  }
}

@media (max-width: 430px) {
  .plus-yapper-color-overlay {
    align-items: end;
    padding: 8px;
  }

  .plus-yapper-color-panel {
    width: 100%;
    border-radius: 26px 26px 18px 18px;
    padding-bottom: calc(14px + env(safe-area-inset-bottom));
  }

  .plus-yapper-color-sv {
    aspect-ratio: 1.7 / 1;
  }
}


/* =========================================================
   SETTINGS + MODERATION SURFACE FINAL — v199
   Desktop Settings keeps its exact v197 geometry and only removes the internal
   height cap/scrollbar. Phone dialogs keep all four rounded corners while their
   contents scroll inside the card. Delete User shares the Make Admin surface.
   ========================================================= */
@media (min-width: 701px) {
  #settingsMenu {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: hidden !important;
  }
}

/* These two confirmations deliberately share one geometry instead of merely
   carrying similar values in separate rules. */
#adminRoleModal .admin-role-modal,
#deleteUserModal .delete-user-modal {
  position: relative !important;
  width: min(430px, calc(100vw - 32px)) !important;
  max-width: 430px !important;
  max-height: calc(100dvh - 32px) !important;
  margin: auto !important;
  padding: 24px !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  border-radius: 42px !important;
  background-clip: padding-box !important;
  box-sizing: border-box !important;
}

#adminRoleModal .admin-role-password-wrap,
#deleteUserModal .delete-user-password-wrap {
  margin: 12px 0 0 !important;
}

@media (max-width: 700px) {
  #settingsMenu,
  #devicePreferencesMenu,
  #customizationMenu,
  #yapperPlusMenu,
  #authenticationModal .authentication-modal {
    border-radius: var(--ui-radius-surface, 38px) !important;
    background-clip: padding-box !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }

  #settingsMenu {
    padding-bottom: calc(22px + env(safe-area-inset-bottom)) !important;
  }

  #adminRoleModal .admin-role-modal,
  #deleteUserModal .delete-user-modal {
    width: min(390px, calc(100vw - 20px)) !important;
    max-width: 390px !important;
    max-height: calc(100dvh - 20px) !important;
    padding: 18px 14px 14px !important;
    border-radius: var(--ui-radius-surface, 38px) !important;
  }
}

/* =========================================================
   SETTINGS DRILL-IN REPAIR — v197
   The Make/Remove Admin confirmation is the rounding reference for every
   non-pill Settings surface. Keep the four entry actions equally sized and
   leave clear space between the last card and the account actions.
   ========================================================= */
#settingsMenu,
#devicePreferencesMenu,
#customizationMenu,
#yapperPlusMenu,
#authenticationModal .authentication-modal {
  border-radius: var(--ui-radius-surface, 42px) !important;
  background-clip: padding-box !important;
}

#settingsMenu .settings-section {
  border-radius: var(--ui-radius-surface, 42px) !important;
  background-clip: padding-box !important;
}

#settingsMenu .settings-section h3 {
  margin: 0 0 6px !important;
}

#settingsMenu .settings-section .settings-description {
  margin: 0 0 12px !important;
}

#settingsMenu .device-preferences-entry-button,
#settingsMenu .authentication-entry-button,
#settingsMenu .customization-entry-button,
#settingsMenu .yapper-plus-entry-button {
  width: 100% !important;
  min-width: 0 !important;
  min-height: 46px !important;
  box-sizing: border-box !important;
}

.device-preferences-modal,
.customization-modal,
.yapper-plus-modal,
.device-preferences-modal .device-preference-block,
#authenticationModal .authentication-section,
#authenticationModal .authentication-account-card,
#authenticationModal .verification-panel,
.plus-code-redeem-panel,
.plus-code-developer-panel,
.generated-plus-code-card,
.plus-code-history-item,
.plus-code-history-empty {
  border-radius: var(--ui-radius-surface, 42px) !important;
  background-clip: padding-box !important;
}

#settingsMenu .settings-account-actions {
  margin-top: 22px !important;
}

#deleteUserModal .delete-user-password-wrap {
  margin-top: 12px !important;
}

@media (max-width: 700px) {
  #settingsMenu,
  #devicePreferencesMenu,
  #customizationMenu,
  #yapperPlusMenu,
  #authenticationModal .authentication-modal {
    border-radius: var(--ui-radius-surface, 38px) var(--ui-radius-surface, 38px) 0 0 !important;
  }

  #settingsMenu .settings-account-actions {
    margin-top: 18px !important;
  }
}


/* =========================================================
   INVISIBLE SCROLLBARS — v82
   Keep scrolling everywhere, hide only the scrollbar bars.
   ========================================================= */
.plus-editor-panel,
.plus-editor-panel.mobile-active,
.plus-overlay-library-section,
#plusOverlayLibrary,
.plus-layer-list,
.plus-selected-controls,
.plus-code-history {
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

.plus-editor-panel::-webkit-scrollbar,
.plus-editor-panel.mobile-active::-webkit-scrollbar,
.plus-overlay-library-section::-webkit-scrollbar,
#plusOverlayLibrary::-webkit-scrollbar,
.plus-layer-list::-webkit-scrollbar,
.plus-selected-controls::-webkit-scrollbar,
.plus-code-history::-webkit-scrollbar {
  width: 0 !important;
  height: 0 !important;
  display: none !important;
}


/* =========================================================
   MOBILE COLOR PICKER FIX — v83
   Make the custom picker a real bottom sheet on phones and keep
   every control inside the panel instead of spilling out.
   ========================================================= */
.plus-yapper-color-overlay {
  padding:
    max(8px, env(safe-area-inset-top))
    max(8px, env(safe-area-inset-right))
    max(8px, env(safe-area-inset-bottom))
    max(8px, env(safe-area-inset-left));
}

.plus-yapper-color-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.plus-yapper-color-header,
.plus-yapper-hue-row,
.plus-yapper-color-value-row,
.plus-yapper-color-footer {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

.plus-yapper-color-header {
  flex: 0 0 auto;
}

.plus-yapper-color-sv,
.plus-yapper-hue-row,
.plus-yapper-color-value-row,
.plus-yapper-color-footer {
  flex: 0 0 auto;
}

#plusYapperColorHex {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

@media (max-width: 430px) {
  .plus-yapper-color-overlay {
    align-items: end;
    justify-items: stretch;
    padding: 8px;
  }

  .plus-yapper-color-panel {
    width: 100%;
    max-width: 100%;
    max-height: min(78dvh, calc(100dvh - 16px));
    padding: 14px 14px calc(14px + env(safe-area-inset-bottom));
    border-radius: 26px 26px 18px 18px;
    gap: 12px;
  }

  .plus-yapper-color-header h3 {
    font-size: 18px;
  }

  .plus-yapper-color-close {
    flex: 0 0 40px;
    width: 40px !important;
    min-width: 40px !important;
    height: 40px !important;
    min-height: 40px !important;
  }

  .plus-yapper-color-sv {
    aspect-ratio: 1.6 / 1;
    border-radius: 18px;
  }

  .plus-yapper-hue-row {
    gap: 8px;
  }

  .plus-yapper-color-value-row {
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 8px;
    align-items: end;
  }

  .plus-yapper-color-preview {
    width: 46px;
    height: 44px;
    border-radius: 12px;
  }

  .plus-yapper-color-footer {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .plus-yapper-color-footer button {
    min-width: 0;
    min-height: 44px;
    padding-inline: 8px;
  }
}


/* =========================================================
   MOBILE COLOR PICKER PERFORMANCE — v84
   Keep picker interaction on its own compositor layer. The JS now
   commits heavy app/profile recoloring only after Use color.
   ========================================================= */
.plus-yapper-color-panel {
  contain: layout paint style;
  transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.plus-yapper-color-sv,
#plusYapperHueSlider,
.plus-yapper-color-sv-thumb,
.plus-yapper-color-preview {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.plus-yapper-color-sv-thumb {
  will-change: left, top, background-color;
}

body.yapper-color-picker-open .plus-yapper-color-overlay {
  touch-action: none;
}


/* =========================================================
   PHONE PREVIEW STAT GAP FIX — v85
   Match the real phone profile exactly: Yaps and Likes sit at the
   same quarter-point positions instead of being pushed too far apart.
   ========================================================= */
.plus-profile-canvas[data-preview-mode="phone"] .profile-stats > .profile-stat:nth-child(1) {
  grid-column: 2 / span 2 !important;
}

.plus-profile-canvas[data-preview-mode="phone"] .profile-stats > .profile-stat:nth-child(2) {
  grid-column: 4 / span 2 !important;
}


/* =========================================================
   OVERLAY LIMIT — QUIET BADGE FEEDBACK v86
   No red inline error when the 48-overlay cap is reached.
   ========================================================= */
#plusOverlayCountLabel.plus-overlay-limit-bump {
  animation: plus-overlay-limit-bump .62s ease;
}

@keyframes plus-overlay-limit-bump {
  0%, 100% {
    transform: scale(1);
    box-shadow: none;
  }
  38% {
    transform: scale(1.12);
    background: color-mix(in srgb, var(--primary) 28%, var(--button));
    box-shadow: 0 0 0 5px color-mix(in srgb, var(--primary) 13%, transparent);
  }
}

@media (prefers-reduced-motion: reduce) {
  #plusOverlayCountLabel.plus-overlay-limit-bump {
    animation: none;
    background: color-mix(in srgb, var(--primary) 24%, var(--button));
  }
}


/* =========================================================
   ACCENT STATUS — TEMPORARY TEXT, NEVER AN EMPTY PILL
   ========================================================= */
.plus-accent-block .plus-inline-status {
  display: block;
  min-height: 0;
  max-height: 0;
  height: auto;
  margin: 0 2px;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--secondary-text);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  white-space: normal;
  text-overflow: clip;
  opacity: 0;
  transition: max-height .2s ease, margin-top .2s ease, opacity .15s ease;
}

.plus-accent-block .plus-inline-status:not(.is-empty) {
  display: block;
  max-height: 72px;
  margin-top: 9px;
  opacity: 1;
}

.plus-accent-block .plus-inline-status.success,
.plus-accent-block .plus-inline-status.error {
  border: 0;
  background: transparent;
  color: var(--secondary-text);
}


/* =========================================================
   v102 — compositor-safe renderer
   The old liquid-glass stack put backdrop blur on nearly every card,
   button, field, and modal. On some Chromium/GPU combinations the whole
   webpage surface dropped out between frames. Keep the same layout and
   palette, but remove those continuously composited blur layers.
   ========================================================= */
html,
body,
body[data-theme="light"],
body[data-theme="dark"] {
  background-attachment: scroll !important;
}

body *,
body *::before,
body *::after {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

/* Large surfaces should never be promoted just for hover/entrance motion. */
.card,
.yap,
.modal-overlay,
.modal-surface,
.settings-card,
.profile-modal,
.search-modal,
.delete-modal,
.dm-overlay,
.dm-modal,
.dm-panel,
.dm-message-list,
.dm-inbox-list {
  will-change: auto !important;
}

.card,
.yap,
button,
input,
textarea,
.file-picker-label,
.modal-overlay,
.modal-surface,
.settings-card,
.profile-connections-panel {
  transition-property: background-color, border-color, color, opacity !important;
  transition-duration: 100ms !important;
  transition-timing-function: ease-out !important;
}

.yap:hover,
.card:hover,
button:hover,
button:active,
input:focus,
textarea:focus,
.profile-stat-button:hover {
  transform: none !important;
}

.modal-overlay:not(.hidden),
.modal-overlay:not(.hidden) .modal-surface,
.modal-overlay.is-closing,
.modal-overlay.is-closing .modal-surface,
.settings-card:not(.hidden),
.profile-connections-panel:not(.hidden),
.dm-overlay:not(.hidden),
.dm-overlay:not(.hidden) .dm-modal {
  animation: none !important;
  transform: none !important;
}

/* Keep overlays opaque enough that removing blur never creates a flashing
   transparent frame while Chrome changes compositor surfaces. */
.modal-overlay,
.dm-overlay {
  background: rgba(5, 5, 6, 0.88) !important;
}

body[data-theme="light"] .modal-overlay,
body[data-theme="light"] .dm-overlay {
  background: rgba(232, 232, 232, 0.94) !important;
}


/* =========================================================
   v111 — live preview header pill shape
   The top "Live preview" header section in the profile editor should
   be a pill-shaped bar instead of a generic rounded rectangle.
   ========================================================= */
.plus-editor-preview-panel > .plus-editor-section:first-child {
  border-radius: 999px !important;
  padding: 12px 16px !important;
}

.plus-editor-preview-panel > .plus-editor-section:first-child .plus-editor-heading-row {
  min-height: 24px;
}

@media (max-width: 900px) {
  .plus-editor-preview-panel > .plus-editor-section:first-child {
    border-radius: 999px !important;
    padding: 11px 14px !important;
  }
}


/* v115 — center every profile-editor/color-picker X with the shared SVG. */
.plus-yapper-color-close,
.plus-mini-icon-button,
.plus-layer-item button[data-layer-action="delete"] {
  display: inline-grid !important;
  place-items: center !important;
  padding: 0 !important;
  line-height: 0 !important;
}

/* v118 — overlay delete handles must remain hidden unless that overlay is
   actually selected. v115's global display override made every X permanent. */
.plus-profile-editor-modal .plus-overlay-delete-handle {
  display: none !important;
  place-items: center !important;
  padding: 0 !important;
  line-height: 0 !important;
}

.plus-profile-editor-modal .plus-overlay-object.is-selected .plus-overlay-delete-handle {
  display: grid !important;
}

.plus-yapper-color-close .yapper-x-icon {
  width: 17px;
  height: 17px;
}

.plus-mini-icon-button .yapper-x-icon,
.plus-overlay-delete-handle .yapper-x-icon,
.plus-layer-item button[data-layer-action="delete"] .yapper-x-icon {
  width: 12px;
  height: 12px;
}


/* v116 — center the X inside the cloned live profile preview. */
.plus-preview-profile-shell > .plus-preview-profile-close.modal-close-button .yapper-x-icon {
  display: block !important;
  width: 18px !important;
  height: 18px !important;
  margin: 0 !important;
  flex: 0 0 auto !important;
}

/* =========================================================
   v121 — restore profile bio bubble
   Keep saved-profile bios inside the same readable glass pill used by
   the name/handle, including on mobile and inside the live preview.
   ========================================================= */
#profileViewSection.plus-background-active .profile-bio,
.plus-preview-profile-view.plus-background-active .profile-bio {
  display: block !important;
  width: fit-content !important;
  max-width: calc(100% - 24px) !important;
  box-sizing: border-box !important;
  margin: 14px auto !important;
  padding: 7px 13px !important;
  border: 1px solid color-mix(in srgb, var(--primary) 22%, var(--border)) !important;
  border-radius: 999px !important;
  background: color-mix(in srgb, var(--card) 84%, transparent) !important;
  color: var(--text) !important;
  line-height: 1.4 !important;
  text-align: center !important;
  box-shadow: inset 0 1px 0 color-mix(in srgb, white 10%, transparent) !important;
}

/* Multiline bios keep soft rounded corners instead of becoming a huge capsule. */
#profileViewSection.plus-background-active .profile-bio:not(:empty),
.plus-preview-profile-view.plus-background-active .profile-bio:not(:empty) {
  border-radius: 22px !important;
}

@media (max-width: 700px) {
  #profileViewSection.plus-background-active .profile-bio,
  .plus-preview-profile-view.plus-background-active .profile-bio {
    max-width: calc(100% - 28px) !important;
    padding: 7px 12px !important;
  }
}


/* =========================================================
   v122 — profile bio bubble on every account
   Bio readability must not depend on having a custom Plus background.
   ========================================================= */
#profileViewSection .profile-bio:not(.empty),
.plus-preview-profile-view .profile-bio:not(.empty) {
  display: block !important;
  width: fit-content !important;
  max-width: calc(100% - 24px) !important;
  box-sizing: border-box !important;
  margin: 14px auto !important;
  padding: 7px 13px !important;
  border: 1px solid color-mix(in srgb, var(--primary) 22%, var(--border)) !important;
  border-radius: 999px !important;
  background: color-mix(in srgb, var(--card) 84%, transparent) !important;
  color: var(--text) !important;
  line-height: 1.4 !important;
  text-align: center !important;
  box-shadow: inset 0 1px 0 color-mix(in srgb, white 10%, transparent) !important;
}

@media (max-width: 700px) {
  #profileViewSection .profile-bio:not(.empty),
  .plus-preview-profile-view .profile-bio:not(.empty) {
    max-width: calc(100% - 28px) !important;
    padding: 7px 12px !important;
  }
}


/* =========================================================
   v123 — identity bubbles on every profile
   Name and @handle capsules must not depend on a custom Plus background.
   Keep the same identity styling on normal profiles and editor previews.
   ========================================================= */
#profileViewSection .profile-display-name,
#profileViewSection .profile-handle,
.plus-preview-profile-view .profile-display-name,
.plus-preview-profile-view .profile-handle {
  display: flex !important;
  width: fit-content !important;
  max-width: calc(100% - 24px) !important;
  box-sizing: border-box !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding: 5px 11px !important;
  align-items: center !important;
  justify-content: center !important;
  flex-wrap: nowrap !important;
  gap: 3px !important;
  border: 1px solid color-mix(in srgb, var(--primary) 18%, var(--border)) !important;
  border-radius: 999px !important;
  background: color-mix(in srgb, var(--card) 84%, transparent) !important;
  box-shadow: inset 0 1px 0 color-mix(in srgb, white 10%, transparent) !important;
}

#profileViewSection .profile-display-name,
.plus-preview-profile-view .profile-display-name {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

#profileViewSection .profile-handle,
.plus-preview-profile-view .profile-handle {
  margin-top: 7px !important;
  margin-bottom: 0 !important;
}

@media (max-width: 700px) {
  #profileViewSection .profile-display-name,
  #profileViewSection .profile-handle,
  .plus-preview-profile-view .profile-display-name,
  .plus-preview-profile-view .profile-handle {
    max-width: calc(100% - 28px) !important;
    padding: 5px 10px !important;
  }
}


/* =========================================================
   v125 — desktop-preview-only stats outer capsule
   Desktop preview uses the long capsule. Phone preview keeps the
   normal rounded two-row stats panel.
   ========================================================= */
.plus-profile-canvas[data-preview-mode="desktop"] .profile-stats,
.plus-profile-canvas[data-preview-mode="desktop"] .plus-preview-stats {
  border-radius: 999px !important;
  background-clip: padding-box !important;
}

.plus-profile-canvas[data-preview-mode="phone"] .profile-stats,
.plus-profile-canvas[data-preview-mode="phone"] .plus-preview-stats {
  border-radius: 34px !important;
}


/* =========================================================
   v127 — mobile profile-editor help text fitting
   Wrap the canvas instructions inside the phone viewport instead of
   allowing the desktop-length sentence to overflow horizontally.
   ========================================================= */
@media (max-width: 900px) {
  .plus-editor-preview-panel .plus-canvas-help {
    display: block !important;
    width: min(100%, 430px) !important;
    max-width: calc(100vw - 28px) !important;
    margin: 8px auto 0 !important;
    padding: 0 10px 5px !important;
    box-sizing: border-box !important;
    white-space: normal !important;
    overflow-wrap: break-word !important;
    word-break: normal !important;
    text-align: center !important;
    font-size: 11px !important;
    line-height: 1.35 !important;
  }
}

@media (max-width: 430px) {
  .plus-editor-preview-panel .plus-canvas-help {
    max-width: calc(100vw - 20px) !important;
    padding-inline: 8px !important;
    font-size: 10.5px !important;
    line-height: 1.32 !important;
  }
}


/* =========================================================
   v128 — restore real phone preview + correctly placed help
   The phone preview uses the full available phone width and its natural
   content height. The help belongs below the profile, never underneath it.
   ========================================================= */
@media (max-width: 900px) {
  .plus-editor-preview-panel.mobile-active {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    height: auto !important;
    min-height: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }

  .plus-editor-preview-panel .plus-canvas-shell {
    display: block !important;
    flex: 0 0 auto !important;
    width: 100% !important;
    min-height: 0 !important;
    height: auto !important;
    padding: 0 !important;
    overflow: visible !important;
  }

  .plus-editor-preview-panel .plus-profile-canvas[data-preview-mode="phone"] {
    width: min(390px, 100vw) !important;
    max-width: none !important;
    max-height: none !important;
    height: auto !important;
    margin: 0 auto !important;
  }

  .plus-editor-preview-panel .plus-canvas-help {
    position: relative !important;
    z-index: 1 !important;
    flex: 0 0 auto !important;
    width: 100% !important;
    max-width: 430px !important;
    margin: 0 auto !important;
    padding: 0 18px 16px !important;
    box-sizing: border-box !important;
    white-space: normal !important;
    overflow: visible !important;
    overflow-wrap: normal !important;
    text-align: center !important;
    font-size: 12px !important;
    line-height: 1.35 !important;
  }
}

@media (max-width: 430px) {
  .plus-editor-preview-panel .plus-canvas-help {
    padding-inline: 16px !important;
    font-size: 11.5px !important;
  }
}


/* =========================================================
   v130 — phone preview Edit profile parity
   The live phone preview must match the real mobile profile: keep the
   original accent button, original 46px sizing/type, and move it upward.
   ========================================================= */
.plus-profile-canvas[data-preview-mode="phone"] .profile-main-actions {
  display: flex !important;
  align-items: stretch !important;
  justify-content: center !important;
  width: 100% !important;
  max-width: none !important;
  margin: 5px auto 0 !important;
  gap: 7px !important;
}

.plus-profile-canvas[data-preview-mode="phone"] .profile-edit-button:not(.hidden) {
  flex: 1 1 0 !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  height: 46px !important;
  min-height: 46px !important;
  max-height: 46px !important;
  margin: 0 !important;
  padding: 0 5px !important;
  border-radius: 999px !important;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.19) 0%, transparent 46%),
    var(--primary) !important;
  color: var(--primary-text) !important;
  border-color: var(--glass-highlight) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.34),
    inset 0 -1px 0 rgba(0, 0, 0, 0.18),
    0 9px 24px var(--glass-shadow) !important;
  font-size: clamp(11px, 3.25vw, 14px) !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}


/* =========================================================
   DEVICE PREFERENCES STATUS PARITY — ACTUAL ELEMENTS
   #themeMessage is owned by yapper-online.js, not the Plus modal script.
   Match Accent Color's status exactly.
   ========================================================= */
.appearance-preference-block #themeMessage {
  display: block !important;
  min-height: 0 !important;
  max-height: 0 !important;
  height: auto !important;
  margin: 0 2px !important;
  padding: 0 !important;
  overflow: hidden !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: var(--secondary-text) !important;
  font-family: inherit !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  line-height: 1.35 !important;
  white-space: normal !important;
  text-overflow: clip !important;
  opacity: 0 !important;
  transition: max-height .2s ease, margin-top .2s ease, opacity .15s ease !important;
}

.appearance-preference-block #themeMessage:not(:empty) {
  max-height: 72px !important;
  margin-top: 9px !important;
  opacity: 1 !important;
}



/* Outline Glow transient status — same compact rhythm as Accent Color.
   IMPORTANT: never display:none, because max-height/margin/opacity need to animate. */
#plusYapGlowStatus {
  display: block !important;
  box-sizing: border-box !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: 0 !important;
  margin: 0 2px !important;
  padding: 0 !important;
  overflow: hidden !important;

  border: 0 !important;
  background: transparent !important;
  color: var(--secondary-text) !important;
  font-family: inherit !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  line-height: 1.35 !important;

  opacity: 0 !important;
  transform: translateY(-3px);
  transition:
    max-height .22s ease,
    margin-top .22s ease,
    opacity .16s ease,
    transform .22s ease !important;
}

/* Open only enough room for the one-line status — no oversized blank area. */
#plusYapGlowStatus:not(.is-empty):not(:empty) {
  max-height: 18px !important;
  margin-top: 9px !important;
  opacity: 1 !important;
  transform: translateY(0);
}

/* Closed state keeps zero layout height while remaining animatable. */
#plusYapGlowStatus.is-empty,
#plusYapGlowStatus:empty {
  max-height: 0 !important;
  margin-top: 0 !important;
  opacity: 0 !important;
  transform: translateY(-3px);
}




/* TRUE Outline Glow spacing fix:
   the card itself must not reserve a status row. */
#plusYapGlowBlock {
  padding-bottom: 14px !important;
}

/* Closed = literally zero geometry. Keep display:block so transitions survive. */
#plusYapGlowStatus,
#plusYapGlowStatus.is-empty,
#plusYapGlowStatus:empty {
  display: block !important;
  box-sizing: border-box !important;
  min-height: 0 !important;
  height: 0 !important;
  max-height: 0 !important;
  margin: 0 2px !important;
  padding: 0 !important;
  overflow: hidden !important;
  opacity: 0 !important;
  transform: translateY(-3px);
  transition:
    height .22s ease,
    max-height .22s ease,
    margin-top .22s ease,
    opacity .16s ease,
    transform .22s ease !important;
}

/* Open = only the text's actual 16px line + 8px separation from buttons.
   No extra bottom padding is added to the card. */
#plusYapGlowStatus:not(.is-empty):not(:empty) {
  height: 16px !important;
  max-height: 16px !important;
  margin-top: 8px !important;
  margin-bottom: 0 !important;
  opacity: 1 !important;
  transform: translateY(0);
}

/* Keep every notification at a stable responsive size and use the same true
   pill geometry at desktop and phone widths. */
.notifications-list .notification-item {
  box-sizing: border-box !important;
  width: 100% !important;
  min-width: 0 !important;
  height: auto !important;
  min-height: 68px !important;
  padding: 8px 12px 8px 11px !important;
  grid-template-columns: 46px minmax(0, 1fr) 10px !important;
  gap: 8px !important;
  align-items: center !important;
  border-radius: 9999px !important;
  transform: none !important;
}

.notifications-list .notification-copy {
  min-width: 0 !important;
  overflow: hidden !important;
  gap: 4px !important;
}

.notifications-list .notification-message,
.notifications-list .notification-date {
  display: block !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  overflow: hidden !important;
  white-space: nowrap !important;
  text-overflow: ellipsis !important;
  line-height: 1.25 !important;
}

@media (max-width: 540px) {
  .notifications-list .notification-item {
    height: 64px !important;
    min-height: 64px !important;
    max-height: 64px !important;
    padding: 10px !important;
    grid-template-columns: 42px minmax(0, 1fr) 9px !important;
    gap: 7px !important;
    overflow: hidden !important;
  }

  .notifications-list .avatar-notification {
    width: 42px !important;
    height: 42px !important;
    margin: 0 !important;
    justify-self: center !important;
    align-self: center !important;
  }

}

/* =========================================================
   v150 — line-aware profile status tail alignment + reversible timer picker
   Single-line pills keep the gently angled tail. Wrapped statuses use a
   straight, centred tail and sit farther back against the avatar.
   ========================================================= */
#profileViewSection .profile-avatar-status-wrap,
.plus-preview-profile-view .profile-avatar-status-wrap {
  position: relative !important;
  width: 100% !important;
  min-height: 126px !important;
}

#profileViewSection .profile-avatar-status-wrap > #profileAvatarDisplay,
.plus-preview-profile-view .profile-avatar-status-wrap > div:first-child {
  position: relative !important;
  z-index: 2 !important;
}

#profileViewSection .profile-status-bubble,
.plus-preview-profile-view .profile-status-bubble {
  position: absolute !important;
  z-index: 5 !important;
  top: 54px !important;
  left: calc(50% + 41px) !important;
  width: max-content !important;
  max-width: min(210px, calc(50% - 52px)) !important;
  box-sizing: border-box !important;
  margin: 0 !important;
  padding: 8px 12px !important;
  border: 1px solid color-mix(in srgb, var(--primary) 52%, var(--border)) !important;
  border-radius: 18px !important;
  background: color-mix(in srgb, var(--card) 88%, var(--primary) 12%) !important;
  color: var(--text) !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  line-height: 1.28 !important;
  text-align: left !important;
  overflow-wrap: anywhere !important;
  box-shadow:
    0 9px 24px color-mix(in srgb, var(--shadow) 88%, transparent),
    inset 0 1px 0 color-mix(in srgb, white 13%, transparent) !important;
  overflow: visible !important;
  transform: translateY(-50%) !important;
  transform-origin: left center !important;
  animation: profileStatusBubbleIn .28s cubic-bezier(.2,.85,.25,1) both;
}

#profileViewSection .profile-status-bubble > span,
.plus-preview-profile-view .profile-status-bubble > span {
  display: block !important;
  position: relative !important;
  z-index: 2 !important;
}

#profileViewSection .profile-status-bubble.is-multiline,
.plus-preview-profile-view .profile-status-bubble.is-multiline {
  left: calc(50% + 37px) !important;
}

#profileViewSection .profile-status-bubble::before,
.plus-preview-profile-view .profile-status-bubble::before {
  position: absolute !important;
  z-index: 1 !important;
  left: -4px !important;
  top: calc(50% + 2px) !important;
  bottom: auto !important;
  width: 9px !important;
  height: 9px !important;
  content: "" !important;
  border-left: 1px solid color-mix(in srgb, var(--primary) 52%, var(--border)) !important;
  border-bottom: 1px solid color-mix(in srgb, var(--primary) 52%, var(--border)) !important;
  border-bottom-left-radius: 3px !important;
  background: color-mix(in srgb, var(--card) 88%, var(--primary) 12%) !important;
  transform: translateY(-50%) rotate(35deg) !important;
  transform-origin: center !important;
  pointer-events: none !important;
}

#profileViewSection .profile-status-bubble.is-multiline::before,
.plus-preview-profile-view .profile-status-bubble.is-multiline::before {
  top: 50% !important;
  transform: translateY(-50%) rotate(45deg) !important;
}

#profileViewSection .profile-status-bubble::after,
.plus-preview-profile-view .profile-status-bubble::after {
  display: none !important;
  content: none !important;
}

#profileViewSection .profile-status-bubble.hidden,
.plus-preview-profile-view .profile-status-bubble.hidden {
  display: none !important;
}

@keyframes profileStatusBubbleIn {
  from {
    opacity: 0;
    transform: translateY(-50%) translateX(-5px) scale(.94);
  }
  to {
    opacity: 1;
    transform: translateY(-50%) translateX(0) scale(1);
  }
}

.profile-status-editor {
  position: relative !important;
  box-sizing: border-box !important;
  width: 100% !important;
  margin: 16px 0 0 !important;
  padding: 16px !important;
  border: 1px solid color-mix(in srgb, var(--primary) 28%, var(--border)) !important;
  border-radius: var(--ui-radius-panel, 34px) !important;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--primary) 10%, transparent), transparent 54%),
    var(--bubble) !important;
  background-clip: padding-box !important;
  box-shadow: inset 0 1px 0 color-mix(in srgb, white 10%, transparent) !important;
}

.profile-status-editor-heading {
  display: flex !important;
  align-items: flex-start !important;
  justify-content: space-between !important;
  gap: 14px !important;
}

.profile-status-editor-heading h3 {
  margin: 0 !important;
  color: var(--text) !important;
  font-size: 17px !important;
  line-height: 1.2 !important;
}

.profile-status-editor-heading p {
  margin: 5px 0 0 !important;
  color: var(--secondary-text) !important;
  font-size: 12px !important;
  line-height: 1.35 !important;
}

.profile-status-counter {
  flex: 0 0 auto !important;
  min-width: 48px !important;
  padding: 5px 9px !important;
  border: 1px solid color-mix(in srgb, var(--primary) 25%, var(--border)) !important;
  border-radius: 999px !important;
  background: color-mix(in srgb, var(--card) 74%, transparent) !important;
  color: var(--secondary-text) !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  text-align: center !important;
}

.profile-status-input-row {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 50px !important;
  align-items: center !important;
  gap: 10px !important;
  width: 100% !important;
  margin: 13px 0 0 !important;
}

#profileStatusInput {
  width: 100% !important;
  min-width: 0 !important;
  height: 50px !important;
  min-height: 50px !important;
  margin: 0 !important;
  border-radius: 999px !important;
}

.profile-modal .profile-status-timer-button {
  display: grid !important;
  place-items: center !important;
  width: 50px !important;
  min-width: 50px !important;
  max-width: 50px !important;
  height: 50px !important;
  min-height: 50px !important;
  max-height: 50px !important;
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 50% !important;
  background: color-mix(in srgb, var(--button) 92%, var(--primary) 8%) !important;
  color: var(--text) !important;
  box-shadow: inset 0 1px 0 color-mix(in srgb, white 11%, transparent) !important;
}

.profile-modal .profile-status-timer-button:hover,
.profile-modal .profile-status-timer-button.active {
  border-color: color-mix(in srgb, var(--primary) 72%, var(--border)) !important;
  background: color-mix(in srgb, var(--button) 76%, var(--primary) 24%) !important;
  color: var(--primary) !important;
}

.profile-status-timer-icon {
  width: 24px !important;
  height: 24px !important;
  overflow: visible !important;
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 1.9 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
}

.profile-status-duration-menu {
  position: fixed !important;
  left: var(--profile-status-menu-left, 12px) !important;
  top: var(--profile-status-menu-top, 12px) !important;
  right: auto !important;
  bottom: auto !important;
  z-index: 1260 !important;
  display: grid !important;
  grid-template-rows: auto minmax(0, 1fr) !important;
  gap: 6px !important;
  box-sizing: border-box !important;
  width: 192px !important;
  min-width: 192px !important;
  max-width: calc(100vw - 24px) !important;
  height: min(198px, calc(100dvh - 24px)) !important;
  min-height: 0 !important;
  max-height: calc(100dvh - 24px) !important;
  margin: 0 !important;
  padding: 10px 8px 8px !important;
  border: 1px solid var(--glass-border) !important;
  border-radius: var(--ui-radius-item, 28px) !important;
  background:
    linear-gradient(145deg, var(--glass-highlight-soft) 0%, transparent 42%),
    var(--glass-card-strong) !important;
  box-shadow:
    inset 0 1px 0 var(--glass-highlight),
    0 18px 48px var(--glass-shadow-deep) !important;
  overflow: hidden !important;
  -webkit-backdrop-filter: blur(24px) contrast(1.05) !important;
  backdrop-filter: blur(24px) contrast(1.05) !important;
  transform-origin: top right !important;
  animation: profileStatusPickerIn .22s cubic-bezier(.2,.8,.25,1) both;
}

.profile-status-duration-menu.opens-above {
  transform-origin: bottom right !important;
}

.profile-status-duration-menu.hidden {
  display: none !important;
}

.profile-status-duration-menu.is-closing {
  pointer-events: none !important;
  animation: profileStatusPickerOut .19s cubic-bezier(.4, 0, .85, .25) both !important;
}

.profile-status-duration-menu-heading {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 7px !important;
  margin: 0 3px 2px !important;
  color: var(--text) !important;
  font-size: 10.5px !important;
  line-height: 1 !important;
}

.profile-status-duration-menu-heading > span {
  padding: 3px 6px !important;
  border: 1px solid color-mix(in srgb, var(--primary) 28%, var(--border)) !important;
  border-radius: 999px !important;
  background: color-mix(in srgb, var(--primary) 10%, transparent) !important;
  color: var(--secondary-text) !important;
  font-size: 8.5px !important;
  font-weight: 800 !important;
}

.profile-status-duration-options {
  display: flex !important;
  flex-direction: column !important;
  gap: 3px !important;
  width: 100% !important;
  min-height: 0 !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 1px 2px 1px 1px !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain !important;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
  -webkit-overflow-scrolling: touch !important;
}

.profile-modal .profile-status-duration-button {
  width: 100% !important;
  min-width: 0 !important;
  min-height: 32px !important;
  height: 32px !important;
  max-height: 32px !important;
  margin: 0 !important;
  padding: 0 10px !important;
  justify-content: flex-start !important;
  border-radius: 999px !important;
  font-size: 11.5px !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}

.profile-modal .profile-status-duration-button.active,
.profile-modal .profile-status-duration-button[aria-checked="true"] {
  border-color: var(--primary) !important;
  background: var(--primary) !important;
  color: var(--primary-text) !important;
  box-shadow: 0 7px 18px color-mix(in srgb, var(--primary) 24%, transparent) !important;
}

.profile-status-duration-options::-webkit-scrollbar {
  width: 0 !important;
  height: 0 !important;
  display: none !important;
}

.profile-status-duration-options::-webkit-scrollbar-track {
  border-radius: 999px !important;
  background: color-mix(in srgb, var(--bubble) 72%, transparent) !important;
}

.profile-status-duration-options::-webkit-scrollbar-thumb {
  border-radius: 999px !important;
  background: color-mix(in srgb, var(--primary) 56%, var(--border)) !important;
}

@keyframes profileStatusPickerIn {
  from {
    opacity: 0;
    transform: translateY(-5px) scale(.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes profileStatusPickerOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(-5px) scale(.985);
  }
}

@media (prefers-reduced-motion: reduce) {
  .profile-status-duration-menu,
  .profile-status-duration-menu.is-closing {
    animation-duration: 1ms !important;
  }
}

.profile-status-hint {
  margin: 9px 4px 0 !important;
  color: var(--secondary-text) !important;
  font-size: 11px !important;
  line-height: 1.35 !important;
}

@media (max-width: 700px) {
  .profile-status-editor {
    padding: 14px !important;
    border-radius: 29px !important;
  }

  .profile-modal .profile-status-duration-button {
    min-height: 32px !important;
    height: 32px !important;
    max-height: 32px !important;
  }
}

@media (max-width: 540px) {
  #profileViewSection .profile-avatar-status-wrap,
  .plus-preview-profile-view .profile-avatar-status-wrap {
    min-height: 98px !important;
  }

  #profileViewSection .profile-status-bubble,
  .plus-preview-profile-view .profile-status-bubble {
    top: 36px !important;
    left: calc(50% + 30px) !important;
    max-width: min(184px, calc(50% - 38px)) !important;
    padding: 7px 10px !important;
    border-radius: 16px !important;
    font-size: 12px !important;
  }

  #profileViewSection .profile-status-bubble.is-multiline,
  .plus-preview-profile-view .profile-status-bubble.is-multiline {
    left: calc(50% + 26px) !important;
  }
}

/* The phone switch inside the Plus editor must use real mobile avatar/status
   geometry even when the editor itself is open on a wide desktop screen. */
.plus-profile-canvas[data-preview-mode="phone"] .profile-avatar-status-wrap {
  min-height: 98px !important;
}

.plus-profile-canvas[data-preview-mode="phone"] .profile-status-bubble {
  top: 36px !important;
  left: calc(50% + 30px) !important;
  max-width: min(184px, calc(50% - 38px)) !important;
  padding: 7px 10px !important;
  border-radius: 16px !important;
  font-size: 12px !important;
}

.plus-profile-canvas[data-preview-mode="phone"] .profile-status-bubble.is-multiline {
  left: calc(50% + 26px) !important;
}


/* =========================================================
   UNIFIED ROUNDED COLOR PICKER — v166
   Use the same centered modal geometry and roundness system on phones and
   desktop. Only the available viewport width is allowed to adapt.
   ========================================================= */
.plus-yapper-color-overlay {
  align-items: center !important;
  justify-items: center !important;
  place-items: center !important;
}

.plus-yapper-color-panel {
  width: min(420px, calc(100vw - 24px)) !important;
  max-width: 420px !important;
  max-height: calc(100dvh - 24px) !important;
  padding: 16px !important;
  border-radius: var(--ui-radius-surface, 30px) !important;
  gap: 14px !important;
}

.plus-yapper-color-sv {
  aspect-ratio: 1.55 / 1 !important;
  border-radius: var(--ui-radius-field, 22px) !important;
}

.plus-yapper-color-preview {
  width: 54px !important;
  height: 48px !important;
  border-radius: var(--ui-radius-item, 20px) !important;
}

.plus-yapper-color-header h3 {
  font-size: 22px !important;
}

.plus-yapper-color-close {
  flex-basis: 42px !important;
  width: 42px !important;
  min-width: 42px !important;
  height: 42px !important;
  min-height: 42px !important;
}

.plus-yapper-hue-row {
  gap: 12px !important;
}

.plus-yapper-color-value-row {
  grid-template-columns: 54px minmax(0, 1fr) !important;
  gap: 10px !important;
}

.plus-yapper-color-footer {
  gap: 9px !important;
}

.plus-yapper-color-footer button {
  min-height: 46px !important;
}

@media (max-width: 430px) {
  .plus-yapper-color-overlay {
    padding:
      max(12px, env(safe-area-inset-top))
      max(12px, env(safe-area-inset-right))
      max(12px, env(safe-area-inset-bottom))
      max(12px, env(safe-area-inset-left)) !important;
  }

  .plus-yapper-color-panel {
    width: min(420px, calc(100vw - 24px)) !important;
    max-width: 420px !important;
    max-height: calc(100dvh - 24px) !important;
    padding: 16px !important;
    border-radius: var(--ui-radius-surface, 28px) !important;
    gap: 14px !important;
  }
}

/* v199 phone-only cascade lock: do not alter the approved desktop geometry. */
@media (max-width: 700px) {
  #settingsMenu,
  #devicePreferencesMenu,
  #customizationMenu,
  #yapperPlusMenu,
  #authenticationModal .authentication-modal,
  #adminRoleModal .admin-role-modal,
  #deleteUserModal .delete-user-modal {
    border-radius: var(--ui-radius-surface, 38px) !important;
    background-clip: padding-box !important;
  }
}


/* =========================================================
   V218 — COMPLETE PROFILE BACKGROUND EDITOR VISUAL PASS
   Cards use Yapper's heavy surface language, selectors/actions stay pills,
   and icon-only controls stay circles. This block intentionally lives last:
   older mobile compatibility rules are more specific than the base editor.
   ========================================================= */
.plus-profile-editor-overlay > .plus-profile-editor-modal.modal-surface {
  --plus-editor-card-radius: 32px;
  --plus-editor-tile-radius: 24px;
  --plus-editor-soft-radius: 28px;
  border-radius: var(--ui-radius-surface, 42px) !important;
  background-clip: padding-box !important;
}

.plus-profile-editor-modal .plus-editor-section {
  border-radius: var(--plus-editor-card-radius, 32px) !important;
  background-clip: padding-box !important;
}

.plus-profile-editor-modal .plus-editor-section .plus-editor-heading-row {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
}

.plus-profile-editor-modal .plus-editor-section .plus-label {
  display: inline-flex !important;
  flex: 0 0 auto !important;
  justify-self: end !important;
  width: max-content !important;
  min-width: 0 !important;
  max-width: 100% !important;
  border-radius: 9999px !important;
}

.plus-profile-editor-modal .plus-gradient-preview {
  border-radius: var(--plus-editor-soft-radius, 28px) !important;
  background-clip: padding-box !important;
}

.plus-profile-editor-modal .plus-overlay-library-button {
  border-radius: var(--plus-editor-tile-radius, 24px) !important;
  background-clip: padding-box !important;
}

.plus-profile-editor-modal .plus-selected-empty,
.plus-profile-editor-modal .plus-layers-empty {
  border-radius: var(--plus-editor-soft-radius, 28px) !important;
  background-clip: padding-box !important;
}

.plus-profile-editor-modal .plus-layer-item {
  border-radius: var(--plus-editor-tile-radius, 24px) !important;
  background-clip: padding-box !important;
}

.plus-profile-editor-modal .plus-gradient-stop-index {
  width: 34px !important;
  min-width: 34px !important;
  height: 34px !important;
  min-height: 34px !important;
  border-radius: 50% !important;
}

.plus-profile-editor-modal .plus-control-row input[type="color"],
.plus-profile-editor-modal .plus-gradient-stop input[type="color"] {
  border-radius: 14px !important;
  background-clip: padding-box !important;
}

.plus-profile-editor-modal .plus-control-row input[type="text"],
.plus-profile-editor-modal .plus-gradient-stop input[type="text"],
.plus-profile-editor-modal .plus-overlay-search,
.plus-profile-editor-modal .plus-color-trigger {
  border-radius: 9999px !important;
  background-clip: padding-box !important;
}

.plus-profile-editor-modal .plus-option-grid button,
.plus-profile-editor-modal .plus-gradient-style-button,
.plus-profile-editor-modal .plus-add-gradient-color,
.plus-profile-editor-modal .plus-image-picker label,
.plus-profile-editor-modal .plus-image-picker button,
.plus-profile-editor-modal .plus-object-actions button,
.plus-profile-editor-modal .plus-editor-preview-modes,
.plus-profile-editor-modal .plus-editor-preview-modes button,
.plus-profile-editor-modal .plus-mobile-tabs button,
.plus-profile-editor-modal .plus-editor-cancel-button,
.plus-profile-editor-modal .plus-editor-save-button {
  border-radius: 9999px !important;
  background-clip: padding-box !important;
}

/* Tiles and content rows are cards, not pills. Keep these after the action
   selector above so a nested/global button rule cannot flatten their shape. */
#plusProfileEditorModal button.plus-overlay-library-button {
  border-radius: 24px !important;
}

.plus-profile-editor-modal .plus-layer-item {
  border-radius: 24px !important;
}

.plus-profile-editor-modal .plus-mini-icon-button,
.plus-profile-editor-modal .plus-layer-item button,
.plus-profile-editor-modal .plus-overlay-handle,
.plus-profile-editor-modal .plus-editor-footer .plus-editor-undo,
.plus-profile-editor-modal .plus-editor-footer .plus-editor-redo,
.plus-profile-editor-modal .plus-editor-footer .plus-editor-reset,
.plus-profile-editor-modal > .modal-close-button {
  aspect-ratio: 1 / 1 !important;
  border-radius: 50% !important;
}

/* The preview needs a small physical gutter at every scale. JS reads these
   paddings before calculating its transform, so the entire rounded ring
   remains inside the viewport instead of losing fractional corner pixels. */
.plus-profile-editor-modal .plus-canvas-viewport {
  box-sizing: border-box !important;
  padding-inline: 10px !important;
  overflow: visible !important;
}

.plus-profile-editor-modal .plus-profile-canvas,
.plus-profile-editor-modal .plus-canvas-profile-content,
.plus-profile-editor-modal .plus-preview-profile-shell.profile-modal.plus-profile-shell-active {
  overflow: visible !important;
}

.plus-profile-editor-modal .plus-preview-profile-shell.profile-modal.plus-profile-shell-active {
  isolation: isolate !important;
}

.plus-profile-editor-modal .plus-preview-profile-shell.profile-modal.plus-profile-shell-active::after {
  position: absolute;
  z-index: 40;
  inset: 0;
  box-sizing: border-box;
  border: 0;
  border-radius: inherit;
  box-shadow:
    inset 0 0 0 2px color-mix(in srgb, var(--primary) 44%, var(--border)),
    inset 0 1px 0 color-mix(in srgb, white 13%, transparent);
  content: "";
  pointer-events: none;
}

.plus-profile-editor-modal .plus-preview-surface {
  overflow: hidden !important;
  border: 0 !important;
  border-radius: inherit !important;
  contain: layout style !important;
  background-clip: padding-box !important;
}

.plus-profile-editor-modal .plus-preview-surface > #plusCanvasBackground,
.plus-profile-editor-modal .plus-preview-surface > #plusCanvasOverlays,
.plus-profile-editor-modal .plus-preview-surface > .plus-preview-profile-view {
  border-radius: inherit !important;
}

/* Desktop preview is a container mode, not the physical device breakpoint.
   These rules undo .profile-modal's phone media-query geometry when a user
   chooses Desktop while editing on a phone. */
.plus-profile-canvas[data-preview-mode="desktop"] .plus-preview-profile-shell.profile-modal {
  font-size: 16px !important;
  border-radius: 42px !important;
}

.plus-profile-canvas[data-preview-mode="desktop"] .plus-preview-profile-view {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 58px 24px 24px !important;
  gap: 0 !important;
}

.plus-profile-canvas[data-preview-mode="desktop"] .profile-avatar-status-wrap {
  width: 100% !important;
  min-height: 126px !important;
}

.plus-profile-canvas[data-preview-mode="desktop"] .profile-avatar-large {
  width: 112px !important;
  min-width: 112px !important;
  height: 112px !important;
  min-height: 112px !important;
  margin: 0 auto 14px !important;
}

.plus-profile-canvas[data-preview-mode="desktop"] .profile-status-bubble {
  top: 54px !important;
  left: calc(50% + 41px) !important;
  max-width: min(210px, calc(50% - 52px)) !important;
  padding: 8px 12px !important;
  border-radius: 18px !important;
  font-size: 13px !important;
}

.plus-profile-canvas[data-preview-mode="desktop"] .profile-status-bubble.is-multiline {
  left: calc(50% + 37px) !important;
}

.plus-profile-canvas[data-preview-mode="desktop"] .profile-display-name {
  max-width: calc(100% - 24px) !important;
  padding: 5px 11px !important;
  font-size: 24px !important;
}

.plus-profile-canvas[data-preview-mode="desktop"] .profile-handle {
  max-width: calc(100% - 24px) !important;
  padding: 5px 11px !important;
  font-size: 14px !important;
}

.plus-profile-canvas[data-preview-mode="desktop"] .profile-bio {
  max-width: calc(100% - 24px) !important;
  margin-top: 14px !important;
  margin-bottom: 14px !important;
  padding: 5px 11px !important;
  font-size: 16px !important;
}

.plus-profile-canvas[data-preview-mode="desktop"] .profile-stats {
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  grid-auto-flow: row !important;
  gap: 6px !important;
  width: 100% !important;
  margin-top: 18px !important;
  padding: 10px 7px !important;
  overflow: hidden !important;
  border-radius: 9999px !important;
}

.plus-profile-canvas[data-preview-mode="desktop"] .profile-stats > .profile-stat {
  grid-column: auto !important;
  width: 100% !important;
  min-width: 0 !important;
  min-height: 54px !important;
  padding: 5px 2px !important;
  gap: 0 !important;
  border-radius: 18px !important;
}

.plus-profile-canvas[data-preview-mode="desktop"] .profile-stat strong {
  font-size: 17px !important;
  line-height: normal !important;
}

.plus-profile-canvas[data-preview-mode="desktop"] .profile-stat span {
  font-size: 9px !important;
  line-height: normal !important;
  white-space: nowrap !important;
}

.plus-profile-canvas[data-preview-mode="desktop"] .profile-connections-panel {
  margin-top: 12px !important;
  padding: 13px !important;
  border-radius: var(--ui-radius-panel, 34px) !important;
}

.plus-profile-canvas[data-preview-mode="desktop"] .profile-connections-list {
  max-height: 128px !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
}

.plus-profile-canvas[data-preview-mode="desktop"] .profile-main-actions {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: stretch !important;
  justify-content: center !important;
  flex-wrap: nowrap !important;
  gap: 10px !important;
  width: min(100%, 450px) !important;
  margin: 28px auto 0 !important;
}

.plus-profile-canvas[data-preview-mode="desktop"] .profile-main-actions > button:not(.hidden) {
  flex: 1 1 0 !important;
  width: 0 !important;
  min-width: 0 !important;
  max-width: none !important;
  height: 46px !important;
  min-height: 46px !important;
  margin: 0 !important;
  padding: 0 10px !important;
  font-size: 14px !important;
  white-space: nowrap !important;
}

/* Reset profile background / discard changes share this Yapper confirmation. */
.plus-confirm-overlay > .plus-confirm-modal.modal-surface {
  border-radius: 42px !important;
  background-clip: padding-box !important;
}

@media (max-width: 900px), (max-height: 700px) and (max-width: 1100px) {
  .plus-profile-editor-overlay > .plus-profile-editor-modal.modal-surface {
    --plus-editor-card-radius: 30px;
    --plus-editor-tile-radius: 22px;
    --plus-editor-soft-radius: 26px;
    border-radius: 0 !important;
  }

  .plus-profile-editor-modal .plus-editor-header > .plus-editor-heading-row {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    align-items: start !important;
    gap: 7px !important;
  }

  .plus-profile-editor-modal .plus-canvas-viewport {
    padding-inline: 8px !important;
  }

  #plusProfileEditorModal button.plus-overlay-library-button,
  .plus-profile-editor-modal .plus-layer-item {
    border-radius: 22px !important;
  }
}

@media (max-width: 540px) {
  .plus-confirm-overlay > .plus-confirm-modal.modal-surface {
    border-radius: 38px !important;
  }
}

/* =========================================================
   V219 — PREVIEW RING + OVERLAY CONTROL CORRECTIONS
   One element owns the preview clipping and its ring, library choices return
   to Yapper's pale pills, and every icon-only overlay control is vector art.
   ========================================================= */

/* The ring must use the exact same box as the clipped background. Drawing it
   on the outer shell caused the long detached blue edges seen after scaling. */
.plus-profile-editor-modal .plus-preview-profile-shell.profile-modal.plus-profile-shell-active::after {
  content: none !important;
}

.plus-profile-canvas[data-preview-mode="phone"] .plus-preview-profile-shell.profile-modal,
.plus-profile-canvas[data-preview-mode="phone"] .plus-preview-surface,
.plus-profile-canvas[data-preview-mode="phone"] .plus-preview-surface > #plusCanvasBackground,
.plus-profile-canvas[data-preview-mode="phone"] .plus-preview-surface > #plusCanvasOverlays,
.plus-profile-canvas[data-preview-mode="phone"] .plus-preview-surface > .plus-preview-profile-view {
  border-radius: 34px !important;
}

.plus-profile-canvas[data-preview-mode="desktop"] .plus-preview-profile-shell.profile-modal,
.plus-profile-canvas[data-preview-mode="desktop"] .plus-preview-surface,
.plus-profile-canvas[data-preview-mode="desktop"] .plus-preview-surface > #plusCanvasBackground,
.plus-profile-canvas[data-preview-mode="desktop"] .plus-preview-surface > #plusCanvasOverlays,
.plus-profile-canvas[data-preview-mode="desktop"] .plus-preview-surface > .plus-preview-profile-view {
  border-radius: 42px !important;
}

.plus-profile-editor-modal .plus-preview-surface {
  position: relative !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  border: 0 !important;
  background-clip: padding-box !important;
  box-shadow:
    0 20px 54px color-mix(in srgb, var(--shadow) 82%, transparent),
    inset 0 1px 0 color-mix(in srgb, white 13%, transparent) !important;
}

.plus-profile-editor-modal .plus-preview-surface::after {
  content: none !important;
}

/* Overlay choices are selectors, not rectangular content cards. */
#plusProfileEditorModal button.plus-overlay-library-button,
#plusProfileEditorModal button.plus-overlay-library-button:hover,
#plusProfileEditorModal button.plus-overlay-library-button:focus-visible,
#plusProfileEditorModal button.plus-overlay-library-button:active {
  min-height: 66px !important;
  padding: 8px 6px !important;
  border: 1px solid color-mix(in srgb, var(--primary) 32%, var(--border)) !important;
  border-radius: 9999px !important;
  background: color-mix(in srgb, var(--button) 94%, var(--primary) 6%) !important;
  background-clip: padding-box !important;
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, white 12%, transparent),
    0 4px 12px color-mix(in srgb, var(--shadow) 32%, transparent) !important;
  transform: none !important;
}

#plusProfileEditorModal button.plus-overlay-library-button:hover,
#plusProfileEditorModal button.plus-overlay-library-button:focus-visible {
  border-color: color-mix(in srgb, var(--primary) 58%, var(--border)) !important;
  background: color-mix(in srgb, var(--button) 87%, var(--primary) 13%) !important;
}

#plusProfileEditorModal .plus-overlay-library-button .plus-library-icon {
  width: 27px !important;
  height: 27px !important;
}

/* Selected-overlay controls are one calm nested card; the title is a compact
   identity row and the action buttons remain pills/circles as appropriate. */
.plus-profile-editor-modal .plus-selected-controls:not(.hidden) {
  box-sizing: border-box;
  display: grid;
  gap: 10px;
  margin-top: 9px;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--primary) 24%, var(--border));
  border-radius: 24px;
  background: color-mix(in srgb, var(--bubble) 92%, var(--primary) 8%);
  background-clip: padding-box;
  box-shadow: inset 0 1px 0 color-mix(in srgb, white 10%, transparent);
}

.plus-profile-editor-modal .plus-selected-title {
  min-height: 42px;
  padding: 6px 10px;
  border: 1px solid color-mix(in srgb, var(--primary) 22%, var(--border));
  border-radius: 9999px;
  background: color-mix(in srgb, var(--button) 94%, var(--primary) 6%);
}

.plus-profile-editor-modal .plus-selected-title .plus-library-icon {
  flex: 0 0 28px;
  display: grid;
  place-items: center;
}

.plus-profile-editor-modal .plus-selected-empty {
  border-radius: 22px !important;
}

.plus-editor-control-svg {
  display: block;
  width: 17px;
  height: 17px;
  overflow: visible;
  pointer-events: none;
}

.plus-profile-editor-modal .plus-overlay-resize-handle .plus-editor-control-svg,
.plus-profile-editor-modal .plus-overlay-rotate-handle .plus-editor-control-svg {
  width: 16px;
  height: 16px;
}

.plus-profile-editor-modal .plus-size-stepper button .plus-editor-control-svg {
  width: 18px;
  height: 18px;
  margin: auto;
}

.plus-profile-editor-modal .plus-layer-item button .plus-editor-control-svg {
  width: 15px;
  height: 15px;
  margin: auto;
}

@media (max-width: 900px), (max-height: 700px) and (max-width: 1100px) {
  #plusProfileEditorModal button.plus-overlay-library-button,
  #plusProfileEditorModal button.plus-overlay-library-button:hover,
  #plusProfileEditorModal button.plus-overlay-library-button:focus-visible,
  #plusProfileEditorModal button.plus-overlay-library-button:active {
    min-height: 64px !important;
    border-radius: 9999px !important;
  }

  .plus-profile-editor-modal .plus-selected-controls:not(.hidden) {
    border-radius: 22px;
  }
}

/* =========================================================
   V219 — AUTHORITATIVE PLUS LAYOUT
   This intentionally comes after the older global roundness compatibility
   rules. The Plus status and its two real settings are siblings; there is no
   visual card wrapped around those cards.
   ========================================================= */
.yapper-plus-modal .plus-code-layout {
  box-sizing: border-box !important;
  display: grid !important;
  gap: 14px !important;
  width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.yapper-plus-modal .plus-code-redeem-panel,
.yapper-plus-modal .plus-code-developer-panel {
  box-sizing: border-box !important;
  width: 100% !important;
  min-width: 0 !important;
  border-radius: 26px !important;
}

.yapper-plus-modal .generated-plus-code-card {
  border-radius: 24px !important;
}

.yapper-plus-modal .plus-code-history-item,
.yapper-plus-modal .plus-code-history-empty {
  border-radius: 22px !important;
}

.yapper-plus-modal .plus-code-history-item.status-active .plus-code-status-badge,
.yapper-plus-modal .plus-code-history-item.status-active .plus-code-revoke-button {
  position: relative !important;
  top: -2px !important;
}

/* V220 — Plus uses rounded cards and true-pill code records. */
.yapper-plus-modal .plus-code-redeem-panel,
.yapper-plus-modal .plus-code-developer-panel {
  border-radius: 32px !important;
}

.yapper-plus-modal .generated-plus-code-card {
  border-radius: 28px !important;
}

.yapper-plus-modal .plus-code-history-item,
.yapper-plus-modal .plus-code-history-empty {
  border-radius: 9999px !important;
}

@media (max-width: 540px) {
  .yapper-plus-modal .plus-code-redeem-panel,
  .yapper-plus-modal .plus-code-developer-panel {
    border-radius: 30px !important;
  }

  .yapper-plus-modal .generated-plus-code-card {
    border-radius: 27px !important;
  }
}

@media (max-width: 540px) {
  .yapper-plus-modal .plus-code-layout {
    gap: 12px !important;
  }

  .yapper-plus-modal .plus-code-redeem-panel,
  .yapper-plus-modal .plus-code-developer-panel {
    border-radius: 22px !important;
  }

  .yapper-plus-modal .generated-plus-code-card,
  .yapper-plus-modal .plus-code-history-item,
  .yapper-plus-modal .plus-code-history-empty {
    border-radius: 20px !important;
  }
}

/* V220 final Plus shapes. */
.yapper-plus-modal .plus-code-redeem-panel,
.yapper-plus-modal .plus-code-developer-panel { border-radius: 32px !important; }
.yapper-plus-modal .generated-plus-code-card { border-radius: 28px !important; }
.yapper-plus-modal .plus-code-history-item,
.yapper-plus-modal .plus-code-history-empty { border-radius: 9999px !important; }
@media (max-width: 540px) {
  .yapper-plus-modal .plus-code-redeem-panel,
  .yapper-plus-modal .plus-code-developer-panel { border-radius: 30px !important; }
  .yapper-plus-modal .generated-plus-code-card { border-radius: 27px !important; }
  .yapper-plus-modal .plus-code-history-item,
  .yapper-plus-modal .plus-code-history-empty { border-radius: 9999px !important; }
}


/* v3.13.37 — adaptive profile bio geometry on normal profiles */
#profileViewSection .profile-bio:not(.empty),
.plus-preview-profile-view .profile-bio:not(.empty) {
  border-radius: 999px !important;
}
#profileViewSection .profile-bio:not(.empty).is-multiline,
.plus-preview-profile-view .profile-bio:not(.empty).is-multiline {
  border-radius: 20px !important;
}
