/**
 * Profiles panel — v2 selection UX (responsive,
touch-friendly).
 * Loaded after main.css; use .profiles-panel--v2 for overrides.
 */

.profiles-panel--modern.profiles-panel--v2 {
  --pr-bg: #ffffff;
  --pr-bg-soft: #fffdf8;
  --pr-border: rgba(231, 201, 120, 0.55);
  --pr-border-strong: rgba(185, 28, 28, 0.35);
  --pr-text: #3f0f19;
  --pr-text-soft: #7a4b12;
  --pr-accent: #b91c1c;
  --pr-gold: #a16207;
  --pr-radius: 4px;
  --pr-shadow: 0 4px 20px rgba(127, 29, 29, 0.07);

  display: flex !important;
  flex-direction: column !important;
  gap: 0.75rem !important;
  padding: 1rem 1.05rem 0.55rem !important;
  border-radius: var(--pr-radius) !important;
  border: 1px solid var(--pr-border) !important;
  background: linear-gradient(180deg, #ffffff 0%, #fffdf8 100%) !important;
  box-shadow: var(--pr-shadow) !important;
  height: auto !important;
  max-height: none !important;
  align-self: start !important;
  flex: 0 0 auto !important;
  min-height: 0 !important;
  overflow: visible;
}/* ── Header ─────────────────────────────────────────────── */
.profiles-panel--v2 .profiles-panel-header {
  display: block;
  margin-bottom: 0.15rem;
}.profiles-panel--v2 .profiles-panel-header__brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}.profiles-panel--v2 .profiles-panel-mark {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: linear-gradient(145deg, #c62828 0%, #9f1239 100%);
  color: #fff;
  box-shadow: 0 2px 10px rgba(185, 28, 28, 0.2);
}.profiles-panel--v2 .profiles-panel-eyebrow {
  display: none;
}.profiles-panel--v2 .profiles-panel-title,
.profiles-panel--v2 .card-title {
  margin: 0 !important;
  font-size: 1.05rem !important;
  font-weight: 700 !important;
  letter-spacing: -0.02em !important;
  text-transform: none !important;
  color: var(--pr-text) !important;
  line-height: 1.25 !important;
}.profiles-panel--v2 .profiles-panel-caption,
.profiles-panel--v2 .card-caption {
  margin: 0.12rem 0 0 !important;
  font-size: 0.78rem !important;
  line-height: 1.35 !important;
  color: rgba(122, 75, 18, 0.75) !important;
  text-transform: none !important;
}.profiles-panel--v2 .card-header {
  display: none;
}/* ── Create profile trigger ─────────────────────────────── */
.profiles-create-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  width: 100%;
  min-height: 46px;
  margin: 0 0 0.75rem;
  padding: 0.55rem 0.85rem;
  border: 1px solid rgba(231, 201, 120, 0.55);
  border-radius: 12px;
  background: linear-gradient(180deg, #fffefb 0%, #fff 100%);
  color: var(--pr-text);
  font-size: 0.88rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(120, 53, 15, 0.06);
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.12s ease;
}.profiles-create-trigger svg {
  flex: 0 0 auto;
  color: #b91c1c;
}.profiles-create-trigger:hover {
  background: linear-gradient(180deg, #fff 0%, #fffdf8 100%);
  border-color: rgba(217, 119, 6, 0.45);
  box-shadow: 0 4px 12px rgba(120, 53, 15, 0.1);
}.profiles-create-trigger:focus-visible {
  outline: none;
  border-color: rgba(217, 119, 6, 0.75);
  box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.22);
}.profiles-panel-sheet .profiles-create-trigger {
  margin-bottom: 0.65rem;
}/* ── Create profile (legacy inline — removed) ─────────── */
.profiles-panel--v2 .profiles-create-panel {
  border: 1px solid var(--pr-border);
  border-radius: 12px;
  background: var(--pr-bg);
  overflow: hidden;
  position: relative;
}.profiles-panel--v2 .profiles-create-panel[open] {
  overflow: visible;
}.profiles-panel--v2 .profiles-create-summary {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.72rem 2rem 0.72rem 0.85rem;
  cursor: pointer;
  list-style: none;
  user-select: none;
  -webkit-user-select: none;
  background: linear-gradient(180deg, #fffdf8, #fff);
  transition: background 0.15s ease;
}.profiles-panel--v2 .profiles-create-summary::-webkit-details-marker {
  display: none;
}.profiles-panel--v2 .profiles-create-summary::after {
  content: "";
  position: absolute;
  right: 0.85rem;
  top: 50%;
  width: 8px;
  height: 8px;
  margin-top: -4px;
  border-right: 2px solid var(--pr-gold);
  border-bottom: 2px solid var(--pr-gold);
  transform: translateY(-25%) rotate(45deg);
  transition: transform 0.2s ease;
}.profiles-panel--v2 .profiles-create-panel[open] .profiles-create-summary::after {
  transform: translateY(25%) rotate(-135deg);
}.profiles-panel--v2 .profiles-create-summary-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--pr-text);
}.profiles-panel--v2 .profiles-create-summary-hint {
  font-size: 0.72rem;
  color: var(--pr-text-soft);
}.profiles-panel--v2 .profiles-create-form {
  padding: 0 0.85rem 0.85rem;
  display: flex !important;
  flex-direction: column !important;
  gap: 0.65rem !important;
  margin: 0 !important;
  grid-template-columns: unset !important;
}.profiles-panel--v2 .profiles-create-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.55rem;
}.profiles-panel--v2 .profile-form-field label {
  display: block;
  margin-bottom: 0.28rem !important;
  font-size: 0.78rem !important;
  font-weight: 600 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  color: var(--pr-text) !important;
}.profiles-label-optional {
  font-weight: 500;
  color: var(--pr-text-soft);
  font-size: 0.72rem;
}.profiles-panel--v2 .profile-form-row input {
  width: 100% !important;
  min-height: 44px !important;
  padding: 0.55rem 0.7rem !important;
  font-size: 0.9rem !important;
  border-radius: 10px !important;
  border: 1px solid var(--pr-border) !important;
  background: #fff !important;
  color: var(--pr-text) !important;
}.profiles-panel--v2 .profiles-create-submit {
  width: 100% !important;
  min-height: 46px !important;
  border-radius: 11px !important;
  border: none !important;
  background: linear-gradient(135deg, #b91c1c, #991b1b) !important;
  color: #fff !important;
  font-weight: 700 !important;
  box-shadow: 0 4px 12px rgba(185, 28, 28, 0.22) !important;
}/* ── List toolbar & search ──────────────────────────────── */
.profiles-panel--v2 .profiles-list-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 0;
  flex: 0 0 auto;
  padding-bottom: 0;
  margin-bottom: 0;
}.profiles-panel--v2 .profiles-list-toolbar {
  display: none;
}.profiles-panel--v2 .profiles-count-badge {
  display: none;
}/* ── Workspace switcher (inline expand combobox) ─────────── */
.profiles-select--modern {
  min-width: 0;
  --profiles-select-row-height: 3.4125rem;
  --profiles-select-visible-rows: 7;
  --profiles-select-list-max-height: calc(var(--profiles-select-visible-rows) * var(--profiles-select-row-height));
  --profiles-select-field-max-height: min(
    72vh,
    calc(5.75rem + var(--profiles-select-list-max-height))
  );
}.profiles-select__shell {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-radius: 14px;
  border: 1px solid rgba(212, 175, 55, 0.38);
  background: #fff;
  box-shadow: 0 1px 3px rgba(63, 15, 25, 0.05);
  overflow: hidden;
  transition: box-shadow 0.22s ease, border-color 0.22s ease;
}.profiles-select__shell--open {
  border-color: rgba(185, 28, 28, 0.22);
  box-shadow:
    0 0 0 3px rgba(185, 28, 28, 0.07),
    0 10px 28px rgba(63, 15, 25, 0.1);
}.profiles-select__field {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}.profiles-select__shell--open .profiles-select__field {
  min-height: 0;
  max-height: var(--profiles-select-field-max-height);
  overflow: hidden;
}.profiles-select__trigger {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  min-width: 0;
  min-height: 0;
  padding: 0.62rem 0.65rem;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--pr-text);
  cursor: pointer;
  text-align: left;
  box-shadow: none;
  transition: background 0.16s ease;
}.profiles-select__trigger:hover:not(:disabled) {
  background: rgba(255, 253, 248, 0.85);
}.profiles-select__trigger:focus-visible {
  outline: none;
  background: rgba(254, 243, 199, 0.35);
  box-shadow: inset 0 0 0 2px rgba(185, 28, 28, 0.25);
}.profiles-select__field--open .profiles-select__trigger {
  background: rgba(255, 253, 248, 0.65);
}.profiles-select__shell--open .profiles-select__field--open .profiles-select__trigger {
  border-bottom: 1px solid rgba(231, 201, 120, 0.45);
}.profiles-select__trigger:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}.profiles-select__trigger-status {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(161, 98, 7, 0.28);
  flex-shrink: 0;
}.profiles-select__trigger-status--live {
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.22);
}.profiles-select__trigger-avatar {
  flex: 0 0 auto;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #fff;
  background: linear-gradient(145deg, #be123c 0%, #9f1239 100%);
  box-shadow: 0 2px 8px rgba(185, 28, 28, 0.18);
}.profiles-select__trigger-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}.profiles-select__trigger-label-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}.profiles-select__trigger-name {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--pr-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}.profiles-select__count {
  flex: 0 0 auto;
  min-width: 1.25rem;
  padding: 0.05rem 0.38rem;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1.35;
  color: #9f1239;
  background: rgba(254, 226, 226, 0.65);
  border: 1px solid rgba(185, 28, 28, 0.12);
}.profiles-select__count[data-count="0"],
.profiles-select__count[data-count="1"],
.profiles-select__count[hidden] {
  display: none;
}.profiles-select__trigger-meta {
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.35;
  color: rgba(122, 75, 18, 0.78);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}.profiles-select__trigger-chevron {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 9px;
  color: rgba(122, 75, 18, 0.65);
  background: rgba(254, 243, 199, 0.4);
  transition: transform 0.22s ease, color 0.18s ease, background 0.18s ease;
}.profiles-select__shell--open .profiles-select__trigger-chevron {
  transform: rotate(180deg);
  color: #b91c1c;
  background: rgba(254, 226, 226, 0.45);
}.profiles-select__panel {
  display: none;
  flex-direction: column;
  gap: 0;
  padding: 0;
  border: none;
  background: #fff;
  box-shadow: none;
  min-height: 0;
  overflow: hidden;
}.profiles-select__panel:not([hidden]) {
  display: flex;
  flex-direction: column;
  min-height: 0;
}.profiles-select__panel[hidden] {
  display: none !important;
}.profiles-select__list-scroll {
  flex: 1 1 auto;
  min-height: 0;
  max-height: var(--profiles-select-list-max-height);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
  position: relative;
}.profiles-select__list-scroll--overflow::after {
  content: "";
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1;
  display: block;
  height: 1.35rem;
  margin-top: -1.35rem;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.96));
}.profiles-select__list-scroll::-webkit-scrollbar {
  width: 7px;
}.profiles-select__list-scroll::-webkit-scrollbar-thumb {
  background: rgba(161, 98, 7, 0.34);
  border: 2px solid transparent;
  background-clip: padding-box;
  border-radius: 999px;
}.profiles-select__list-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(161, 98, 7, 0.5);
  background-clip: padding-box;
}.profiles-select__list {
  display: block;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  max-height: none;
  overflow: visible;
  flex: none;
}.profiles-select__search {
  display: flex;
  align-items: center;
  gap: 0.42rem;
  margin: 0.5rem 0.55rem 0.35rem;
  padding: 0.42rem 0.52rem;
  border-radius: 9px;
  border: 1px solid rgba(212, 175, 55, 0.35);
  background: #fff;
  flex-shrink: 0;
}.profiles-select__search--hidden {
  display: none !important;
}.profiles-select__panel--no-search:not([hidden]) {
  padding-top: 0.15rem;
}.profiles-select__search:focus-within {
  border-color: rgba(185, 28, 28, 0.28);
  box-shadow: 0 0 0 3px rgba(185, 28, 28, 0.08);
}.profiles-select__search-icon {
  flex: 0 0 auto;
  color: rgba(161, 98, 7, 0.75);
  display: flex;
}.profiles-select__search-input {
  flex: 1;
  min-width: 0;
  min-height: 0;
  border: none;
  background: transparent;
  font-size: 0.84rem;
  color: var(--pr-text);
  outline: none;
  padding: 0;
}.profiles-select__search-input::placeholder {
  color: rgba(122, 75, 18, 0.5);
}.profiles-select__hint {
  margin: 0 0.55rem 0.35rem;
  padding: 0;
  font-size: 0.64rem;
  font-weight: 500;
  color: rgba(122, 75, 18, 0.65);
  line-height: 1.35;
  flex-shrink: 0;
}.profiles-select__hint[hidden] {
  display: none;
}.profiles-select__option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  min-width: 0;
  min-height: var(--profiles-select-row-height);
  box-sizing: border-box;
  padding: 0.52rem 0.65rem;
  border: none;
  border-radius: 0;
  border-bottom: 1px solid rgba(231, 201, 120, 0.22);
  background: transparent;
  color: var(--pr-text);
  cursor: pointer;
  text-align: left;
  box-shadow: none;
  transition: background 0.14s ease;
}.profiles-select__option:last-child {
  border-bottom: none;
}.profiles-select__option:hover,
.profiles-select__option--highlight {
  background: rgba(254, 243, 199, 0.45);
}.profiles-select__option--active {
  background: rgba(254, 242, 242, 0.55);
}.profiles-select__option--active.profiles-select__option--highlight {
  background: rgba(254, 235, 235, 0.75);
}.profiles-select__option-avatar {
  flex: 0 0 auto;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 0.62rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(145deg, #be123c, #9f1239);
}.profiles-select__option-copy {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.14rem;
}.profiles-select__option-title-row {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  min-width: 0;
}.profiles-select__option-name {
  font-size: 0.82rem;
  font-weight: 650;
  line-height: 1.25;
  color: var(--pr-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}.profiles-select__option-badge {
  flex: 0 0 auto;
  padding: 0.05rem 0.35rem;
  border-radius: 999px;
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #be123c;
  background: rgba(255, 228, 230, 0.9);
}.profiles-select__option-lock {
  flex: 0 0 auto;
  display: flex;
  color: rgba(161, 98, 7, 0.85);
}.profiles-select__option-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
}.profiles-select__option-team {
  font-size: 0.6rem;
  font-weight: 600;
  padding: 0.06rem 0.34rem;
  border-radius: 999px;
  color: #92400e;
  background: rgba(254, 243, 199, 0.55);
  border: 1px solid rgba(212, 175, 55, 0.35);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}.profiles-select__option-count {
  font-size: 0.66rem;
  font-weight: 500;
  color: rgba(122, 75, 18, 0.72);
}.profiles-select__option-check {
  flex: 0 0 auto;
  display: flex;
  color: #be123c;
  opacity: 0;
}.profiles-select__option--active .profiles-select__option-check {
  opacity: 1;
}.profiles-select__empty {
  margin: 0;
  padding: 0.85rem 0.65rem;
  font-size: 0.78rem;
  color: rgba(122, 75, 18, 0.72);
  text-align: center;
}.profiles-select__actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 0.35rem;
  padding: 0.45rem 0.55rem;
  border-top: 1px solid rgba(231, 201, 120, 0.35);
  background: rgba(255, 253, 248, 0.55);
  flex-shrink: 0;
}.profiles-select__actions .profile-action-wrap {
  display: flex;
  min-width: 0;
}.profiles-select__actions .profile-action-chip,
.profiles-select__actions .profile-icon-btn {
  width: 100% !important;
  min-width: 0 !important;
  min-height: 38px !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.35rem !important;
  font-family: inherit !important;
  text-transform: none !important;
  letter-spacing: 0.01em !important;
}.profiles-select__actions .profile-action-chip svg,
.profiles-select__actions .profile-icon-btn svg {
  flex: 0 0 auto !important;
  width: 16px !important;
  height: 16px !important;
  padding: 0 !important;
  border: none !important;
  background: none !important;
  box-shadow: none !important;
  display: block !important;
}.profiles-select__actions .profile-action-label--visible {
  position: static !important;
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  overflow: visible !important;
  clip: auto !important;
  font-size: 0.72rem !important;
  font-weight: 600 !important;
  text-transform: none !important;
  line-height: 1.15 !important;
}.profiles-select__shell--open .profiles-select__actions {
  display: none !important;
}

@media (min-width: 1401px) {
  html.is-desktop-layout .profiles-panel--v2 .profiles-select__shell--open .profiles-select__actions {
    display: flex !important;
  }
}.profiles-select__actions[hidden] {
  display: none !important;
}.profiles-select__actions .profile-item-actions {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 0.35rem !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
  width: 100%;
}/* Isolate from global red button chrome in main.css */
.profiles-panel--v2 .profiles-select__trigger,
.profiles-panel--v2 .profiles-select__option {
  text-transform: none !important;
  letter-spacing: normal !important;
  font-weight: inherit !important;
  justify-content: flex-start !important;
  min-height: 0 !important;
}.profiles-panel--v2 .profiles-select__trigger,
.profiles-panel--v2 .profiles-select__trigger:hover,
.profiles-panel--v2 .profiles-select__trigger:active,
.profiles-panel--v2 .profiles-select__trigger:focus,
.profiles-panel--v2 .profiles-select__trigger:focus-visible {
  background: transparent !important;
  color: var(--pr-text) !important;
  border: none !important;
  transform: none !important;
  filter: none !important;
  box-shadow: none !important;
}.profiles-panel--v2 .profiles-select__trigger:hover:not(:disabled) {
  background: rgba(255, 253, 248, 0.85) !important;
}.profiles-panel--v2 .profiles-select__field--open .profiles-select__trigger {
  background: rgba(255, 253, 248, 0.65) !important;
  border-bottom: none !important;
}.profiles-panel--v2 .profiles-select__shell--open .profiles-select__field--open .profiles-select__trigger {
  border-bottom: 1px solid rgba(231, 201, 120, 0.45) !important;
}.profiles-panel--v2 .profiles-select__shell--open .profiles-select__trigger-chevron {
  transform: rotate(180deg) !important;
  color: #b91c1c !important;
  background: rgba(254, 226, 226, 0.45) !important;
}.profiles-panel--v2 .profiles-select__option,
.profiles-panel--v2 .profiles-select__option:hover,
.profiles-panel--v2 .profiles-select__option:active,
.profiles-panel--v2 .profiles-select__option:focus,
.profiles-panel--v2 .profiles-select__option:focus-visible {
  background: transparent !important;
  color: var(--pr-text) !important;
  border-style: solid !important;
  border-left: none !important;
  border-right: none !important;
  border-top: none !important;
  text-transform: none !important;
  letter-spacing: normal !important;
  filter: none !important;
  box-shadow: none !important;
  transform: none !important;
}.profiles-panel--v2 .profiles-select__option:hover,
.profiles-panel--v2 .profiles-select__option--highlight {
  background: rgba(254, 243, 199, 0.45) !important;
}.profiles-panel--v2 .profiles-select__option--active {
  background: rgba(254, 242, 242, 0.55) !important;
}.profiles-panel--v2 .profiles-select__option-name,
.profiles-panel--v2 .profiles-select__option-count,
.profiles-panel--v2 .profiles-select__trigger-name,
.profiles-panel--v2 .profiles-select__trigger-meta {
  color: inherit;
}.profiles-panel--v2 .profiles-select__option-count {
  color: rgba(122, 75, 18, 0.72) !important;
}.profiles-panel--v2 .profiles-select__trigger-meta {
  color: rgba(122, 75, 18, 0.78) !important;
}

@media (prefers-reduced-motion: reduce) {
  .profiles-select__trigger-chevron {
    transition: none;
  }
}/* ── Profile list (legacy; kept for compatibility) ───────── */
.profiles-panel--v2 .profiles-list {
  display: flex !important;
  flex-direction: column !important;
  gap: 0.4rem !important;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
  flex: 0 0 auto !important;
  min-height: 0 !important;
  height: auto !important;
  max-height: min(42vh, 520px) !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  scrollbar-gutter: stable;
}.profiles-list-item {
  margin: 0;
  padding: 0;
}.profiles-panel--v2 .profile-item-row {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 0 !important;
  grid-template-columns: unset !important;
  padding: 0 !important;
  margin: 0 !important;
  min-height: 0 !important;
  height: auto !important;
  border-radius: 12px !important;
  border: 1px solid var(--pr-border) !important;
  background: var(--pr-bg) !important;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(63, 15, 25, 0.04);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}.profiles-panel--v2 .profile-item-main {
  width: 100%;
  gap: 0.2rem !important;
}.profiles-panel--v2 .profile-item-name {
  font-size: 0.92rem !important;
  font-weight: 700 !important;
  color: var(--pr-text) !important;
  letter-spacing: -0.01em !important;
  text-transform: none !important;
  line-height: 1.25 !important;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}.profiles-panel--v2 .profiles-create-hint,
.profiles-panel--v2 .profile-password-hint {
  margin: 0;
  font-size: 0.74rem;
  line-height: 1.45;
  color: var(--pr-text-soft);
}.profiles-create-security {
  grid-column: 1 / -1;
  border: 1px solid rgba(231, 201, 120, 0.45);
  border-radius: 10px;
  background: rgba(255, 253, 248, 0.8);
  overflow: hidden;
  position: relative;
}.profiles-create-security-summary {
  position: relative;
  display: flex;
  align-items: center;
  padding: 0.62rem 2rem 0.62rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--pr-text);
  cursor: pointer;
  list-style: none;
  user-select: none;
  -webkit-user-select: none;
}.profiles-create-security-summary::-webkit-details-marker {
  display: none;
}.profiles-panel--v2 .profiles-create-security-summary::after {
  content: "";
  position: absolute;
  right: 0.85rem;
  top: 50%;
  width: 8px;
  height: 8px;
  margin-top: -4px;
  border-right: 2px solid var(--pr-gold);
  border-bottom: 2px solid var(--pr-gold);
  transform: translateY(-25%) rotate(45deg);
  transition: transform 0.2s ease;
}.profiles-panel--v2 .profiles-create-security[open] .profiles-create-security-summary::after {
  transform: translateY(25%) rotate(-135deg);
}.profiles-create-security-fields {
  display: grid;
  gap: 0.55rem;
  padding: 0 0.75rem 0.75rem;
}/* Password fields in create form — match modal styling,
hide native browser chrome */
.profiles-panel--v2 .profile-password-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}.profiles-panel--v2 .profile-password-input-wrap input {
  padding-right: 2.75rem !important;
}.profiles-panel--v2 .profile-password-input-wrap input::-webkit-credentials-auto-fill-button,
.profiles-panel--v2 .profile-password-input-wrap input::-webkit-strong-password-auto-fill-button {
  visibility: hidden;
  pointer-events: none;
  position: absolute;
  right: 0;
}.profiles-panel--v2 .profile-password-input-wrap input::-ms-reveal {
  display: none;
}.profiles-panel--v2 .profile-password-toggle {
  position: absolute;
  right: 0.4rem;
  top: 0;
  bottom: 0;
  margin: auto 0;
  width: 34px;
  height: 34px;
  min-height: 34px !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border: 1px solid rgba(231, 201, 120, 0.55) !important;
  border-radius: 9px !important;
  background: #fff !important;
  color: var(--pr-text-soft) !important;
  box-shadow: none !important;
  cursor: pointer;
  text-transform: none !important;
  letter-spacing: normal !important;
  transform: none !important;
}.profiles-panel--v2 .profile-password-toggle:hover {
  background: #fffdf8 !important;
  color: var(--pr-accent, #991b1b) !important;
  border-color: rgba(185, 28, 28, 0.35) !important;
  transform: none !important;
  box-shadow: none !important;
  filter: none !important;
}.profiles-panel--v2 .profile-password-toggle .icon-eye-off {
  display: none;
}.profiles-panel--v2 .profile-password-toggle.is-visible .icon-eye {
  display: none;
}.profiles-panel--v2 .profile-password-toggle.is-visible .icon-eye-off {
  display: block;
}/* ── Sheet tabs (mobile/tablet) ─────────────────────────── */
.profiles-sheet-tabs {
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
  padding: 0.35rem;
  border-radius: 12px;
  background: rgba(254, 243, 199, 0.35);
  border: 1px solid var(--pr-border);
}.profiles-sheet-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 42px;
  padding: 0.45rem 0.65rem;
  border: none;
  border-radius: 9px;
  background: transparent !important;
  color: var(--pr-text-soft) !important;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: none !important;
  filter: none !important;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}.profiles-sheet-tab svg {
  flex: 0 0 auto;
  opacity: 0.85;
}.profiles-sheet-tab--active {
  background: #fff !important;
  color: var(--pr-accent) !important;
  box-shadow: 0 1px 4px rgba(63, 15, 25, 0.08) !important;
}.profiles-sheet-panels {
  display: contents;
}.profiles-sheet-panel {
  display: contents;
}.profiles-panel--v2 .profile-item-lock-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 6px;
  background: rgba(254, 243, 199, 0.55);
  color: var(--pr-gold);
  border: none;
}.profiles-panel--v2 .profiles-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  padding: 1.35rem 1rem;
  text-align: center;
  font-size: 0.84rem;
  color: var(--pr-text-soft);
  border: 1px dashed var(--pr-border);
  border-radius: 14px;
  background: rgba(255, 253, 248, 0.7);
}.profiles-panel--v2 .profiles-empty-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(254, 243, 199, 0.45);
  color: var(--pr-gold);
}.profiles-panel--v2 .profiles-empty-copy {
  max-width: 18rem;
  line-height: 1.45;
}.profiles-panel--v2 .profile-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
  margin: 0 !important;
}.profiles-panel--v2 .profile-item-team-pill {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  color: var(--pr-gold);
  background: rgba(254, 243, 199, 0.5);
  border: 1px solid var(--pr-border);
}.profiles-panel--v2 .profile-item-count {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--pr-text-soft);
}.profiles-panel--v2 .profile-item-actions {
  flex: 0 0 auto !important;
  align-self: center !important;
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.15rem !important;
  padding: 0.28rem 0.35rem !important;
  margin: 0 !important;
  width: auto !important;
  background: rgba(255, 253, 248, 0.85) !important;
  border-left: 1px solid var(--pr-border) !important;
  grid-auto-flow: unset !important;
}.profiles-panel--v2 .profile-action-chip,
.profiles-panel--v2 .profile-icon-btn {
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  min-height: 32px !important;
  padding: 0 !important;
  border-radius: 8px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border: 1px solid transparent !important;
  background: transparent !important;
  color: var(--pr-text-soft) !important;
  box-shadow: none !important;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}.profiles-panel--v2 .profile-action-chip svg,
.profiles-panel--v2 .profile-icon-btn svg {
  width: 16px !important;
  height: 16px !important;
}.profiles-panel--v2 .profile-action-wrap {
  display: flex;
}.profiles-panel--v2 .profile-action-label {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}.profiles-panel--v2 .profile-action-chip--view:hover {
  color: var(--pr-gold) !important;
  background: rgba(254, 243, 199, 0.5) !important;
  border-color: var(--pr-border) !important;
}.profiles-panel--v2 .profile-action-chip--edit:hover {
  color: var(--pr-accent) !important;
  background: rgba(254, 242, 242, 0.8) !important;
  border-color: rgba(185, 28, 28, 0.2) !important;
}.profiles-panel--v2 .profile-action-chip--danger:hover {
  color: #991b1b !important;
  background: #fef2f2 !important;
  border-color: rgba(220, 38, 38, 0.25) !important;
}.profiles-panel--v2 .profile-action-chip:hover {
  transform: none !important;
}/* Empty & no-results */
.profiles-panel--v2 .profiles-no-results {
  padding: 0.85rem;
  text-align: center;
  font-size: 0.82rem;
  color: var(--pr-text-soft);
  border-radius: 10px;
  background: rgba(254, 243, 199, 0.25);
}/* ── Responsive ─────────────────────────────────────────── */
@media (min-width: 520px) {
  .profiles-panel--v2 .profiles-create-grid {
    grid-template-columns: 1fr 1fr;
  }

  .profiles-panel--v2 .profile-form-field--full {
    grid-column: 1 / -1;
  }
}

@media (min-width: 1401px) {
  html.is-desktop-layout .app-layout {
    align-items: start !important;
  }

  .profiles-panel--modern.profiles-panel--v2 {
    height: auto !important;
    max-height: none !important;
    align-self: start !important;
  }

  .profiles-panel--v2 .profiles-list-section {
    flex: 0 0 auto !important;
    height: auto !important;
  }

  .profiles-panel--v2 .profiles-list--modern {
    max-height: min(48vh, 560px) !important;
  }

  /* Scrollable workspace list when the switcher is open */
  .profiles-panel--v2 .profiles-select__shell--open .profiles-select__field {
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-height: var(--profiles-select-field-max-height);
    overflow: hidden;
  }

  .profiles-panel--v2 .profiles-select__shell--open .profiles-select__panel {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
  }

  .profiles-panel--v2 .profiles-select__list-scroll {
    flex: 1 1 auto;
    min-height: 0;
    max-height: var(--profiles-select-list-max-height) !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    scroll-padding-block: 0.35rem;
  }

  .profiles-panel--v2 .profiles-select__list-scroll::-webkit-scrollbar {
    width: 7px;
  }

  .profiles-panel--v2 .profiles-select__list-scroll::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.35);
    border: 2px solid transparent;
    background-clip: padding-box;
    border-radius: 999px;
  }

  .profiles-panel--v2 .profiles-select__list-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 116, 139, 0.52);
    background-clip: padding-box;
  }

  /* Desktop profile actions — refined semantic chips */
  html.is-desktop-layout .profiles-panel--v2 .profiles-select__actions {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    gap: 0.4rem !important;
    margin: 0.5rem 0.55rem 0.55rem !important;
    padding: 0.45rem !important;
    border-radius: 12px !important;
    border: 1px solid rgba(148, 163, 184, 0.18) !important;
    background: linear-gradient(180deg, #fafbfc 0%, #ffffff 100%) !important;
    box-shadow:
      0 1px 2px rgba(15, 23, 42, 0.04),
      inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;
  }

  html.is-desktop-layout .profiles-panel--v2 .profiles-select__actions .profile-action-wrap {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    display: flex !important;
  }
}

@media (max-width: 1400px) {
  .profiles-panel--v2 .profiles-list,
  .profiles-panel--v2 .profiles-list--modern {
    flex: 0 1 auto !important;
    max-height: min(52dvh, 420px) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
  }

  .profiles-panel--v2 .profiles-card-actions,
  .profiles-panel--v2 .profile-item-actions {
    padding: 0.32rem 0.38rem !important;
    gap: 0.18rem !important;
  }

  .profiles-panel--v2 .profile-action-chip,
  .profiles-panel--v2 .profile-icon-btn {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
  }
}

@media (max-width: 480px) {
  .profiles-panel--v2 {
    padding: 0.85rem !important;
  }

  .profiles-panel--v2 .profiles-card-radio {
    display: none;
  }

  .profiles-panel--v2 .profiles-card-select,
  .profiles-panel--v2 .profile-item-btn {
    gap: 0.5rem !important;
    padding-left: 0.55rem !important;
  }

  .profiles-panel--v2 .profiles-card-avatar {
    width: 36px;
    height: 36px;
    font-size: 0.72rem;
    border-radius: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .profiles-panel--v2 .profiles-card,
  .profiles-panel--v2 .profile-action-chip {
    transition: none;
  }
}/* ── Desktop: hide sheet wrapper,
render panel normally ─── */
.profiles-panel-sheet {
  display: contents;
}/* Beat legacy main.css profile grid / stacked layouts */
.profiles-panel.profiles-panel--modern.profiles-panel--v2 .profile-item-row {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  grid-template-columns: none !important;
  grid-template-rows: none !important;
  min-height: 0 !important;
  height: auto !important;
}.profiles-panel.profiles-panel--modern.profiles-panel--v2 .profile-item-actions {
  display: flex !important;
  grid-auto-flow: unset !important;
  width: auto !important;
  border-bottom: none !important;
}/* Beat legacy main.css flex stretch on profile list */
.profiles-panel.profiles-panel--modern.profiles-panel--v2 .profiles-list {
  flex: 0 0 auto !important;
  min-height: 0 !important;
  height: auto !important;
  margin-top: 0 !important;
}/* ── Bottom-sheet backdrop + sheet (tablet/phone ≤1400px) ── */
.profiles-sheet-backdrop {
  display: none;
}/* Sheet hidden by default (desktop uses display:contents so renders inline) */
@media (max-width: 1400px) {
  /* Desktop content frame hides; sheet becomes overlay */
  .profiles-panel--modern.profiles-panel--v2 {
    padding: 0 !important;
    gap: 0 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    min-height: 0 !important;
    overflow: visible !important;
  }

  html.is-compact-layout > .profiles-panel-sheet,
  html.is-compact-layout .profiles-panel-sheet {
    display: none !important;
    position: fixed !important;
    inset: auto 0 0 0 !important;
    z-index: 900 !important;
    width: 100% !important;
    max-height: 92dvh !important;
    background: #fffdf8 !important;
    border-radius: 22px 22px 0 0 !important;
    box-shadow: 0 -12px 48px rgba(63, 15, 25, 0.16), 0 -2px 8px rgba(0, 0, 0, 0.06) !important;
    flex-direction: column !important;
    overflow: hidden !important;
    transform: translateY(100%) !important;
    transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.25s ease !important;
    opacity: 0 !important;
    will-change: transform, opacity !important;
  }

  html.is-compact-layout > .profiles-panel-sheet.profiles-panel-sheet--open,
  html.is-compact-layout .profiles-panel-sheet--open {
    display: flex !important;
    flex-direction: column !important;
    height: auto !important;
    max-height: 92dvh !important;
    transform: translateY(0) !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  /* Backdrop — portaled to <html> when sheet opens on compact */
  html.is-compact-layout > .profiles-sheet-backdrop,
  .profiles-sheet-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: none;
    height: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    min-height: -webkit-fill-available;
    z-index: 899;
    background: rgba(15, 5, 10, 0.45);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    opacity: 0;
    transition: opacity 0.28s ease;
    pointer-events: none;
    margin: 0;
    padding: 0;
    border: 0;
    transform: none;
  }

  html.is-compact-layout > .profiles-sheet-backdrop.profiles-sheet-backdrop--visible,
  .profiles-sheet-backdrop--visible {
    opacity: 1;
    pointer-events: auto;
    cursor: default;
  }

  /* Drag handle */
  .profiles-panel-sheet-handle {
    flex: 0 0 auto;
    display: flex;
    justify-content: center;
    padding: 0.6rem 0 0.35rem;
  }

  .profiles-panel-sheet-handle::before {
    content: "";
    display: block;
    width: 40px;
    height: 4px;
    border-radius: 99px;
    background: rgba(63, 15, 25, 0.18);
  }

  /* Sheet header row */
  .profiles-panel-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.15rem 1rem 0.65rem;
    border-bottom: 1px solid rgba(231, 201, 120, 0.35);
    flex: 0 0 auto;
  }

  .profiles-panel-sheet-title-group {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
    flex: 1 1 auto;
  }

  .profiles-panel-sheet-icon {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    color: #fff;
    background: linear-gradient(145deg, #b91c1c, #991b1b 50%, #a16207);
  }

  .profiles-panel-sheet-title {
    font-size: 1.02rem;
    font-weight: 700;
    color: var(--pr-text, #3f0f19);
    letter-spacing: -0.02em;
  }

  .profiles-sheet-count-badge {
    flex: 0 0 auto;
  }

  .profiles-panel-sheet-close {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    border: 1px solid rgba(231, 201, 120, 0.45) !important;
    background: #fff !important;
    color: var(--pr-text, #3f0f19) !important;
    display: grid;
    place-items: center;
    cursor: pointer;
    box-shadow: none !important;
    filter: none !important;
    transition: background 0.14s ease, border-color 0.14s ease;
  }

  .profiles-panel-sheet-close:hover {
    background: rgba(254, 242, 242, 0.85) !important;
    color: var(--pr-accent, #b91c1c) !important;
    filter: none !important;
    box-shadow: none !important;
  }

  /* Scrollable body — grows with expanded workspace list */
  .profiles-panel-sheet-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    padding: 0.55rem 1rem 0.65rem;
  }

  .profiles-sheet-panels {
    display: flex;
    flex-direction: column;
    flex: 0 0 auto;
    min-height: 0;
    overflow: visible;
  }

  .profiles-sheet-panel {
    display: flex;
    flex-direction: column;
    flex: 0 0 auto;
    min-height: 0;
    overflow: visible;
  }

  .profiles-sheet-panel[hidden] {
    display: none !important;
  }

  .profiles-sheet-panel--browse .profiles-list-section {
    flex: 0 0 auto;
    min-height: 0;
    overflow: visible;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
  }

  .profiles-sheet-panel--browse .profiles-select--modern {
    flex: 0 0 auto;
  }

  .profiles-sheet-panel--browse .profiles-select__shell--open {
    flex: 0 0 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    max-height: min(72dvh, calc(8.5rem + var(--profiles-select-list-max-height)));
  }

  .profiles-sheet-panel--browse .profiles-select__field {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .profiles-sheet-panel--browse .profiles-select__panel {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
  }

  .profiles-sheet-panel--browse .profiles-select__list-scroll {
    flex: 1 1 auto;
    min-height: 0;
    max-height: var(--profiles-select-list-max-height) !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }

  .profiles-sheet-panel--browse .profiles-list-toolbar {
    display: none;
  }

  .profiles-sheet-panel--browse .profiles-count-badge {
    display: none;
  }

  .profiles-sheet-panel--create {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.5rem;
  }

  .profiles-sheet-panel--create .profiles-create-panel {
    border: none;
    background: transparent;
    overflow: visible;
  }

  .profiles-sheet-panel--create .profiles-create-summary {
    display: none;
  }

  .profiles-sheet-panel--create .profiles-create-form {
    padding: 0 0 0.25rem;
  }

  .profiles-sheet-panel--create .profiles-create-grid {
    min-width: 0;
  }

  .profiles-sheet-panel--create .profiles-create-submit {
    position: sticky;
    bottom: 0;
    margin-top: 0.75rem;
    z-index: 2;
    background: linear-gradient(135deg, #b91c1c, #991b1b) !important;
  }

  /* Inside the sheet: profile header already shown in sheet-header, hide duplicate */
  .profiles-panel-sheet .profiles-panel-header {
    display: none !important;
  }

  .profiles-panel-sheet .profiles-card--compact .profiles-card-avatar {
    width: 36px !important;
    height: 36px !important;
    font-size: 0.74rem !important;
    border-radius: 10px !important;
  }

  .profiles-panel-sheet .profiles-card-actions--footer .profile-action-chip svg,
  .profiles-panel-sheet .profiles-card-actions--footer .profile-icon-btn svg {
    width: 16px !important;
    height: 16px !important;
  }
}

@media (min-width: 1401px) {
  /* On desktop the section renders the sheet inline as normal content */
  .profiles-panel-sheet {
    display: contents !important;
  }

  .profiles-panel-sheet-handle,
  .profiles-panel-sheet-header,
  .profiles-sheet-backdrop,
  .profiles-sheet-tabs {
    display: none !important;
  }

  .profiles-panel-sheet-body {
    display: contents !important;
  }

  .profiles-sheet-panels {
    display: contents !important;
  }

  .profiles-sheet-panel {
    display: contents !important;
  }

  .profiles-sheet-panel[hidden] {
    display: contents !important;
  }

  .profiles-panel--v2 .profiles-panel-header {
    display: flex;
  }

  .profiles-panel--v2 .profiles-create-panel {
    order: -1;
  }
}

@media (max-width: 640px) {
  .profiles-panel-sheet-body {
    padding: 0.5rem 0.85rem 0.55rem !important;
  }

  .profiles-panel--v2 .profiles-create-summary-hint {
    display: none;
  }
}/* Shrink-wrap profile panel — no dead space below list (wins over main.css v3/v4) */
.profiles-panel.card.profiles-panel--modern.profiles-panel--v2,
section.profiles-panel.profiles-panel--v2 {
  height: auto !important;
  max-height: none !important;
  align-self: start !important;
  flex: 0 0 auto !important;
}.profiles-panel--v2 .profiles-list-section {
  flex: 0 0 auto !important;
  height: auto !important;
}.profiles-panel.card.profiles-panel--modern.profiles-panel--v2 .profiles-list,
section.profiles-panel--v2 .profiles-list {
  flex: 0 0 auto !important;
  height: auto !important;
  min-height: 0 !important;
  margin-top: 0 !important;
}/* ══ Compact bottom sheet (portaled to <html>) ══════════════ */
@media (max-width: 1400px) {
  .profiles-panel-sheet.profiles-panel--v2 {
    font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    color: #3f0f19;
  }

  .profiles-panel-sheet .profiles-panel-sheet-title {
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    text-transform: none;
  }

  .profiles-panel-sheet .profiles-sheet-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.35rem;
    height: 1.35rem;
    padding: 0 0.38rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    background: rgba(254, 226, 226, 0.9);
    color: #9f1239;
    border: 1px solid rgba(185, 28, 28, 0.12);
  }

  .profiles-panel-sheet .profiles-panel-sheet-close {
    background: rgba(255, 255, 255, 0.92) !important;
    color: #78716c !important;
    border: 1px solid rgba(212, 175, 55, 0.35) !important;
    box-shadow: none !important;
    filter: none !important;
    transform: none !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    min-height: 36px !important;
    min-width: 36px !important;
    padding: 0 !important;
  }

  .profiles-panel-sheet .profiles-panel-sheet-close:hover {
    background: #fff !important;
    color: #b91c1c !important;
    border-color: rgba(185, 28, 28, 0.28) !important;
    transform: none !important;
    box-shadow: none !important;
  }

  .profiles-panel-sheet .profiles-sheet-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.28rem;
    margin: 0 0.85rem 0.55rem;
    padding: 0.22rem;
    border-radius: 12px;
    background: rgba(254, 243, 199, 0.42);
    border: 1px solid rgba(212, 175, 55, 0.38);
  }

  .profiles-panel-sheet .profiles-sheet-tab {
    min-height: 42px;
    padding: 0.45rem 0.55rem;
    border-radius: 10px;
    font-family: inherit !important;
    font-size: 0.82rem !important;
    font-weight: 600 !important;
    letter-spacing: normal !important;
    text-transform: none !important;
    background: transparent !important;
    color: rgba(122, 75, 18, 0.85) !important;
    box-shadow: none !important;
    filter: none !important;
    transform: none !important;
  }

  .profiles-panel-sheet .profiles-sheet-tab--active {
    background: #fff !important;
    color: #b91c1c !important;
    box-shadow: 0 1px 4px rgba(63, 15, 25, 0.08) !important;
  }

  .profiles-panel-sheet .profiles-select__shell {
    border-radius: 14px;
    box-shadow: 0 2px 10px rgba(63, 15, 25, 0.06);
  }

  .profiles-panel-sheet .profiles-select__trigger,
  .profiles-panel-sheet .profiles-select__trigger:hover,
  .profiles-panel-sheet .profiles-select__trigger:active,
  .profiles-panel-sheet .profiles-select__trigger:focus,
  .profiles-panel-sheet .profiles-select__trigger:focus-visible {
    background: transparent !important;
    color: #3f0f19 !important;
    border: none !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    font-weight: inherit !important;
    min-height: 0 !important;
    padding: 0.68rem 0.7rem !important;
    box-shadow: none !important;
    filter: none !important;
    transform: none !important;
  }

  .profiles-panel-sheet .profiles-select__trigger:hover:not(:disabled) {
    background: rgba(255, 253, 248, 0.85) !important;
  }

  .profiles-panel-sheet .profiles-select__option,
  .profiles-panel-sheet .profiles-select__option:hover,
  .profiles-panel-sheet .profiles-select__option:active,
  .profiles-panel-sheet .profiles-select__option:focus,
  .profiles-panel-sheet .profiles-select__option:focus-visible {
    background: transparent !important;
    color: #3f0f19 !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    min-height: 0 !important;
    box-shadow: none !important;
    filter: none !important;
    transform: none !important;
  }

  .profiles-panel-sheet .profiles-select__actions {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.38rem;
    padding: 0.5rem 0.55rem 0.55rem;
    border-top: 1px solid rgba(231, 201, 120, 0.35);
    background: rgba(255, 253, 248, 0.65);
  }

  .profiles-panel-sheet .profiles-select__shell--open .profiles-select__actions {
    display: none !important;
  }

  .profiles-panel-sheet .profiles-select__actions .profile-action-wrap {
    display: flex;
    min-width: 0;
  }

  .profiles-panel-sheet .profiles-select__actions .profile-action-chip,
  .profiles-panel-sheet .profiles-select__actions .profile-icon-btn {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 42px !important;
    height: auto !important;
    padding: 0.45rem 0.5rem !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.35rem !important;
    border-radius: 10px !important;
    font-family: inherit !important;
    font-size: 0.72rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.01em !important;
    text-transform: none !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04) !important;
    transform: none !important;
    filter: none !important;
  }

  .profiles-panel-sheet .profiles-select__actions .profile-action-chip svg,
  .profiles-panel-sheet .profiles-select__actions .profile-icon-btn svg {
    width: 16px !important;
    height: 16px !important;
    padding: 0 !important;
    border: none !important;
    background: none !important;
    box-shadow: none !important;
    display: block !important;
  }

  .profiles-panel-sheet .profiles-select__actions .profile-action-label,
  .profiles-panel-sheet .profiles-select__actions .profile-action-label--visible {
    position: static !important;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    overflow: visible !important;
    clip: auto !important;
    font-size: 0.66rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.01em !important;
    text-transform: none !important;
    line-height: 1.15 !important;
  }

  .profiles-panel-sheet .profiles-select__actions .profile-action-chip--view {
    color: #4338ca !important;
    background: #eef2ff !important;
    border: 1px solid rgba(99, 102, 241, 0.28) !important;
  }

  .profiles-panel-sheet .profiles-select__actions .profile-action-chip--edit {
    color: #b45309 !important;
    background: #fffbeb !important;
    border: 1px solid rgba(245, 158, 11, 0.35) !important;
  }

  .profiles-panel-sheet .profiles-select__actions .profile-action-chip--danger {
    color: #b91c1c !important;
    background: #fef2f2 !important;
    border: 1px solid rgba(239, 68, 68, 0.32) !important;
  }

  .profiles-panel-sheet .profiles-select__search {
    margin: 0.5rem 0.6rem 0.35rem;
  }

  .profiles-panel-sheet .profiles-select__list-scroll {
    flex: 1 1 auto;
    min-height: 0;
    max-height: var(--profiles-select-list-max-height);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }

  .profiles-panel-sheet .profiles-select__shell--open .profiles-select__panel {
    display: flex;
  }

  .profiles-panel-sheet .profiles-create-submit,
  .profiles-panel-sheet .profile-add-btn.profiles-create-submit {
    min-height: 46px !important;
    text-transform: none !important;
    letter-spacing: normal !important;
  }

  .profiles-panel-sheet-body {
    padding-bottom: max(0.65rem, env(safe-area-inset-bottom, 0px));
  }
}

@media (max-width: 380px) {
  .profiles-panel-sheet .profiles-select__actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.28rem;
    padding: 0.45rem 0.45rem 0.5rem;
  }

  .profiles-panel-sheet .profiles-select__actions .profile-action-chip,
  .profiles-panel-sheet .profiles-select__actions .profile-icon-btn {
    min-height: 44px !important;
    padding: 0.38rem 0.25rem !important;
  }

  .profiles-panel-sheet .profiles-select__actions .profile-action-label--visible {
    font-size: 0.62rem !important;
  }
}/* ── Sheet browse mode: pinned dropdown,
no redundant chrome ─ */
.profiles-select__trigger-kicker {
  display: none;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(161, 98, 7, 0.85);
  line-height: 1.2;
}.profiles-select__panel-label {
  display: none;
  margin: 0;
  padding: 0.55rem 0.6rem 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(122, 75, 18, 0.72);
}

@media (max-width: 1400px) {
  .profiles-select--sheet-browse .profiles-select__shell {
    border-color: rgba(212, 175, 55, 0.42);
    box-shadow: 0 2px 12px rgba(63, 15, 25, 0.07);
  }

  .profiles-select--sheet-browse .profiles-select__shell--open {
    box-shadow: 0 2px 14px rgba(63, 15, 25, 0.08);
  }

  .profiles-select--sheet-browse .profiles-select__trigger-kicker {
    display: block;
  }

  .profiles-select--sheet-browse .profiles-select__panel-label {
    display: block;
  }

  .profiles-select--sheet-browse .profiles-select__trigger--pinned {
    cursor: default;
    padding-bottom: 0.55rem !important;
  }

  .profiles-select--sheet-browse .profiles-select__trigger--pinned:hover:not(:disabled) {
    background: transparent !important;
  }

  .profiles-select--sheet-browse .profiles-select__trigger-chevron {
    display: none;
  }

  .profiles-select--sheet-browse .profiles-select__count {
    display: none !important;
  }

  .profiles-select--sheet-browse .profiles-select__field--open .profiles-select__trigger {
    border-bottom: none !important;
    background: rgba(255, 253, 248, 0.5) !important;
  }

  .profiles-select--sheet-browse .profiles-select__field {
    min-height: 0;
    max-height: min(
      72dvh,
      calc(8.5rem + var(--profiles-select-list-max-height))
    );
    overflow: hidden;
  }

  .profiles-select--sheet-browse .profiles-select__panel {
    display: flex !important;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
  }

  .profiles-select--sheet-browse .profiles-select__list-scroll {
    flex: 1 1 auto;
    min-height: 0;
    max-height: var(--profiles-select-list-max-height) !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }

  .profiles-select--sheet-browse .profiles-select__search {
    margin-top: 0;
  }

  .profiles-select--sheet-browse .profiles-select__hint {
    margin: 0 0.6rem 0.3rem;
    font-size: 0.68rem;
  }

  .profiles-select--sheet-browse .profiles-select__shell--open .profiles-select__actions {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.32rem;
    padding: 0.45rem 0.55rem 0.5rem;
    margin-top: 0;
    border-top: 1px solid rgba(231, 201, 120, 0.32);
    background: rgba(255, 253, 248, 0.45);
  }

  .profiles-select--sheet-browse .profiles-select__actions .profile-action-chip,
  .profiles-select--sheet-browse .profiles-select__actions .profile-icon-btn {
    min-height: 36px !important;
    padding: 0.32rem 0.25rem !important;
    flex-direction: row !important;
    gap: 0.28rem !important;
    border-radius: 9px !important;
  }

  .profiles-select--sheet-browse .profiles-select__actions .profile-action-label--visible {
    font-size: 0.64rem !important;
  }

  .profiles-sheet-body--tab-browse .profiles-list-section {
    gap: 0.35rem;
  }
}
