:root {
  --ink: #f7f1ff;
  --black: #151515;
  --black-2: #202020;
  --muted: #b9b4c0;
  --line: rgba(247, 241, 255, 0.2);
  --yellow: #fbff68;
  --lavender: #d9b8ff;
  --orange: #f36b45;
  --white: #fffdf8;
  --bad: #ff8585;
  --warn: #fbff68;
  --good: #9ef7c5;
  --shadow: 0 26px 80px rgba(0, 0, 0, 0.36);
  color-scheme: dark;
  font-family: "Arial Rounded MT Bold", "Avenir Next", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 82% 10%, rgba(217, 184, 255, 0.16), transparent 28%),
    radial-gradient(circle at 10% 8%, rgba(251, 255, 104, 0.12), transparent 26%),
    linear-gradient(180deg, #161616 0%, #101010 100%);
}

html,
body {
  width: 100%;
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
a.pill:focus-visible {
  outline: 2px solid var(--yellow);
  outline-offset: 2px;
}

.shell {
  width: 100%;
  max-width: 1260px;
  margin: 0 auto;
  padding: 22px 28px 34px;
}

.topbar {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "brand switcher"
    "brand status";
  gap: 10px 18px;
  align-items: center;
}

.brand {
  grid-area: brand;
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  flex: 0 0 auto;
  border-radius: 22px;
  background:
    radial-gradient(circle at 38% 26%, rgba(251, 255, 104, 0.4), transparent 46%),
    var(--lavender);
  overflow: hidden;
}

.brand-mark img {
  width: 88%;
  height: 88%;
  object-fit: contain;
  transform: translateY(3px);
}

.brand-name {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.profile-switcher {
  grid-area: switcher;
  justify-self: end;
}

.status-strip {
  grid-area: status;
  justify-self: end;
}

.topbar > *,
.workspace > *,
.panel,
.profile-switcher,
.status-strip,
.rail {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--yellow);
  font-size: 0.78rem;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 2.5rem;
  line-height: 0.9;
  letter-spacing: -0.02em;
  text-transform: lowercase;
}

h2 {
  margin-bottom: 0;
  color: var(--white);
  font-size: 2rem;
  letter-spacing: 0;
  line-height: 0.94;
}

h3 {
  margin-bottom: 8px;
  color: var(--white);
  font-size: 1.6rem;
  letter-spacing: 0;
  line-height: 0.96;
}

.profile-switcher {
  display: inline-flex;
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(32, 32, 32, 0.86);
  box-shadow: var(--shadow);
}

.profile-chip {
  min-height: 36px;
  padding: 0 18px;
  border: 0;
  border-radius: 12px;
  color: var(--ink);
  background: transparent;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  transition: background 160ms ease, color 160ms ease;
}

.profile-chip:hover {
  background: rgba(247, 241, 255, 0.08);
}

.profile-chip.active {
  color: var(--black);
  background: var(--yellow);
}

.profile-chip.add {
  padding: 0 14px;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1;
}

.profile-chip.add:hover {
  color: var(--ink);
}

/* Gerenciador de perfil (criar / renomear / apagar) — inline, sem modal */
.profile-manager {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(32, 32, 32, 0.86);
  box-shadow: var(--shadow);
}

.manager-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.manager-name {
  flex: 1 1 220px;
  min-width: 0;
}

.manager-kind {
  padding: 0 14px;
  color: var(--lavender);
  font-size: 0.78rem;
  font-weight: 950;
  text-transform: uppercase;
}

.kind-seg {
  display: inline-flex;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #111;
}

.kind-seg button {
  min-height: 38px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  font-weight: 950;
  transition: background 160ms ease, color 160ms ease;
}

.kind-seg button.active {
  color: var(--black);
  background: var(--lavender);
}

/* Onboarding de primeiro uso */
body.onboarding .topbar,
body.onboarding .profile-manager,
body.onboarding .workspace {
  display: none;
}

.onboarding-screen {
  display: none;
  place-items: center;
  min-height: min(82vh, 760px);
  padding: 24px 8px;
}

body.onboarding .onboarding-screen {
  display: grid;
}

.onboarding-card {
  display: grid;
  justify-items: center;
  gap: 16px;
  width: 100%;
  max-width: 440px;
  padding: 36px 28px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(32, 32, 32, 0.94);
  box-shadow: var(--shadow);
  text-align: center;
}

.onboarding-card h1 {
  margin: 0;
  font-size: 2.6rem;
  line-height: 0.9;
}

.onboarding-card p {
  margin: 0;
  max-width: 34ch;
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.5;
}

.onboarding-card .brand-mark {
  width: 92px;
  height: 92px;
}

.onboarding-card #ob-name {
  text-align: center;
}

.onboarding-card .primary-button {
  width: 100%;
}

.status-strip {
  display: inline-flex;
  gap: 8px;
}

.status-strip span {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(32, 32, 32, 0.86);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.status-strip strong {
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 950;
}

.status-strip span:nth-child(1) strong {
  color: var(--lavender);
}

.status-strip span:nth-child(2) strong {
  color: var(--orange);
}

.status-strip span:nth-child(3) strong {
  color: var(--yellow);
}

.workspace {
  display: grid;
  grid-template-columns: 214px minmax(0, 1fr);
  gap: 16px;
  margin-top: 18px;
}

.rail {
  position: sticky;
  top: 28px;
  display: grid;
  gap: 10px;
  align-self: start;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: rgba(32, 32, 32, 0.92);
  box-shadow: var(--shadow);
}

.nav-button {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 50px;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  text-align: left;
  font-weight: 950;
}

.nav-button span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--white);
  color: var(--black);
  font-size: 0.78rem;
}

.nav-button.active {
  border-color: rgba(251, 255, 104, 0.5);
  color: var(--black);
  background: var(--yellow);
}

.panel {
  display: none;
  min-height: 460px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(32, 32, 32, 0.94);
  box-shadow: var(--shadow);
}

.panel.active {
  display: block;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.primary-button,
.ghost-button,
.danger-button {
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  font-weight: 950;
}

.primary-button {
  border: 1px solid rgba(251, 255, 104, 0.6);
  color: var(--black);
  background: var(--yellow);
}

.ghost-button {
  border: 1px solid var(--line);
  color: var(--white);
  background: rgba(255, 253, 248, 0.08);
}

.danger-button {
  border: 1px solid rgba(255, 133, 133, 0.36);
  color: var(--black);
  background: var(--orange);
}

.primary-button:disabled,
.ghost-button:disabled,
.danger-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

label {
  display: grid;
  gap: 7px;
  color: var(--lavender);
  font-size: 0.8rem;
  font-weight: 950;
  text-transform: uppercase;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 12px 16px;
  color: var(--white);
  background: #111;
  outline: none;
}

textarea {
  border-radius: 24px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  border-color: var(--yellow);
  box-shadow: 0 0 0 3px rgba(251, 255, 104, 0.14);
}

input::placeholder,
textarea::placeholder {
  color: rgba(247, 241, 255, 0.5); /* 5.3:1 sobre o inset #111 (WCAG AA) */
}

.measurement-grid,
.item-form,
.candidate-layout {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.item-form {
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.wide {
  grid-column: span 2;
}

.full {
  grid-column: 1 / -1;
}

/* Disclosure progressivo: grupos de campos secundários colapsáveis */
.field-group {
  grid-column: 1 / -1;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(17, 17, 17, 0.45);
  overflow: hidden;
}

.field-group + .field-group {
  margin-top: -2px;
}

.field-group > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  padding: 0 18px;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.field-group > summary::-webkit-details-marker {
  display: none;
}

.field-group > summary::before {
  content: "+";
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--black-2);
  color: var(--yellow);
  font-size: 1rem;
  line-height: 1;
}

.field-group[open] > summary::before {
  content: "−";
}

.field-group > summary:hover {
  color: var(--yellow);
}

.field-group .sub-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 2px 18px 18px;
}

/* Toast de confirmação — fecha o loop de feedback das ações que salvam */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: calc(100% - 32px);
  padding: 12px 20px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(32, 32, 32, 0.96);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 900;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(10px);
  transition: opacity 200ms ease, transform 240ms cubic-bezier(0.22, 1, 0.36, 1);
}

.toast::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--good);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .toast {
    transform: translateX(-50%);
    transition: opacity 120ms linear;
  }
  .toast.show {
    transform: translateX(-50%);
  }
}

.profile-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(256px, 0.9fr);
  gap: 22px;
  align-items: start;
}

.profile-layout .measurement-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
}

.profile-insights {
  position: sticky;
  top: 28px;
  display: grid;
  gap: 20px;
  align-content: start;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #111;
}

.meter-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.meter-head .eyebrow {
  margin: 0;
}

.meter-count {
  color: var(--ink);
  font-size: 1.5rem;
  font-weight: 950;
  line-height: 1;
}

.meter-count i {
  color: var(--muted);
  font-style: normal;
  font-size: 0.95rem;
}

.meter {
  height: 10px;
  border-radius: 999px;
  background: rgba(247, 241, 255, 0.12);
  border: 1px solid var(--line);
  overflow: hidden;
}

.meter span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--lavender), var(--yellow));
  transition: width 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

.meter-block .note {
  margin: 10px 0 0;
}

.decidable {
  display: grid;
  gap: 10px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.decidable .eyebrow {
  margin: 0;
}

.ready-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ready-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 10px;
  background: var(--yellow);
  color: var(--black);
  font-size: 0.78rem;
  font-weight: 900;
}

.unlock-hint {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.insight-cta {
  display: grid;
  gap: 12px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.insight-cta .note {
  margin: 0;
}

.insight-cta .primary-button {
  width: 100%;
}

.insight-cta .primary-button:disabled {
  border-color: var(--line);
  color: var(--muted);
  background: rgba(247, 241, 255, 0.06);
  cursor: not-allowed;
}

@media (prefers-reduced-motion: reduce) {
  .meter span,
  .profile-chip {
    transition: none;
  }
}

.extract-status {
  min-height: 42px;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 22px;
  color: var(--black);
  background: var(--lavender);
  font-size: 0.86rem;
  font-weight: 850;
  line-height: 1.35;
}

.extract-status.working {
  color: var(--black);
  border-color: rgba(251, 255, 104, 0.56);
  background: var(--yellow);
}

.extract-status.error {
  color: var(--black);
  border-color: rgba(243, 107, 69, 0.7);
  background: var(--orange);
}

.extract-status.success {
  color: var(--black);
  border-color: rgba(158, 247, 197, 0.6);
  background: var(--good);
}

.extract-status.warn {
  color: var(--black);
  border-color: rgba(251, 255, 104, 0.56);
  background: var(--yellow);
}

.extract-levels {
  display: flex;
  gap: 6px;
  margin-bottom: 9px;
}

.lvl {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border: 1px solid rgba(21, 21, 21, 0.18);
  border-radius: 999px;
  background: rgba(21, 21, 21, 0.1);
  color: rgba(21, 21, 21, 0.5);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.lvl.on {
  border-color: var(--black);
  background: var(--black);
  color: var(--white);
}

.extract-line {
  margin: 0;
}

.extract-found {
  margin: 8px 0 0;
  font-size: 0.8rem;
  opacity: 0.82;
}

.list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.empty-state {
  display: grid;
  min-height: 180px;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 28px;
  color: var(--black);
  background: var(--lavender);
  text-align: center;
  font-weight: 850;
}

.empty-state.slim {
  min-height: 104px;
}

.item-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--lavender);
  color: var(--black);
}

.item-row.compact {
  padding: 14px;
  border-radius: 22px;
  background: var(--white);
}

.item-row h4 {
  margin: 0 0 5px;
  color: var(--black);
  font-size: 1.15rem;
  font-weight: 950;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0;
  color: var(--black);
  font-size: 0.83rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border: 1px solid rgba(21, 21, 21, 0.22);
  border-radius: 999px;
  color: var(--black);
  background: rgba(255, 253, 248, 0.7);
  font-weight: 850;
}

.learning-board {
  display: grid;
  gap: 14px;
}

.learning-hero {
  display: grid;
  gap: 14px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(32, 32, 32, 0.6);
}

.hero-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.hero-head .eyebrow {
  margin: 0;
}

.learning-hero .meter-count {
  font-size: 2.4rem;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
}

.hero-stats span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.hero-stats b {
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 950;
}

.hero-stats .hs-good b {
  color: var(--good);
}

.hero-stats .hs-warn b {
  color: var(--warn);
}

.hero-stats .hs-bad b {
  color: var(--bad);
}

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

.insight-grid article {
  min-height: 96px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 24px;
  color: var(--black);
  background: var(--yellow);
}

.insight-grid article:nth-child(2) {
  background: var(--lavender);
}

.insight-grid article:nth-child(3) {
  background: var(--orange);
}

.insight-grid article:nth-child(4) {
  background: var(--white);
}

.insight-grid strong {
  display: block;
  font-size: 2rem;
  line-height: 1;
}

.insight-grid span {
  display: block;
  margin-top: 7px;
  font-size: 0.76rem;
  font-weight: 950;
  text-transform: uppercase;
}

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

.memory-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 26px;
  color: var(--black);
  background: var(--lavender);
}

.memory-card:nth-child(2n) {
  background: var(--yellow);
}

.memory-card h4 {
  margin: 0;
  color: var(--black);
  font-size: 1.15rem;
  font-weight: 950;
}

.memory-card p {
  margin-bottom: 0;
}

.memory-card > strong {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 50%;
  color: var(--white);
  background: var(--black);
  font-size: 1.05rem;
}

.memory-advice {
  grid-column: 1 / -1;
  color: var(--black);
  font-size: 0.92rem;
  font-weight: 950;
}

.history-block {
  display: grid;
  gap: 10px;
}

.history-block + .history-block {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.result {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(280px, 1.15fr);
  gap: 20px;
  margin-top: 20px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: #111;
}

.decision-main {
  display: grid;
  align-content: start;
  gap: 12px;
}

.verdict {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--black);
  background: var(--good);
  font-size: 0.82rem;
  font-weight: 950;
  width: fit-content;
}

.verdict.warn {
  background: var(--warn);
}

.verdict.bad {
  background: var(--bad);
}

.score-ring {
  display: grid;
  width: 132px;
  height: 132px;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--yellow) var(--score), #333 0);
}

.score-ring span {
  display: grid;
  width: 96px;
  height: 96px;
  place-items: center;
  border-radius: 50%;
  color: var(--black);
  background: var(--lavender);
  font-size: 1.65rem;
  font-weight: 950;
}

.score-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.score-grid div {
  min-height: 78px;
  padding: 12px;
  border-radius: 22px;
  color: var(--black);
  background: var(--lavender);
}

.score-grid div:nth-child(2) {
  background: var(--yellow);
}

.score-grid div:nth-child(3) {
  background: var(--orange);
}

.score-grid div:nth-child(4) {
  background: var(--white);
}

.score-grid div:nth-child(5) {
  background: var(--lavender);
}

.score-grid strong {
  display: block;
  font-size: 1.55rem;
  line-height: 1;
}

.score-grid span {
  display: block;
  margin-top: 6px;
  font-size: 0.72rem;
  font-weight: 950;
  text-transform: uppercase;
}

.reason-list {
  display: grid;
  gap: 8px;
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
}

.reason-list li {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--white);
  background: rgba(255, 253, 248, 0.06);
  font-size: 0.9rem;
  line-height: 1.35;
}

.outcome-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 6px;
}

.outcome-actions button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--black);
  background: var(--white);
  font-size: 0.78rem;
  font-weight: 950;
}

.outcome-actions button:nth-child(1) {
  background: var(--yellow);
}

.outcome-actions button:nth-child(2),
.outcome-actions button:nth-child(4) {
  background: var(--orange);
}

.outcome-actions button:nth-child(3) {
  background: var(--lavender);
}

.size-rank {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}

.size-rank span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--black);
  background: var(--lavender);
  font-size: 0.82rem;
  font-weight: 950;
}

.size-rank span.best {
  background: var(--yellow);
}

.size-rank strong {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  height: 24px;
  border-radius: 999px;
  color: var(--white);
  background: var(--black);
  font-size: 0.74rem;
}

.metric-table {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.metric-row {
  display: grid;
  grid-template-columns: 1fr repeat(3, minmax(66px, 0.45fr));
  gap: 8px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.86rem;
}

.metric-row strong {
  color: var(--white);
}

.note {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

@media (max-width: 980px) {
  .shell {
    padding: 18px;
  }

  .topbar {
    grid-template-columns: 1fr;
    grid-template-areas:
      "brand"
      "switcher"
      "status";
    justify-items: start;
  }

  .profile-switcher,
  .status-strip {
    justify-self: start;
  }

  .profile-layout {
    grid-template-columns: 1fr;
  }

  .profile-insights {
    position: static;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .rail {
    position: static;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .nav-button {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    font-size: 0.72rem;
  }

  .measurement-grid,
  .item-form,
  .candidate-layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .insight-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .result {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .shell {
    width: 100%;
    max-width: 100%;
    padding: 12px;
    overflow: hidden;
  }

  .topbar,
  .workspace,
  .profile-switcher,
  .status-strip,
  .rail,
  .panel {
    width: 100%;
    max-width: 100%;
    justify-self: start;
  }

  h1 {
    max-width: 100%;
    font-size: 2rem;
    line-height: 0.9;
    overflow-wrap: break-word;
  }

  .topbar {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .panel {
    padding: 16px;
  }

  .measurement-grid,
  .item-form,
  .candidate-layout,
  .profile-layout .measurement-grid {
    grid-template-columns: 1fr;
  }

  /* 16px evita o auto-zoom do iOS Safari ao focar input */
  input,
  select,
  textarea {
    font-size: 16px;
  }

  .field-group .sub-grid {
    grid-template-columns: 1fr;
  }

  .insight-grid,
  .memory-grid {
    grid-template-columns: 1fr;
  }

  .status-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  .profile-switcher {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
  }

  .profile-chip {
    min-height: 44px;
    padding: 0 14px;
    text-align: center;
  }

  .status-strip span {
    min-width: 0;
    min-height: 44px;
    justify-content: center;
    padding: 9px 8px;
    font-size: 0.74rem;
  }

  .rail {
    position: static;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    width: 100%;
    max-width: 366px;
    padding: 8px;
    border-radius: 26px;
    backdrop-filter: blur(18px);
  }

  .nav-button {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 5px;
    width: auto;
    min-width: 0;
    min-height: 58px;
    padding: 8px 4px;
    font-size: 0.62rem;
    text-align: center;
  }

  .nav-button span {
    width: 30px;
    height: 30px;
  }

  .panel {
    min-height: calc(100vh - 120px);
    margin-bottom: 0;
  }

  .wide {
    grid-column: auto;
  }

  .section-head,
  .item-row {
    align-items: stretch;
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .item-row.compact {
    grid-template-columns: 1fr;
  }

  .action-row {
    justify-content: stretch;
  }

  .action-row button {
    width: 100%;
  }

  .metric-row {
    grid-template-columns: 1fr 1fr;
  }

  .score-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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