/* ==========================================================================
   Profile Studio — mint layer
   Loaded after studio-overhaul.css. That file is a long pile of !important
   overrides, so everything here is scoped under #profile-studio-overlay (id
   specificity) and only uses !important where an earlier rule already does.
   Sections: 1 foundation · 2 shell · 3 controls · 4 page layout · 5 screens ·
   6 home & canvas · 7 mobile · 8 motion
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Outfit:wght@500;600;700;800&display=swap');

/* ---- 1. Foundation: the same tokens as the main app ---- */
:root {
  --accent: #00f5a0;
  --accent-light: #6dfac4;
  --accent-subtle: rgba(0, 245, 160, 0.14);
  --accent-glow: rgba(0, 245, 160, 0.22);
  --on-accent: #04130d;
  --bg-app: hsl(240, 10%, 4%);
  --bg-card: hsla(240, 10%, 8%, 0.6);
  --bg-elevated: hsl(240, 10%, 10%);
  --bg-drawer: hsl(240, 10%, 7%);
  --border: rgba(255, 255, 255, 0.07);
  --border-hover: rgba(255, 255, 255, 0.14);
  --text-primary: hsl(0, 0%, 98%);
  --text-secondary: hsl(240, 5%, 75%);
  --text-muted: hsl(240, 5%, 58%);
  --ps-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --ps-display: 'Outfit', 'Inter', sans-serif;
  --ps-radius: 12px;
  --ps-ease: cubic-bezier(0.16, 1, 0.3, 1);
}

#profile-studio-overlay,
#profile-studio-overlay .ps-panel,
.kap-global-header,
.ps-subheader {
  font-family: var(--ps-font) !important;
  color: var(--text-primary);
}
#profile-studio-overlay :is(button, input, select, textarea) { font-family: inherit !important; }
#profile-studio-overlay :is(h1, h2, h3, .ps-title, .ps-page-title, .ps-hub-title, .ps-home-hero-main-title, .ps-pe-title, .ps-profile-name) {
  font-family: var(--ps-display) !important;
  letter-spacing: -0.015em;
}
#profile-studio-overlay ::selection { background: rgba(0, 245, 160, 0.28); }
#profile-studio-overlay :focus-visible { outline: 2px solid var(--accent-light); outline-offset: 2px; }
#profile-studio-overlay { accent-color: var(--accent); scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.18) transparent; }

/* ---- 2. Shell: one header on every screen ---- */
#ps-content[data-screen] .ps-subheader { height: 52px !important; min-height: 52px !important; padding: 0 clamp(12px, 2vw, 24px) !important; gap: 12px; }
#profile-studio-overlay .ps-subheader-left { gap: 8px !important; }
#profile-studio-overlay .ps-subheader-center { flex: 1 1 auto !important; min-width: 0; display: flex !important; justify-content: center !important; }
#profile-studio-overlay .ps-subheader-right { gap: 8px !important; flex: 0 0 auto !important; }
#profile-studio-overlay .ps-subnav-badge { display: none !important; }
#profile-studio-overlay .ps-subnav-center-cluster, #profile-studio-overlay .ps-subnav-sub {
  background: none !important; border: 0 !important; box-shadow: none !important; padding: 0 !important;
  font-size: 0.86rem !important; font-weight: 600 !important; color: var(--text-secondary) !important; letter-spacing: 0 !important; text-transform: none !important;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
#profile-studio-overlay .ps-header-profile-badge {
  background: rgba(255, 255, 255, 0.05) !important; border: 1px solid var(--border) !important; border-radius: 999px !important; padding: 6px 14px !important;
}
#profile-studio-overlay .ps-profile-label { display: none !important; }
#profile-studio-overlay .ps-profile-name-sm { font-size: 0.86rem !important; font-weight: 600 !important; color: var(--text-primary) !important; }
#profile-studio-overlay .ps-close-btn {
  width: 40px !important; height: 40px !important; border-radius: 12px !important; font-size: 1.4rem !important; line-height: 1;
  background: rgba(255, 255, 255, 0.06) !important; border: 1px solid var(--border-hover) !important; color: var(--text-secondary) !important;
  display: inline-grid !important; place-items: center; padding: 0 !important;
}
#profile-studio-overlay .ps-close-btn:hover { background: rgba(255, 255, 255, 0.12) !important; color: #fff !important; }

/* ---- 3. Controls ---- */
#profile-studio-overlay .ps-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 18px; border-radius: 11px; border: 1px solid var(--border-hover);
  font-size: 0.92rem; font-weight: 600; letter-spacing: 0; cursor: pointer; text-decoration: none; white-space: nowrap;
  background: rgba(255, 255, 255, 0.05); color: var(--text-primary); box-shadow: none;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.25s var(--ps-ease), box-shadow 0.25s ease, color 0.18s ease;
}
#profile-studio-overlay .ps-btn:hover:not(:disabled) { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.26); transform: translateY(-1px); }
#profile-studio-overlay .ps-btn:active:not(:disabled) { transform: none; }
#profile-studio-overlay .ps-btn:disabled { opacity: 0.42; cursor: not-allowed; }
#profile-studio-overlay .ps-btn-sm { min-height: 38px; padding: 0 14px; font-size: 0.86rem; border-radius: 10px; }
#profile-studio-overlay .ps-btn-primary {
  background: var(--accent); color: var(--on-accent); border-color: transparent;
  box-shadow: 0 10px 26px -12px rgba(0, 245, 160, 0.6);
}
#profile-studio-overlay .ps-btn-primary:hover:not(:disabled) { background: var(--accent); filter: brightness(1.07); box-shadow: 0 14px 30px -12px rgba(0, 245, 160, 0.75); border-color: transparent; }
#profile-studio-overlay .ps-btn-primary:disabled { background: rgba(0, 245, 160, 0.22); color: rgba(255, 255, 255, 0.6); box-shadow: none; }
#profile-studio-overlay .ps-btn-ghost { background: transparent; border-color: transparent; color: var(--text-secondary); }
#profile-studio-overlay .ps-btn-ghost:hover:not(:disabled) { background: rgba(255, 255, 255, 0.07); color: #fff; border-color: transparent; }
#profile-studio-overlay .ps-btn-block { width: 100%; }
#profile-studio-overlay .ps-btn-link {
  background: none; border: 0; padding: 4px 2px; color: var(--accent-light); font-weight: 600; font-size: 0.88rem; cursor: pointer;
  text-decoration: underline; text-decoration-color: rgba(109, 250, 196, 0.35); text-underline-offset: 3px;
}
#profile-studio-overlay .ps-btn-link:hover { color: #fff; text-decoration-color: currentColor; }

#profile-studio-overlay :is(.ps-input, select.ps-input, textarea.ps-input, .ps-mixer-textarea, .ps-body select, .ps-body input[type="text"], .ps-body input[type="url"], .ps-body input[type="email"], .ps-body input[type="password"], .ps-body input[type="search"], .ps-body textarea) {
  min-height: 44px; padding: 0 14px; border-radius: 11px; border: 1px solid var(--border-hover);
  background-color: rgba(255, 255, 255, 0.045); color: var(--text-primary); font-size: 0.95rem; line-height: 1.2;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}
#profile-studio-overlay :is(textarea.ps-input, .ps-mixer-textarea, .ps-body textarea) { padding: 12px 14px; min-height: 120px; line-height: 1.5; }
#profile-studio-overlay :is(.ps-input, .ps-mixer-textarea, .ps-body select, .ps-body input[type="text"], .ps-body input[type="url"], .ps-body input[type="email"], .ps-body input[type="password"], .ps-body textarea):focus {
  outline: none; border-color: var(--accent); background-color: rgba(0, 245, 160, 0.05); box-shadow: 0 0 0 3px rgba(0, 245, 160, 0.16);
}
#profile-studio-overlay .ps-body select {
  appearance: none; -webkit-appearance: none; padding-right: 38px; cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat; background-position: right 13px center;
}
#profile-studio-overlay .ps-body select option { background: #12151e; color: #f1f5f9; }
#profile-studio-overlay .ps-label, #profile-studio-overlay label.ps-label { font-size: 0.82rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 8px; display: block; letter-spacing: 0; text-transform: none; }

/* Switches: checkboxes in setting rows, and the add-on toggle */
#profile-studio-overlay .ps-body input[type="checkbox"] { width: 20px; height: 20px; border-radius: 6px; cursor: pointer; }
#profile-studio-overlay .ps-setup-row input[type="checkbox"],
#profile-studio-overlay .ps-addon-toggle input { appearance: none; -webkit-appearance: none; }
#profile-studio-overlay .ps-setup-row input[type="checkbox"] {
  width: 44px; height: 26px; border-radius: 999px; background: rgba(255, 255, 255, 0.14); border: 1px solid var(--border-hover);
  position: relative; flex: none; transition: background 0.2s ease; margin: 0;
}
#profile-studio-overlay .ps-setup-row input[type="checkbox"]::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff;
  transition: transform 0.25s var(--ps-ease); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}
#profile-studio-overlay .ps-setup-row input[type="checkbox"]:checked { background: var(--accent); border-color: transparent; }
#profile-studio-overlay .ps-setup-row input[type="checkbox"]:checked::after { transform: translateX(18px); background: var(--on-accent); }
#profile-studio-overlay .ps-addon-toggle { position: relative; display: inline-flex; width: 44px; height: 26px; flex: none; cursor: pointer; }
#profile-studio-overlay .ps-addon-toggle input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 2; }
#profile-studio-overlay .ps-addon-toggle > span {
  position: absolute; inset: 0; border-radius: 999px; background: rgba(255, 255, 255, 0.14); border: 1px solid var(--border-hover); transition: background 0.2s ease;
}
#profile-studio-overlay .ps-addon-toggle > span::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff;
  transition: transform 0.25s var(--ps-ease); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}
#profile-studio-overlay .ps-addon-toggle input:checked + span { background: var(--accent); border-color: transparent; }
#profile-studio-overlay .ps-addon-toggle input:checked + span::after { transform: translateX(18px); background: var(--on-accent); }
#profile-studio-overlay .ps-addon-toggle input:focus-visible + span { outline: 2px solid var(--accent-light); outline-offset: 3px; }

/* Alerts */
#profile-studio-overlay .ps-alert, #profile-studio-overlay .ps-addons-warn {
  border-radius: 12px; padding: 12px 14px; font-size: 0.9rem; line-height: 1.45; margin: 0 0 16px;
  background: rgba(251, 191, 36, 0.07); border: 1px solid rgba(251, 191, 36, 0.28); color: #fde68a;
}
#profile-studio-overlay .ps-alert-error { background: rgba(248, 113, 113, 0.08); border-color: rgba(248, 113, 113, 0.32); color: #fecaca; }

/* ---- 4. Page layout: a real column, with a real heading ---- */
#ps-content[data-screen]:not([data-screen="home"]):not([data-screen="homeRow"]):not([data-screen="canvas"]):not([data-screen="hub"]):not([data-screen="profiles"]) > .ps-body {
  padding: clamp(24px, 4vw, 48px) max(clamp(16px, 3vw, 32px), calc((100% - var(--ps-col, 1040px)) / 2)) 80px !important;
}
#ps-content[data-screen="login"], #ps-content[data-screen="success"] { --ps-col: 480px; }
#ps-content[data-screen="copy"], #ps-content[data-screen="setup"], #ps-content[data-screen="share"],
#ps-content[data-screen="settingsHub"], #ps-content[data-screen="settingsGroup"], #ps-content[data-screen="backups"] { --ps-col: 920px; }
#profile-studio-overlay .ps-page-head { margin: 0 0 28px; }
#profile-studio-overlay .ps-page-title { margin: 0; font-size: clamp(1.7rem, 3vw, 2.3rem); font-weight: 800; line-height: 1.1; color: var(--text-primary); text-wrap: balance; }
#profile-studio-overlay .ps-page-lede, #profile-studio-overlay .ps-page-head .ps-addons-hint {
  margin: 10px 0 0; font-size: 1rem; line-height: 1.55; color: var(--text-secondary); max-width: 62ch; text-wrap: pretty; background: none; border: 0; padding: 0;
}
#profile-studio-overlay .ps-addons-hint { font-size: 0.92rem; color: var(--text-secondary); line-height: 1.5; }

/* ---- 5. Screens ---- */
/* Shared card surface */
#profile-studio-overlay :is(.ps-hub-tile, .ps-setup-card, .ps-copy-tile, .ps-share-choice, .ps-backup-row, .ps-addon-row, .ps-mixer-deck, .ps-summary-card, .ps-pe-now, .ps-pe-section, .ps-setup-custom) {
  background: rgba(255, 255, 255, 0.03) !important; border: 1px solid var(--border) !important; border-radius: 16px !important; box-shadow: none !important;
}

/* Hub + settings hub tiles */
#profile-studio-overlay .ps-hub-grid { display: grid !important; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)) !important; gap: 14px !important; }
#profile-studio-overlay .ps-hub-tile {
  position: relative; text-align: left; padding: 22px 22px 56px !important; min-height: 188px; display: flex; flex-direction: column; gap: 6px; cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.3s var(--ps-ease) !important; color: inherit;
}
#profile-studio-overlay .ps-hub-tile:hover { border-color: rgba(0, 245, 160, 0.4) !important; background: rgba(0, 245, 160, 0.045) !important; transform: translateY(-3px); }
#profile-studio-overlay .ps-hub-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: rgba(0, 245, 160, 0.1) !important; border: 1px solid rgba(0, 245, 160, 0.25) !important; color: var(--accent) !important; margin-bottom: 12px; }
#profile-studio-overlay .ps-hub-icon svg { width: 20px; height: 20px; }
#profile-studio-overlay .ps-hub-title { font-size: 1.1rem !important; font-weight: 700 !important; color: var(--text-primary) !important; }
#profile-studio-overlay .ps-hub-line { font-size: 0.9rem !important; line-height: 1.5 !important; color: var(--text-muted) !important; }
#profile-studio-overlay .ps-hub-tile::after {
  content: "" !important; position: absolute; right: 20px; bottom: 20px; width: 22px; height: 22px; border-radius: 50%; padding: 0 !important; margin: 0 !important;
  background: rgba(255, 255, 255, 0.06) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236dfac4' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><line x1='5' y1='12' x2='19' y2='12'/><polyline points='12 5 19 12 12 19'/></svg>") center / 12px no-repeat !important;
  border: 1px solid var(--border-hover); transition: transform 0.3s var(--ps-ease), background-color 0.2s ease; font-size: 0 !important; color: transparent !important;
}
#profile-studio-overlay .ps-hub-tile:hover::after { transform: translateX(3px); background-color: rgba(0, 245, 160, 0.14) !important; }
#profile-studio-overlay .ps-hub-profile { background: rgba(255,255,255,0.03) !important; border: 1px solid var(--border) !important; border-radius: 18px !important; }
#profile-studio-overlay .ps-home-hero-badge { display: none !important; }

/* Add-ons */
#profile-studio-overlay .ps-addon-list { display: flex; flex-direction: column; gap: 10px; }
#profile-studio-overlay .ps-addon-row { display: flex !important; align-items: center !important; gap: 14px !important; padding: 14px 18px !important; transition: border-color 0.2s ease, background 0.2s ease; }
#profile-studio-overlay .ps-addon-row:hover { border-color: var(--border-hover) !important; }
#profile-studio-overlay .ps-addon-row.is-off { opacity: 0.55; }
#profile-studio-overlay .ps-addon-info { flex: 1 1 auto !important; min-width: 0 !important; }
#profile-studio-overlay .ps-addon-name { font-size: 1rem !important; font-weight: 600 !important; color: var(--text-primary) !important; }
#profile-studio-overlay .ps-addon-line { font-size: 0.86rem !important; color: var(--text-muted) !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#profile-studio-overlay .ps-addon-logo { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: rgba(0, 245, 160, 0.08) !important; border: 1px solid rgba(0, 245, 160, 0.2) !important; color: var(--accent) !important; font-weight: 700; flex: none; overflow: hidden; }
#profile-studio-overlay .ps-addon-logo img { width: 100%; height: 100%; object-fit: cover; }
#profile-studio-overlay .ps-addon-status { display: inline-flex !important; align-items: center; gap: 7px; font-size: 0.82rem !important; font-weight: 600 !important; color: var(--text-muted) !important; background: none !important; border: 0 !important; padding: 0 !important; white-space: nowrap; position: static !important; }
#profile-studio-overlay .ps-addon-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
#profile-studio-overlay .ps-addon-status.is-ok { color: var(--accent-light) !important; }
#profile-studio-overlay .ps-addon-status.is-slow { color: #fbbf24 !important; }
#profile-studio-overlay .ps-addon-status.is-down { color: #f87171 !important; }
#profile-studio-overlay .ps-addon-arrow, #profile-studio-overlay .ps-addon-menu-btn {
  width: 34px; height: 34px; border-radius: 9px; display: inline-grid; place-items: center; cursor: pointer; font-size: 0.8rem;
  background: rgba(255,255,255,0.04) !important; border: 1px solid var(--border) !important; color: var(--text-secondary) !important;
}
#profile-studio-overlay .ps-addon-arrow:hover:not(:disabled), #profile-studio-overlay .ps-addon-menu-btn:hover { background: rgba(255,255,255,0.1) !important; color: #fff !important; }
#profile-studio-overlay .ps-addon-arrow:disabled { opacity: 0.25; cursor: default; }
#profile-studio-overlay .ps-addon-move { display: flex; flex-direction: column; gap: 4px; }
#profile-studio-overlay .ps-addon-move .ps-addon-arrow { width: 30px; height: 22px; }

/* Backups */
#profile-studio-overlay .ps-backups-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 28px; }
#profile-studio-overlay .ps-backups-list { display: flex; flex-direction: column; gap: 10px; }
#profile-studio-overlay .ps-backup-row { display: flex !important; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 18px !important; flex-wrap: wrap; }
#profile-studio-overlay .ps-backup-label { display: block; font-weight: 600; font-size: 1rem; }
#profile-studio-overlay .ps-backup-meta { display: block; font-size: 0.84rem; color: var(--text-muted); margin-top: 3px; }
#profile-studio-overlay .ps-backup-buttons { display: flex; gap: 8px; }
#profile-studio-overlay .ps-backups-list > p.ps-addons-hint {
  margin: 0; padding: 36px 20px; text-align: center; border: 1px dashed var(--border-hover); border-radius: 16px; color: var(--text-muted); background: rgba(255,255,255,0.02);
}
#profile-studio-overlay .ps-backups-message { color: var(--accent-light); font-size: 0.92rem; margin: 0 0 16px; }

/* Collection mixer */
#profile-studio-overlay .ps-mixer-deck { padding: 18px !important; margin-bottom: 20px; }
#profile-studio-overlay .ps-mixer-input-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
#profile-studio-overlay .ps-mixer-tabs { display: inline-flex; padding: 4px; gap: 2px; border-radius: 12px; background: rgba(255,255,255,0.05); border: 1px solid var(--border); }
#profile-studio-overlay .ps-mixer-tab {
  min-height: 36px; padding: 0 16px; border-radius: 9px; border: 0; background: transparent; color: var(--text-secondary); font-size: 0.88rem; font-weight: 600; cursor: pointer; transition: background 0.18s ease, color 0.18s ease;
}
#profile-studio-overlay .ps-mixer-tab:hover { color: #fff; }
#profile-studio-overlay .ps-mixer-tab.active { background: var(--accent); color: var(--on-accent); }
#profile-studio-overlay .ps-mixer-loaded-badge { font-size: 0.85rem; font-weight: 600; color: var(--accent-light); }
#profile-studio-overlay .ps-mixer-row-input { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
#profile-studio-overlay .ps-mixer-textarea { width: 100%; min-height: 150px; resize: vertical; margin-bottom: 12px; font-family: ui-monospace, 'Cascadia Code', Menlo, monospace !important; font-size: 0.85rem; line-height: 1.5; }
#profile-studio-overlay .ps-mixer-dropzone { padding: 36px 20px; text-align: center; border: 1.5px dashed var(--border-hover); border-radius: 14px; color: var(--text-secondary); cursor: pointer; transition: border-color 0.2s ease, background 0.2s ease; }
#profile-studio-overlay .ps-mixer-dropzone:hover { border-color: var(--accent); background: rgba(0, 245, 160, 0.04); }
#profile-studio-overlay .ps-mixer-batch-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border-radius: 14px; background: rgba(255,255,255,0.03); border: 1px solid var(--border); margin-bottom: 18px; }
#profile-studio-overlay .ps-mixer-batch-btns { display: flex; gap: 8px; flex-wrap: wrap; }
#profile-studio-overlay .ps-mixer-batch-btn {
  min-height: 38px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--border-hover); background: rgba(255,255,255,0.05); color: var(--text-primary); font-size: 0.86rem; font-weight: 600; cursor: pointer;
}
#profile-studio-overlay .ps-mixer-batch-btn:hover { background: rgba(255,255,255,0.1); }
#profile-studio-overlay .ps-mixer-batch-btn.primary { background: var(--accent); color: var(--on-accent); border-color: transparent; }

/* Quick setup + settings rows */
#profile-studio-overlay .ps-setup-grid { display: grid !important; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)) !important; gap: 14px !important; }
#profile-studio-overlay .ps-setup-card { padding: 20px !important; display: flex; flex-direction: column; gap: 10px; transition: border-color 0.2s ease, background 0.2s ease; }
#profile-studio-overlay .ps-setup-card:hover { border-color: var(--border-hover) !important; }
#profile-studio-overlay .ps-setup-card.is-on { border-color: var(--accent) !important; background: rgba(0, 245, 160, 0.06) !important; box-shadow: 0 0 0 1px rgba(0, 245, 160, 0.35) !important; }
#profile-studio-overlay .ps-setup-pick { all: unset; display: flex; flex-direction: column; gap: 8px; cursor: pointer; }
#profile-studio-overlay .ps-setup-pick:focus-visible { outline: 2px solid var(--accent-light); outline-offset: 4px; border-radius: 8px; }
#profile-studio-overlay .ps-setup-icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: rgba(0, 245, 160, 0.1); border: 1px solid rgba(0, 245, 160, 0.25); color: var(--accent) !important; }
#profile-studio-overlay .ps-setup-icon svg { width: 18px; height: 18px; }
#profile-studio-overlay .ps-setup-name { font: 700 1.05rem/1.2 var(--ps-display); color: var(--text-primary); }
#profile-studio-overlay .ps-setup-name em { font-style: normal; font-size: 0.72rem; font-weight: 700; color: var(--on-accent); background: var(--accent); padding: 3px 8px; border-radius: 999px; margin-left: 8px; vertical-align: middle; letter-spacing: 0; }
#profile-studio-overlay .ps-setup-blurb { font-size: 0.88rem; line-height: 1.5; color: var(--text-muted); }
#profile-studio-overlay .ps-setup-more { align-self: flex-start; font-size: 0.82rem; }
#profile-studio-overlay .ps-setup-details { margin: 4px 0 0; padding-left: 18px; font-size: 0.84rem; color: var(--text-secondary); line-height: 1.6; }
#profile-studio-overlay .ps-setup-customize-toggle { margin: 22px 0 8px; display: inline-block; }
#profile-studio-overlay .ps-setup-custom { padding: 8px 20px !important; margin-top: 8px; }
#profile-studio-overlay .ps-setup-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 56px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 0.95rem; color: var(--text-primary); }
#profile-studio-overlay .ps-setup-row:last-child { border-bottom: 0; }
#profile-studio-overlay .ps-setup-row > span { flex: 1 1 auto; }
#profile-studio-overlay .ps-setup-row select { min-width: 190px; }
#profile-studio-overlay .ps-setup-row .ps-input { max-width: 340px; }

/* Theme swatches */
#profile-studio-overlay .ps-theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; padding: 14px 0; }
#profile-studio-overlay .ps-theme-swatch { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 18px 12px; border-radius: 14px; border: 1px solid var(--border); background: rgba(255,255,255,0.03); color: var(--text-secondary); cursor: pointer; position: relative; transition: border-color 0.2s ease, background 0.2s ease; }
#profile-studio-overlay .ps-theme-swatch:hover { border-color: var(--border-hover); }
#profile-studio-overlay .ps-theme-swatch.is-on, #profile-studio-overlay .ps-theme-swatch[aria-pressed="true"] { border-color: var(--accent); background: rgba(0, 245, 160, 0.06); color: var(--text-primary); }
#profile-studio-overlay .ps-theme-dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.2); }
#profile-studio-overlay .ps-theme-name { font-size: 0.88rem; font-weight: 600; }
#profile-studio-overlay .ps-theme-lock { position: absolute; top: 10px; right: 10px; opacity: 0.6; }

/* Make a copy, share */
#profile-studio-overlay .ps-copy-grid { display: grid !important; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)) !important; gap: 12px !important; margin-bottom: 20px; }
#profile-studio-overlay .ps-copy-tile { text-align: left; padding: 18px !important; display: flex !important; flex-direction: column; gap: 6px; cursor: pointer; color: inherit; transition: border-color 0.2s ease, background 0.2s ease, transform 0.3s var(--ps-ease); min-height: 96px; }
#profile-studio-overlay .ps-copy-tile:hover { border-color: var(--border-hover) !important; transform: translateY(-2px); }
#profile-studio-overlay .ps-copy-tile.is-on, #profile-studio-overlay .ps-copy-tile[aria-pressed="true"], #profile-studio-overlay .ps-copy-tile.active { border-color: var(--accent) !important; background: rgba(0, 245, 160, 0.06) !important; box-shadow: 0 0 0 1px rgba(0, 245, 160, 0.35) !important; }
#profile-studio-overlay .ps-copy-tile-title { font: 700 1rem/1.2 var(--ps-display); color: var(--text-primary); display: flex; align-items: center; gap: 10px; }
#profile-studio-overlay .ps-copy-tile-line { font-size: 0.86rem; color: var(--text-muted); line-height: 1.45; }
#profile-studio-overlay .ps-copy-avatar { width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 0.8rem; font-weight: 700; color: #fff; }
#profile-studio-overlay .ps-share-choice { display: flex !important; align-items: flex-start; gap: 16px; text-align: left; padding: 22px !important; margin-bottom: 12px; cursor: pointer; width: 100%; color: inherit; transition: border-color 0.2s ease, background 0.2s ease, transform 0.3s var(--ps-ease); }
#profile-studio-overlay .ps-share-choice:hover { border-color: rgba(0, 245, 160, 0.4) !important; background: rgba(0, 245, 160, 0.04) !important; transform: translateY(-2px); }
#profile-studio-overlay .ps-share-choice-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: rgba(0, 245, 160, 0.1); border: 1px solid rgba(0, 245, 160, 0.25); color: var(--accent) !important; flex: none; }
#profile-studio-overlay .ps-share-choice-icon svg { width: 20px; height: 20px; }
#profile-studio-overlay .ps-share-choice-title { font: 700 1.1rem/1.2 var(--ps-display); color: var(--text-primary); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
#profile-studio-overlay .ps-share-choice-title :is(em, span, small) { font: 700 0.72rem/1 var(--ps-font); color: var(--on-accent); background: var(--accent); padding: 4px 9px; border-radius: 999px; }
#profile-studio-overlay .ps-share-choice-line { display: block; margin-top: 6px; font-size: 0.9rem; line-height: 1.5; color: var(--text-muted); }
@media (min-width: 900px) {
  #ps-content[data-screen="share"] .ps-body { display: grid !important; grid-template-columns: 1fr 1fr; column-gap: 16px; align-content: start; }
  #ps-content[data-screen="share"] .ps-body > .ps-page-head { grid-column: 1 / -1; }
  #profile-studio-overlay .ps-share-choice { margin-bottom: 0; }
}

/* Poster look */
#profile-studio-overlay .ps-pe-now { padding: 20px 22px !important; border-radius: 18px !important; }
#profile-studio-overlay .ps-pe-now-label { font-size: 0.78rem !important; letter-spacing: 0.04em; color: var(--text-muted) !important; text-transform: uppercase; }
#profile-studio-overlay .ps-pe-now-title { font: 700 1.3rem/1.2 var(--ps-display) !important; color: var(--text-primary) !important; }
#profile-studio-overlay .ps-pe-modes { display: inline-flex !important; padding: 4px; gap: 2px; border-radius: 13px; background: rgba(255,255,255,0.05); border: 1px solid var(--border); margin: 20px 0 !important; width: auto !important; }
#profile-studio-overlay .ps-pe-modes > button { min-height: 40px; padding: 0 20px; border-radius: 10px; border: 0 !important; background: transparent !important; color: var(--text-secondary) !important; font-size: 0.92rem; font-weight: 600; cursor: pointer; flex: none !important; }
#profile-studio-overlay .ps-pe-modes > button:hover { color: #fff !important; }
#profile-studio-overlay .ps-pe-modes > button.is-active, #profile-studio-overlay .ps-pe-modes > button[aria-checked="true"] { background: var(--accent) !important; color: var(--on-accent) !important; }
#profile-studio-overlay .ps-pe-section { padding: 22px !important; }
#profile-studio-overlay .ps-pe-title { font-size: 1.15rem !important; font-weight: 700 !important; margin: 0 0 6px !important; }
#profile-studio-overlay .ps-pe-sub { color: var(--text-muted) !important; font-size: 0.92rem !important; line-height: 1.5; }
#profile-studio-overlay .ps-pe-frame { border: 1px solid var(--border) !important; border-radius: 16px !important; width: 100%; background: #0a0d12; }

/* Confirm + success + sign-in */
#profile-studio-overlay .ps-page-head-plain { padding: clamp(28px, 5vw, 56px) max(clamp(16px, 3vw, 32px), calc((100% - var(--ps-col, 1040px)) / 2)) 0 !important; border: 0 !important; background: none !important; text-align: left; display: block !important; }
#profile-studio-overlay .ps-page-head-plain .ps-title { margin: 0 !important; font-size: clamp(1.7rem, 3vw, 2.3rem) !important; font-weight: 800 !important; line-height: 1.1; text-wrap: balance; }
#profile-studio-overlay .ps-page-head-plain .ps-subtitle { margin: 10px 0 0 !important; font-size: 1rem !important; line-height: 1.55; color: var(--text-secondary) !important; max-width: 62ch; }
#ps-content[data-screen="login"] .ps-page-head-plain, #ps-content[data-screen="success"] .ps-page-head-plain { text-align: center; }
#ps-content[data-screen="login"] .ps-page-head-plain .ps-subtitle, #ps-content[data-screen="success"] .ps-page-head-plain .ps-subtitle { margin-inline: auto !important; }
#profile-studio-overlay .ps-form { display: flex; flex-direction: column; gap: 18px; }
#profile-studio-overlay .ps-form-group { display: flex; flex-direction: column; }
#profile-studio-overlay .ps-form-actions { margin-top: 4px; }
#profile-studio-overlay .ps-form-actions .ps-btn { min-height: 50px; font-size: 1rem; }
#profile-studio-overlay .ps-privacy-box { display: flex; gap: 12px; align-items: flex-start; margin-top: 22px; padding: 14px 16px; border-radius: 12px; font-size: 0.86rem; line-height: 1.5; color: var(--text-muted); background: rgba(255,255,255,0.03) !important; border: 1px solid var(--border) !important; }
#profile-studio-overlay .ps-privacy-box svg { color: var(--accent); margin-top: 2px; }
#profile-studio-overlay .ps-summary-card { display: grid !important; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 !important; padding: 8px !important; margin-bottom: 20px; }
#profile-studio-overlay .ps-summary-stat { text-align: center; padding: 16px 8px; border-right: 1px solid var(--border); background: none !important; border-top: 0; border-bottom: 0; border-left: 0; }
#profile-studio-overlay .ps-summary-stat:last-child { border-right: 0; }
#profile-studio-overlay .ps-stat-value { font: 800 1.8rem/1 var(--ps-display) !important; color: var(--text-primary); }
#profile-studio-overlay .ps-stat-added .ps-stat-value, #profile-studio-overlay .ps-stat-value.ps-stat-added { color: var(--accent) !important; }
#profile-studio-overlay .ps-stat-label { margin-top: 8px; font-size: 0.78rem !important; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted) !important; }
#profile-studio-overlay .ps-order-list { padding-left: 22px; line-height: 1.9; color: var(--text-secondary); }
#profile-studio-overlay .ps-backup-notice { padding: 14px 16px; border-radius: 12px; background: rgba(255,255,255,0.03); border: 1px solid var(--border); font-size: 0.9rem; color: var(--text-secondary); margin: 16px 0; }
#profile-studio-overlay .ps-confirm-bottom-bar, #profile-studio-overlay .ps-bottom-bar { background: rgba(8, 10, 14, 0.92) !important; backdrop-filter: blur(18px); border-top: 1px solid var(--border-hover) !important; }
#profile-studio-overlay .ps-btn-lg { min-height: 48px; padding: 0 24px; font-size: 1rem; }
#profile-studio-overlay .ps-success-body { text-align: center; }
#profile-studio-overlay .ps-success-icon { width: 76px; height: 76px; margin: 0 auto 18px; border-radius: 50%; display: grid; place-items: center; background: rgba(0,245,160,0.1); border: 2px solid var(--accent); color: var(--accent); box-shadow: 0 0 0 10px rgba(0,245,160,0.06); }
#profile-studio-overlay .ps-success-tip { text-align: left; display: flex; gap: 14px; padding: 18px; border-radius: 16px; background: rgba(255,255,255,0.03); border: 1px solid var(--border); margin: 20px 0; }
#profile-studio-overlay .ps-success-tip svg { color: var(--accent); margin-top: 2px; }
#profile-studio-overlay .ps-success-tip p { margin: 4px 0 0; color: var(--text-muted); font-size: 0.9rem; line-height: 1.5; }
#profile-studio-overlay .ps-success-actions { display: flex; flex-direction: column; gap: 10px; }
#profile-studio-overlay .ps-success-actions .ps-btn { min-height: 48px; width: 100%; }

#profile-studio-overlay .ps-pe-top { background: none !important; border: 0 !important; padding: 0 !important; box-shadow: none !important; }
#profile-studio-overlay .ps-pe-top { display: flex; flex-direction: column; gap: 12px; }
#profile-studio-overlay .ps-pe-save { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
#profile-studio-overlay .ps-pe-save-state { font-size: 0.85rem; color: var(--text-muted); }
#ps-content[data-screen="copy"] .ps-setup-row { justify-content: flex-start; border: 0; gap: 16px; }
#ps-content[data-screen="copy"] .ps-setup-row > span { flex: none; }
#ps-content[data-screen="copy"] .ps-copy-name { flex: 1 1 auto; max-width: 420px; }

/* ---- 6. Home screen and artwork canvas ---- */
#ps-content[data-screen="profiles"] .ps-header-profile-badge { display: none !important; }
#profile-studio-overlay .ps-home-shelf-rank { display: none !important; }
#profile-studio-overlay .ps-home-badge {
  display: inline-flex !important; align-items: center; gap: 7px; background: none !important; border: 0 !important; padding: 0 !important;
  color: var(--text-muted) !important; font-size: 0.8rem !important; font-weight: 600 !important; letter-spacing: 0 !important; text-transform: none !important;
}
#profile-studio-overlay .ps-home-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
#profile-studio-overlay .ps-home-addon-tag { background: none !important; border: 0 !important; padding: 0 !important; color: var(--text-muted) !important; font-size: 0.8rem !important; }
#profile-studio-overlay .ps-home-action-btn { min-height: 38px; border-radius: 10px !important; font-size: 0.86rem !important; }
#profile-studio-overlay .ps-home-btn-open { background: rgba(0, 245, 160, 0.09) !important; border: 1px solid rgba(0, 245, 160, 0.38) !important; color: var(--accent-light) !important; }
#profile-studio-overlay .ps-home-btn-open:hover { background: rgba(0, 245, 160, 0.18) !important; border-color: var(--accent) !important; }
#profile-studio-overlay .ps-home-row { border-radius: 18px !important; transition: border-color 0.2s ease; }
#profile-studio-overlay .ps-home-row:hover { border-color: var(--border-hover) !important; }

/* ---- 7. Small screens ---- */
@media (max-width: 720px) {
  #ps-content[data-screen] .ps-subheader { overflow-x: auto !important; scrollbar-width: none; padding: 0 12px !important; gap: 8px; }
  #ps-content[data-screen] .ps-subheader::-webkit-scrollbar { display: none; }
  #profile-studio-overlay .ps-subheader-center { display: none !important; }
  #profile-studio-overlay .ps-subheader-right { margin-left: auto; }
  #profile-studio-overlay .ps-subheader .ps-btn { white-space: nowrap; }
  #ps-content[data-screen] > .ps-body { padding-left: 16px !important; padding-right: 16px !important; }
  #profile-studio-overlay .ps-hub-grid, #profile-studio-overlay .ps-setup-grid, #profile-studio-overlay .ps-copy-grid { grid-template-columns: 1fr !important; }
  #profile-studio-overlay .ps-hub-tile { min-height: 0; padding-bottom: 60px !important; }
  #profile-studio-overlay .ps-setup-row { flex-wrap: wrap; }
  #profile-studio-overlay .ps-setup-row select { min-width: 0; width: 100%; }
  #profile-studio-overlay .ps-summary-card { grid-template-columns: 1fr 1fr; }
  #profile-studio-overlay .ps-summary-stat:nth-child(2) { border-right: 0; }
  #profile-studio-overlay .ps-addon-row { flex-wrap: wrap; row-gap: 10px; }
  #profile-studio-overlay .ps-addon-info { flex-basis: calc(100% - 140px) !important; }
  #profile-studio-overlay .ps-addon-status { order: 5; }
  #profile-studio-overlay .ps-mixer-tabs { width: 100%; }
  #profile-studio-overlay .ps-mixer-tab { flex: 1; padding: 0 8px; }
  #profile-studio-overlay .ps-pe-modes { display: flex !important; width: 100% !important; }
  #profile-studio-overlay .ps-pe-modes > button { flex: 1 1 0 !important; padding: 0 8px; }
}

/* ---- 8. Motion: a screen arrives, it does not just appear ---- */
#ps-content[data-screen] > .ps-body > *, #ps-content[data-screen] > .ps-page-head-plain, #ps-content[data-screen] > .ps-body { animation: psArrive 0.55s var(--ps-ease) both; }
#ps-content[data-screen] > .ps-body > *:nth-child(2) { animation-delay: 0.04s; }
#ps-content[data-screen] > .ps-body > *:nth-child(3) { animation-delay: 0.08s; }
#ps-content[data-screen] > .ps-body > *:nth-child(n+4) { animation-delay: 0.12s; }
@keyframes psArrive { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
#profile-studio-overlay .ps-spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(0, 245, 160, 0.16); border-top-color: var(--accent); animation: psSpin 0.8s linear infinite; }
@keyframes psSpin { to { transform: rotate(360deg); } }
#profile-studio-overlay .ps-loading-view { display: grid; place-items: center; align-content: center; gap: 16px; min-height: 50vh; }
#profile-studio-overlay .ps-loading-text { color: var(--text-secondary); font-size: 0.95rem; }
@media (prefers-reduced-motion: reduce) {
  #ps-content[data-screen] > .ps-body, #ps-content[data-screen] > .ps-body > *, #ps-content[data-screen] > .ps-page-head-plain { animation: none !important; }
  #profile-studio-overlay .ps-spinner { animation-duration: 2.4s; }
}

#profile-studio-overlay .ps-page-head-plain { flex: 0 0 auto !important; height: auto !important; min-height: 0 !important; max-height: none !important; margin: 0 !important; }
#profile-studio-overlay .ps-page-head-plain .ps-success-icon { margin: 0 auto 18px !important; }
#profile-studio-overlay .ps-page-head-plain.ps-header-center { text-align: center; }

#profile-studio-overlay .ps-page-head-plain { position: static !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important; transform: none !important; box-shadow: none !important; width: 100% !important; box-sizing: border-box; }
#ps-content[data-screen="login"] > .ps-body, #ps-content[data-screen="success"] > .ps-body { background: none !important; border: 0 !important; box-shadow: none !important; }

#profile-studio-overlay .ps-ico { display: inline-block; vertical-align: -2px; margin-right: 4px; }

.ps-sr-only { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

@media (max-width: 720px) {
  #profile-studio-overlay .ps-home-row { flex-direction: column !important; align-items: stretch !important; padding: 14px !important; gap: 12px !important; }
  #profile-studio-overlay .ps-home-left-col { flex-direction: row !important; align-items: center !important; justify-content: flex-start !important; height: auto !important; min-height: 0 !important; width: 100% !important; gap: 10px !important; padding: 0 !important; }
  #profile-studio-overlay .ps-home-drag-handle { display: none !important; }
  #profile-studio-overlay .ps-home-move { flex-direction: row !important; display: flex !important; gap: 6px !important; }
  #profile-studio-overlay .ps-home-order-badge { margin-left: auto; }
  #profile-studio-overlay .ps-home-actions { flex-wrap: wrap !important; gap: 8px !important; width: 100% !important; }
  #profile-studio-overlay .ps-home-actions .ps-home-action-btn { flex: 1 1 auto; justify-content: center; }
  #profile-studio-overlay .ps-home-stage-hero { padding: 18px !important; }
}

#ps-content > .ps-body { scrollbar-gutter: stable both-edges; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.18) transparent; }
