.account-shell {
  --account-border: color-mix(in srgb, var(--line) 70%, var(--bg));
  --account-surface: color-mix(in srgb, var(--surface) 78%, var(--bg));
  --account-good: #8dd8b4;
  --account-warn: #edbc83;
  min-height: 68vh;
  max-width: 1184px;
  padding-block: clamp(30px, 6vw, 68px);
}

[data-theme="light"] .account-shell {
  --account-surface: var(--surface);
  --account-good: #176749;
  --account-warn: #86521d;
}

.account-shell [hidden] { display: none !important; }
.account-shell :is(h1, h2, p, dl, dd) { margin: 0; }
.account-shell h1 { font-size: clamp(29px, 4vw, 38px); font-weight: 680; line-height: 1.2; letter-spacing: -.045em; }
.account-shell h2 { font-size: 17px; font-weight: 650; line-height: 1.4; letter-spacing: -.018em; }
.account-shell p { font-size: 14px; color: var(--muted); }
.account-shell .button { min-height: 38px; padding: 8px 13px; white-space: normal; font-size: 13px; gap: 7px; }
.account-shell :is(a, button, summary, input):focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }

.account-guest {
  display: grid;
  justify-items: start;
  gap: 14px;
  max-width: 430px;
  margin: 3vh auto;
  padding: clamp(24px, 6vw, 40px);
  border: 1px solid var(--account-border);
  border-radius: 12px;
  background: var(--account-surface);
}
.account-guest .button { width: 100%; margin-top: 7px; }
.account-back-link { font-size: 13px; color: var(--muted); }
.account-back-link:hover { text-decoration: underline; }

.account-dashboard {
  display: grid;
  grid-template-columns: 196px minmax(0, 1fr);
  align-items: start;
  gap: clamp(24px, 5vw, 65px);
}
.account-sidebar { position: sticky; top: 92px; }
.account-sidebar-title { padding: 0 10px 12px; font-size: 14px; font-weight: 670; }
.account-sidebar nav { display: grid; gap: 4px; }
.account-sidebar nav a, .account-signout {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 7px;
  padding: 9px 10px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 550;
  line-height: 1.4;
}
.account-sidebar nav a:hover { background: var(--account-surface); color: var(--text); }
.account-sidebar nav a[aria-current] { background: var(--tint); color: var(--blue); }
.account-signout {
  width: 100%;
  margin-top: 16px;
  border: 0;
  border-top: 1px solid var(--account-border);
  border-radius: 0;
  background: transparent;
  text-align: left;
  padding-top: 14px;
}
.account-signout:hover, .account-unlink:hover { color: var(--text); }

.account-view { display: grid; gap: 16px; }
.account-view > h1 { margin-bottom: 7px; }
.account-panel {
  padding: clamp(16px, 3vw, 25px);
  background: var(--account-surface);
  border: 1px solid var(--account-border);
  border-radius: 10px;
  min-width: 0;
}
.account-identity, .account-settings, .account-section-head, .account-bot-identity {
  display: flex;
  align-items: center;
  gap: 15px;
  min-width: 0;
}
.account-identity > img, .account-bot-identity > img { border: 1px solid var(--account-border); border-radius: 10px; object-fit: cover; }
.account-identity h2 { font-size: 20px; overflow-wrap: anywhere; }
#account-email { font-size: 13px; min-width: 0; overflow-wrap: anywhere; }
.account-email-control { display: flex; align-items: center; gap: 6px; }
#account-email-toggle {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 30px;
  height: 30px;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 5px;
}
#account-email-toggle:hover { color: var(--text); background: var(--hover); }
#account-email-toggle svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; }
#account-email-toggle[aria-label="Ocultar e-mail"] .account-eye-slash { display: none; }
.account-provider {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}
.account-overview { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.account-summary { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 9px; }
.account-summary span:first-child { grid-column: 1 / -1; color: var(--muted); font-size: 13px; }
.account-summary strong { font-size: 17px; font-weight: 640; overflow-wrap: anywhere; }
.account-summary span:last-child { color: var(--blue); }
.account-summary:hover { border-color: var(--tint-line); }
.account-settings { justify-content: space-between; }
.account-settings p { margin-top: 4px; }
.account-settings a { flex-shrink: 0; }

.account-feedback:empty { display: none; }
.account-content > .account-feedback { margin-bottom: 12px; }
.account-section-head { justify-content: space-between; }
.account-description:not(:empty) { margin-top: 7px; }
.account-state { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.account-state::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.account-state[data-state="active"], .account-state[data-state="online"] { color: var(--account-good); }
.account-state[data-state="expired"], .account-state[data-state="suspenso"] { color: var(--account-warn); }
.account-shell .account-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-block: 19px;
  padding-block: 14px;
  border-top: 1px solid var(--account-border);
  border-bottom: 1px solid var(--account-border);
}
.account-shell .account-metrics-bot { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.account-metrics dt { color: var(--muted); font-size: 12px; }
.account-metrics dd { font-size: 14px; font-weight: 630; margin-top: 2px; }
.account-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.account-bot > .account-feedback { margin-bottom: 14px; }
#bot-plan-link { margin-top: 13px; }
.account-bot-banner { display: block; width: 100%; height: clamp(82px, 18vw, 165px); object-fit: cover; border-radius: 7px; margin-bottom: 14px; }
.account-bot-identity #bot-name { overflow-wrap: anywhere; }
.account-bot-identity .account-state { margin-left: auto; flex-shrink: 0; }

.account-form { display: grid; gap: 8px; max-width: 480px; margin-top: 16px; }
.account-form label { font-size: 13px; font-weight: 600; }
.account-form input {
  width: 100%;
  min-width: 0;
  margin-bottom: 5px;
  padding: 8px 10px;
  border: 1px solid var(--account-border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 13px;
}
.account-form p { font-size: 12px; }
.account-form .button { justify-self: start; margin-top: 4px; }
.account-editor { margin-top: 17px; border-top: 1px solid var(--account-border); padding-top: 14px; }
.account-editor summary { cursor: pointer; font-size: 14px; font-weight: 600; }
.account-bot-footer { margin-top: 17px; border-top: 1px solid var(--account-border); padding-top: 12px; }
.account-unlink { padding: 0; border: 0; background: transparent; color: var(--account-warn); font-size: 13px; }

@media (max-width: 720px) {
  .account-dashboard { grid-template-columns: 1fr; gap: 22px; }
  .account-sidebar { position: static; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 7px 10px; border-bottom: 1px solid var(--account-border); padding-bottom: 11px; }
  .account-sidebar-title { padding: 0; }
  .account-sidebar nav { display: flex; flex-wrap: wrap; order: 2; width: 100%; }
  .account-signout { width: auto; margin: 0; padding: 3px 0; border: 0; }
}
@media (max-width: 430px) {
  .account-shell { width: calc(100% - 32px); }
  .account-settings { align-items: flex-start; flex-direction: column; }
  .account-identity { flex-wrap: wrap; }
  .account-provider { margin-left: 0; }
  .account-shell .account-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
