/* Caixa de perfil pintada por public/index.html e controlada por
   features/profile-panel.js. Sessão, tema persistido e transporte continuam
   no núcleo e não influenciam esta fronteira visual. */

/* Esta quebra vinha antes da regra base no antigo design.css. Por isso,
   align-items: stretch era anulado por align-items: center, enquanto a coluna
   e a largura do botão sobreviviam. A ordem é deliberada para conservar o
   comportamento existente. */
@media (max-width: 620px) {
  .profilePreferenceRow { align-items: stretch; flex-direction: column; }
  .profilePreferenceRow button { width: 100%; }
}

.accessDrawer {
  width: min(430px, 100%);
  max-width: 430px;
}

.accessKeyCard {
  display: grid;
  gap: 22px;
}

.profileDrawerHead {
  justify-content: space-between;
  padding-inline: 22px !important;
}

.profileDrawerHead .dialogTitle > b {
  font-size: var(--txt-lg);
}

.profileClose {
  width: 34px;
  height: 34px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  background: transparent;
  color: var(--muted);
  font-size: var(--txt-xl);
  line-height: 1;
  cursor: pointer;
}

.profileClose:hover {
  border-color: var(--line);
  background: var(--panel);
  color: var(--ink);
}

.drawer:not(.detailDrawer) .profileDrawerBody {
  padding: 24px 22px;
}

.profileIdentity {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.accessKeyIcon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: var(--r-lg);
  background: color-mix(in srgb, var(--accent) 12%, var(--panel));
  color: var(--accent);
  font-size: var(--txt-md);
  font-weight: 800;
}

.accessKeyCard h2 {
  margin: 3px 0 2px;
  display: -webkit-box;
  overflow: hidden;
  font-size: var(--txt-xl);
  line-height: 1.25;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.accessKeyCard p {
  margin: 0;
  line-height: 1.45;
}

.accessKeyForm {
  display: grid;
  gap: 15px;
}

.profilePreferenceRow {
  min-height: 58px;
  padding: 10px 11px 10px 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--panel);
}

.profilePreferenceRow > span { min-width: 0; }
.profilePreferenceRow b,
.profilePreferenceRow small { display: block; }
.profilePreferenceRow b { font-size: var(--txt-sm); }
.profilePreferenceRow small { margin-top: 2px; color: var(--muted); font-size: var(--txt-xs); }
.profilePreferenceRow button { flex: none; }

.profilePasswordPanel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--panel);
}

.profilePasswordPanel summary {
  min-height: 58px;
  padding: 10px 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  list-style: none;
  cursor: pointer;
}

.profilePasswordPanel summary::-webkit-details-marker {
  display: none;
}

.profilePasswordPanel summary:hover {
  background: color-mix(in srgb, var(--accent) 4%, var(--panel));
}

.profilePasswordPanel summary:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 72%, transparent);
  outline-offset: -3px;
}

.profilePasswordPanel summary b,
.profilePasswordPanel summary small {
  display: block;
}

.profilePasswordPanel summary b {
  font-size: var(--txt-sm);
}

.profilePasswordPanel summary small {
  margin-top: 2px;
  color: var(--muted);
  font-size: var(--txt-xs);
}

.profilePasswordChevron {
  color: var(--muted);
  font-size: var(--txt-lg);
  transition: transform .16s ease;
}

.profilePasswordPanel[open] .profilePasswordChevron {
  transform: rotate(180deg);
}

.profilePasswordFields {
  padding: 13px;
  display: grid;
  gap: 12px;
  border-top: 1px solid var(--line);
  background: var(--bg);
}

.keyStatus {
  min-height: 0;
  color: var(--muted);
  font-size: var(--txt-xs);
  line-height: 1.45;
}

.keyStatus.saved {
  color: var(--ok);
}

.keyActions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.keyActions .small {
  min-height: 39px;
}

#btnRemoverKey {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

#btnRemoverKey:hover {
  border-color: color-mix(in srgb, var(--vermelho) 28%, var(--line));
  background: color-mix(in srgb, var(--vermelho) 6%, var(--panel));
  color: var(--vermelho);
}

@media (max-width: 620px) {
  .profileClose {
    width: 44px;
    height: 44px;
    min-height: 44px;
  }
}

@media (max-width: 380px) {
  .keyActions {
    grid-template-columns: 1fr;
  }

  #btnRemoverKey {
    justify-self: start;
  }
}
