/* IGA Pesquisas — iga.css
 * Kit de interface. Depende de tokens.css (carregue tokens.css antes deste arquivo).
 * Mobile-first: escrito para 320px e ampliado em 640px e 1024px.
 * Nenhuma medida fixa maior que 320px é usada fora de media query.
 */

/* ---------------------------------------------------------------- base --- */

*,
*::before,
*::after { box-sizing: border-box; }

* { min-width: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--surface-100);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 24px;
  overflow-x: hidden;
}

img,
svg,
video,
canvas { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4, p, figure, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }

a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--brand-strong); }

:where(a, button, input, select, textarea, [tabindex]:not([tabindex="-1"])):focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: var(--space-4); top: -100px; z-index: 60;
  background: var(--brand); color: var(--on-brand);
  padding: var(--space-3) var(--space-4); border-radius: var(--radius-sm);
}
.skip-link:focus { top: var(--space-4); color: var(--on-brand); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ------------------------------------------------------------- layout --- */

.shell {
  width: 100%;
  max-width: var(--width-feed);
  margin-inline: auto;
  padding-inline: var(--space-4);
}

.wide {
  width: 100%;
  max-width: var(--width-content);
  margin-inline: auto;
  padding-inline: var(--space-4);
}

.section { margin-block: var(--space-7); }
.section__head {
  display: flex; align-items: baseline; justify-content: space-between;
  flex-wrap: wrap; gap: var(--space-3); margin-bottom: var(--space-4);
}
.overline { color: var(--ink-muted); text-transform: uppercase; }

.divider { height: 1px; background: var(--border-100); border: 0; margin-block: var(--space-6); }

/* ------------------------------------------------------------ botões --- */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--space-2);
  min-height: var(--size-tap);
  padding: var(--space-3) var(--space-5);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font: inherit; font-weight: 600; font-size: 15px;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, transform .1s ease;
}
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }

.btn--primary { background: var(--brand); color: var(--on-brand); }
.btn--primary:hover { background: var(--brand-strong); color: var(--on-brand); }

.btn--accent { background: var(--accent); color: var(--on-accent); }
.btn--accent:hover { background: var(--accent-strong); color: var(--on-accent); }

.btn--secondary {
  background: var(--surface-raised); color: var(--ink);
  border-color: var(--border-strong);
}
.btn--secondary:hover { background: var(--surface-200); color: var(--ink); }

.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: var(--surface-200); color: var(--ink); }

.btn--danger { background: var(--danger); color: var(--on-status); }

.btn--sm { min-height: 36px; padding: var(--space-2) var(--space-3); font-size: 14px; }
.btn--block { width: 100%; }
.btn__icon { width: 18px; height: 18px; flex: none; fill: currentColor; }

/* ------------------------------------------------- botões de contato --- */

.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
}
@media (min-width: 640px) {
  .contact-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.contact-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: var(--space-1);
  min-height: 74px;
  padding: var(--space-3) var(--space-2);
  border: 1px solid var(--border-100);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  color: var(--ink);
  font-size: 13px; font-weight: 600; line-height: 16px; text-align: center;
  text-decoration: none; cursor: pointer;
}
.contact-btn:hover { background: var(--surface-200); color: var(--ink); }
.contact-btn .icon { width: 22px; height: 22px; fill: currentColor; }

.contact-btn--wa { background: var(--whatsapp); color: var(--on-whatsapp); border-color: transparent; }
.contact-btn--wa:hover { background: var(--whatsapp); color: var(--on-whatsapp); filter: brightness(.94); }
.contact-btn--route { background: var(--brand); color: var(--on-brand); border-color: transparent; }
.contact-btn--route:hover { background: var(--brand-strong); color: var(--on-brand); }
.contact-btn--call { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.contact-btn--call:hover { background: var(--accent-strong); color: var(--on-accent); }

/* ------------------------------------------------------ redes sociais --- */

.social-row {
  display: flex; flex-wrap: wrap; gap: var(--space-2);
  justify-content: center;
}
.social-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: var(--size-tap); height: var(--size-tap);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: var(--surface-raised); color: var(--ink);
}
.social-btn:hover { background: var(--brand-soft); color: var(--ink); }
.social-btn .icon { width: 20px; height: 20px; fill: currentColor; }

/* --------------------------------------------------- cabeçalho perfil --- */

.profile { position: relative; margin-bottom: var(--space-6); }
.profile__cover {
  height: 132px;
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
  background: var(--brand-soft);
  background-size: cover; background-position: center;
}
@media (min-width: 640px) { .profile__cover { height: 200px; } }

.profile__id {
  display: flex; flex-direction: column; align-items: center;
  margin-top: -44px; text-align: center; gap: var(--space-2);
}
.profile__avatar {
  width: 88px; height: 88px; border-radius: var(--radius-pill);
  border: 3px solid var(--surface-100);
  background: var(--surface-inset);
  object-fit: cover;
}
.profile__name { font-family: var(--font-display); font-size: 28px; line-height: 32px; font-weight: 700; letter-spacing: -.02em; }
@media (min-width: 640px) { .profile__name { font-size: 36px; line-height: 40px; } }
.profile__bio { color: var(--ink-muted); font-size: 15px; max-width: 46ch; }
.profile__meta { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); justify-content: center; color: var(--ink-subtle); font-size: 13px; }

.profile__stats {
  display: flex; justify-content: center; gap: var(--space-6);
  margin-top: var(--space-4);
}
.stat { text-align: center; }
.stat__value { font-family: var(--font-mono); font-size: 20px; font-weight: 600; }
.stat__label { color: var(--ink-subtle); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }

/* ----------------------------------------------------------- destaques --- */

.highlights {
  display: flex; gap: var(--space-4);
  overflow-x: auto; scroll-snap-type: x proximity;
  padding-block: var(--space-2) var(--space-3);
  margin-inline: calc(var(--space-4) * -1);
  padding-inline: var(--space-4);
  scrollbar-width: thin;
}
.highlight {
  flex: none; width: 76px; scroll-snap-align: start;
  display: flex; flex-direction: column; align-items: center; gap: var(--space-1);
  background: none; border: 0; padding: 0; cursor: pointer; color: inherit;
}
.highlight__ring {
  width: 68px; height: 68px; border-radius: var(--radius-pill);
  padding: 3px;
  background: linear-gradient(var(--accent), var(--brand));
}
.highlight__img {
  width: 100%; height: 100%; border-radius: var(--radius-pill);
  border: 2px solid var(--surface-100);
  background: var(--surface-inset);
  object-fit: cover;
}
.highlight__label {
  font-size: 12px; line-height: 16px; color: var(--ink-muted);
  max-width: 76px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.highlight--new .highlight__ring { background: var(--border-strong); }

/* --------------------------------------------------------------- feed --- */

.feed-toggle { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; }
.feed-toggle button {
  min-height: 36px; padding: var(--space-2) var(--space-3);
  background: var(--surface-raised); color: var(--ink-muted);
  border: 0; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.feed-toggle button[aria-pressed="true"] { background: var(--brand); color: var(--on-brand); }

.feed { display: grid; gap: var(--space-4); }
.feed--grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-1); }
.feed--grid .post { border: 0; border-radius: var(--radius-xs); background: none; box-shadow: none; }
.feed--grid .post__body, .feed--grid .post__head { display: none; }
.feed--grid .post__media { aspect-ratio: 1 / 1; border-radius: var(--radius-xs); }

.post {
  background: var(--surface-raised);
  border: 1px solid var(--border-100);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.post__head { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); }
.post__avatar { width: 36px; height: 36px; border-radius: var(--radius-pill); background: var(--surface-inset); flex: none; }
.post__who { font-size: 14px; font-weight: 600; }
.post__when { font-size: 12px; color: var(--ink-subtle); }
.post__media { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; background: var(--surface-inset); }
@media (min-width: 640px) { .post__media { aspect-ratio: 3 / 2; } }
.post__body { padding: var(--space-4); display: grid; gap: var(--space-2); }
.post__caption { font-size: 15px; }
.post__tags { display: flex; flex-wrap: wrap; gap: var(--space-1); }

/* ------------------------------------------------------------- selos --- */

.badge {
  display: inline-flex; align-items: center; gap: var(--space-1);
  padding: 3px var(--space-2);
  border-radius: var(--radius-xs);
  font-size: 12px; font-weight: 600; line-height: 16px; white-space: nowrap;
  background: var(--surface-200); color: var(--ink);
}
.badge--success { background: var(--success-soft); }
.badge--warning { background: var(--warning-soft); }
.badge--danger  { background: var(--danger-soft); }
.badge--info    { background: var(--info-soft); }
.badge__dot { width: 8px; height: 8px; border-radius: var(--radius-pill); flex: none; }
.badge--success .badge__dot { background: var(--success); }
.badge--warning .badge__dot { background: var(--warning); }
.badge--danger  .badge__dot { background: var(--danger); }
.badge--info    .badge__dot { background: var(--info); }

/* --------------------------------------------------------- formulário --- */

.field { display: grid; gap: var(--space-1); margin-bottom: var(--space-5); }
.field__label { font-size: 14px; font-weight: 600; color: var(--ink); }
.field__req { color: var(--accent); }
.field__hint { font-size: 13px; color: var(--ink-muted); }
.field__error { font-size: 13px; color: var(--danger); font-weight: 600; }

.input, .textarea, .select {
  width: 100%;
  min-height: var(--size-tap);
  padding: var(--space-3);
  background: var(--surface-raised);
  color: var(--ink);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font: inherit; font-size: 16px;
}
.textarea { min-height: 110px; resize: vertical; }
.select { appearance: none; padding-right: var(--space-7);
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%;
  background-size: 6px 6px, 6px 6px; background-repeat: no-repeat;
}
.input::placeholder, .textarea::placeholder { color: var(--ink-subtle); }
.input[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--danger); border-width: 2px; }

.choice-list { display: grid; gap: var(--space-2); }
.choice {
  display: flex; align-items: center; gap: var(--space-3);
  min-height: var(--size-tap);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  cursor: pointer;
}
.choice:hover { background: var(--surface-200); }
.choice input { accent-color: var(--brand); width: 20px; height: 20px; flex: none; }
.choice:has(input:checked) { background: var(--brand-soft); border-color: var(--brand); border-width: 2px; padding: calc(var(--space-3) - 1px) calc(var(--space-4) - 1px); }
.choice__text { font-size: 15px; }

/* escala 0–10 (NPS) */
.scale { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--space-1); }
@media (min-width: 640px) { .scale { grid-template-columns: repeat(11, minmax(0, 1fr)); } }
.scale__btn {
  min-height: var(--size-tap);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-raised); color: var(--ink);
  font-family: var(--font-mono); font-size: 15px; font-weight: 600;
  cursor: pointer;
}
.scale__btn:hover { background: var(--surface-200); }
.scale__btn[aria-pressed="true"] { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
.scale__ends { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-subtle); margin-top: var(--space-1); }

/* estrelas */
.stars { display: flex; gap: var(--space-1); }
.star {
  width: var(--size-tap); height: var(--size-tap);
  display: grid; place-items: center;
  background: none; border: 0; cursor: pointer; color: var(--border-strong); padding: 0;
}
.star svg { width: 30px; height: 30px; fill: currentColor; }
.star[aria-pressed="true"], .star.is-on { color: var(--accent); }

.switch { display: inline-flex; align-items: center; gap: var(--space-3); cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch__track {
  width: 46px; height: 26px; border-radius: var(--radius-pill);
  background: var(--border-strong); position: relative; flex: none; transition: background .15s ease;
}
.switch__track::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px; border-radius: var(--radius-pill);
  background: var(--surface-raised); transition: transform .15s ease;
}
.switch input:checked + .switch__track { background: var(--brand); }
.switch input:checked + .switch__track::after { transform: translateX(20px); }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ----------------------------------------------------------- etapas --- */

.stepper { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; margin-bottom: var(--space-5); }
.step { display: flex; align-items: center; gap: var(--space-2); font-size: 13px; color: var(--ink-subtle); }
.step__dot {
  width: 26px; height: 26px; border-radius: var(--radius-pill);
  display: grid; place-items: center; flex: none;
  background: var(--surface-inset); color: var(--ink-muted);
  font-family: var(--font-mono); font-size: 13px; font-weight: 600;
  border: 1px solid var(--border-strong);
}
.step[aria-current="step"] { color: var(--ink); font-weight: 600; }
.step[aria-current="step"] .step__dot { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.step--done .step__dot { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
.step__line { width: 16px; height: 1px; background: var(--border-strong); }

.progress { height: 8px; border-radius: var(--radius-pill); background: var(--surface-inset); overflow: hidden; }
.progress__bar { height: 100%; background: var(--brand); border-radius: var(--radius-pill); transition: width .25s ease; }

.form-nav {
  display: flex; gap: var(--space-3); margin-top: var(--space-6);
  position: sticky; bottom: 0;
  background: linear-gradient(to top, var(--surface-100) 70%, transparent);
  padding-block: var(--space-4);
}
.form-nav .btn { flex: 1; }

/* ------------------------------------------------------------ painel --- */

.topbar {
  position: sticky; top: 0; z-index: 30;
  min-height: var(--size-header);
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-2) var(--space-4);
  background: var(--surface-raised);
  border-bottom: 1px solid var(--border-100);
  box-shadow: var(--shadow-sm);
}
.topbar__brand { display: flex; align-items: center; gap: var(--space-2); font-weight: 700; font-family: var(--font-display); font-size: 18px; }
.topbar__spacer { flex: 1; }

.panel-layout { display: block; }
@media (min-width: 1024px) {
  .panel-layout { display: grid; grid-template-columns: var(--size-rail) minmax(0, 1fr); align-items: start; }
}

.rail {
  background: var(--surface-200);
  border-right: 1px solid var(--border-100);
  padding: var(--space-4);
}
@media (max-width: 1023px) {
  .rail {
    position: fixed; inset: 0 auto 0 0; z-index: 50;
    width: min(280px, 86vw); transform: translateX(-100%);
    transition: transform .2s ease; overflow-y: auto;
    box-shadow: var(--shadow-lg);
  }
  .rail.is-open { transform: none; }
}
@media (min-width: 1024px) { .rail { position: sticky; top: var(--size-header); height: calc(100vh - var(--size-header)); overflow-y: auto; } }

.rail__group { margin-bottom: var(--space-5); }
.rail__title { font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-subtle); margin-bottom: var(--space-2); }
.rail__link {
  display: flex; align-items: center; gap: var(--space-3);
  min-height: var(--size-tap); padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm); color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 500;
}
.rail__link:hover { background: var(--surface-raised); color: var(--ink); }
.rail__link[aria-current="page"] { background: var(--brand); color: var(--on-brand); font-weight: 600; }
.rail__link .icon { width: 18px; height: 18px; fill: currentColor; flex: none; }

.card {
  background: var(--surface-raised);
  border: 1px solid var(--border-100);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
}
.card__head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-4); }
.card__title { font-size: 17px; font-weight: 600; }
.card__note { font-size: 13px; color: var(--ink-muted); }

.grid { display: grid; gap: var(--space-4); }
.grid--kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 900px) { .grid--kpi { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.grid--2 { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.kpi { display: grid; gap: var(--space-1); }
.kpi__label { font-size: 13px; color: var(--ink-muted); font-weight: 600; }
.kpi__value { font-family: var(--font-mono); font-size: 28px; line-height: 32px; font-weight: 600; }
.kpi__delta { font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: var(--space-1); }
.kpi__delta--up { color: var(--success); }
.kpi__delta--down { color: var(--danger); }

/* ----------------------------------------------------------- filtros --- */

.filters {
  display: flex; flex-wrap: wrap; gap: var(--space-2);
  align-items: end;
  padding: var(--space-4);
  background: var(--surface-200);
  border: 1px solid var(--border-100);
  border-radius: var(--radius-lg);
}
.filters .field { margin: 0; flex: 1 1 150px; }
.filters .input, .filters .select { min-height: 40px; font-size: 14px; }

.chips { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-3); }
.chip {
  display: inline-flex; align-items: center; gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  background: var(--info-soft); color: var(--ink);
  border-radius: var(--radius-xs); font-size: 13px; font-weight: 600;
}
.chip button { background: none; border: 0; color: inherit; cursor: pointer; font-size: 15px; line-height: 1; padding: 2px; }

/* ----------------------------------------------------------- tabela --- */

.table-wrap {
  width: 100%; overflow-x: auto;
  border: 1px solid var(--border-100); border-radius: var(--radius-lg);
  background: var(--surface-raised);
}
.table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 560px; }
.table th, .table td { padding: var(--space-3); text-align: left; border-bottom: 1px solid var(--border-100); vertical-align: middle; }
.table th {
  font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
  color: var(--ink-muted); background: var(--surface-200); white-space: nowrap;
  position: sticky; top: 0; z-index: 1;
}
.table td.num, .table th.num { text-align: right; font-family: var(--font-mono); font-size: 13px; }
.table tbody tr { cursor: pointer; }
.table tbody tr:hover { background: var(--surface-200); }
.table tbody tr[aria-selected="true"] { background: var(--brand-soft); }
.table tbody tr:last-child td { border-bottom: 0; }

.table-foot {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: var(--space-3); padding: var(--space-3) var(--space-4);
  font-size: 13px; color: var(--ink-muted); border-top: 1px solid var(--border-100);
}

/* ------------------------------------------------- drawer / modal --- */

.scrim {
  position: fixed; inset: 0; background: var(--overlay); z-index: 60;
  opacity: 0; pointer-events: none; transition: opacity .2s ease;
}
.scrim.is-open { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed; z-index: 61; background: var(--surface-raised);
  box-shadow: var(--shadow-lg); display: flex; flex-direction: column;
  inset: auto 0 0 0; max-height: 88vh;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  transform: translateY(100%); transition: transform .22s ease;
}
.drawer.is-open { transform: none; }
@media (min-width: 900px) {
  .drawer {
    inset: 0 0 0 auto; width: min(460px, 92vw); max-height: none;
    border-radius: var(--radius-xl) 0 0 var(--radius-xl);
    transform: translateX(100%);
  }
  .drawer.is-open { transform: none; }
}
.drawer__head {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-4); border-bottom: 1px solid var(--border-100);
}
.drawer__title { font-size: 17px; font-weight: 600; flex: 1; }
.drawer__body { padding: var(--space-4); overflow-y: auto; display: grid; gap: var(--space-4); }
.drawer__foot { padding: var(--space-4); border-top: 1px solid var(--border-100); display: flex; gap: var(--space-2); }

.kv { display: grid; gap: var(--space-1); }
.kv__k { font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-subtle); }
.kv__v { font-size: 15px; }

/* ------------------------------------------------------------- abas --- */

.tabs {
  display: flex; gap: var(--space-1); overflow-x: auto;
  border-bottom: 1px solid var(--border-100); margin-bottom: var(--space-5);
}
.tab {
  flex: none; min-height: var(--size-tap); padding: var(--space-2) var(--space-4);
  background: none; border: 0; border-bottom: 3px solid transparent;
  color: var(--ink-muted); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  white-space: nowrap;
}
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--brand); }

/* --------------------------------------------------------- gráficos --- */

.chart { width: 100%; }
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart__legend { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); margin-top: var(--space-3); font-size: 13px; color: var(--ink-muted); }
.legend-item { display: inline-flex; align-items: center; gap: var(--space-2); }
.legend-swatch { width: 10px; height: 10px; border-radius: 2px; flex: none; }

.bar-list { display: grid; gap: var(--space-3); }
.bar-row { display: grid; grid-template-columns: minmax(84px, 34%) minmax(0, 1fr) auto; gap: var(--space-3); align-items: center; font-size: 14px; }
.bar-track { display: block; height: 14px; background: var(--surface-inset); border-radius: var(--radius-xs); overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: var(--radius-xs); }
.bar-value { font-family: var(--font-mono); font-size: 13px; color: var(--ink-muted); }

.split-bar { display: flex; height: 28px; border-radius: var(--radius-xs); overflow: hidden; gap: 2px; background: var(--surface-raised); }
.split-bar span { display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--on-status); }

.hero-metric { display: grid; gap: var(--space-1); }
.hero-metric__value { font-family: var(--font-mono); font-size: 44px; line-height: 46px; font-weight: 600; }
.hero-metric__label { font-size: 13px; color: var(--ink-muted); }

/* ------------------------------------------------ construtor de forms --- */

.builder { display: grid; gap: var(--space-4); }
@media (min-width: 1024px) { .builder { grid-template-columns: 220px minmax(0, 1fr); align-items: start; } }

.palette { display: grid; gap: var(--space-2); }
.palette__item {
  display: flex; align-items: center; gap: var(--space-3);
  min-height: var(--size-tap); padding: var(--space-3);
  border: 1px dashed var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface-raised); color: var(--ink);
  font-size: 14px; font-weight: 600; cursor: grab; text-align: left; width: 100%;
}
.palette__item:hover { background: var(--brand-soft); }

.canvas { display: grid; gap: var(--space-3); }
.qcard {
  background: var(--surface-raised); border: 1px solid var(--border-100);
  border-left: 1px solid var(--border-100);
  border-radius: var(--radius-md); padding: var(--space-4);
  display: grid; gap: var(--space-2);
}
.qcard.is-dragging { opacity: .5; }
.qcard__top { display: flex; align-items: center; gap: var(--space-2); }
.qcard__handle { cursor: grab; color: var(--ink-subtle); background: none; border: 0; padding: var(--space-1); }
.qcard__type { font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-subtle); }
.qcard__actions { margin-left: auto; display: flex; gap: var(--space-1); }
.qcard__icon-btn { width: 32px; height: 32px; display: grid; place-items: center; border: 0; background: none; border-radius: var(--radius-xs); color: var(--ink-muted); cursor: pointer; }
.qcard__icon-btn:hover { background: var(--surface-200); color: var(--ink); }

.stage-band {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  background: var(--brand-soft); border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 700;
}

/* --------------------------------------------------------- estados --- */

.empty {
  display: grid; gap: var(--space-3); justify-items: center; text-align: center;
  padding: var(--space-8) var(--space-4);
  border: 1px dashed var(--border-strong); border-radius: var(--radius-lg);
  color: var(--ink-muted);
}
.empty__title { font-size: 17px; font-weight: 600; color: var(--ink); }

.note {
  padding: var(--space-3) var(--space-4); border-radius: var(--radius-sm);
  font-size: 14px; background: var(--info-soft); color: var(--ink);
}
.note--warn { background: var(--warning-soft); }
.note--danger { background: var(--danger-soft); }
.note--ok { background: var(--success-soft); }

/* ------------------------------------------------------ agradecimento --- */

.thanks {
  text-align: center; display: grid; gap: var(--space-5); justify-items: center;
  padding: var(--space-8) var(--space-4);
}
.thanks__mark { width: 88px; height: 88px; display: grid; place-items: center; border-radius: var(--radius-pill); background: var(--brand-soft); }
.thanks__mark svg { width: 44px; height: 44px; fill: var(--brand); }
.thanks__title { font-family: var(--font-display); font-size: 32px; line-height: 36px; font-weight: 700; letter-spacing: -.015em; }
@media (min-width: 640px) { .thanks__title { font-size: 44px; line-height: 46px; } }
.thanks__text { color: var(--ink-muted); max-width: 44ch; }

/* --------------------------------------------------------- visualizador --- */

.story { position: fixed; inset: 0; z-index: 70; background: var(--overlay); display: none; place-items: center; padding: var(--space-4); }
.story.is-open { display: grid; }
.story__frame { width: min(420px, 100%); background: var(--surface-raised); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-lg); }
.story__bars { display: flex; gap: 3px; padding: var(--space-2); }
.story__bar { flex: 1; height: 3px; background: var(--border-100); border-radius: var(--radius-pill); }
.story__bar.is-on { background: var(--brand); }
.story__img { width: 100%; aspect-ratio: 9 / 14; object-fit: cover; background: var(--surface-inset); }
.story__foot { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); }

/* ------------------------------------------------------------ rodapé --- */

.footer {
  margin-top: var(--space-9); padding: var(--space-6) var(--space-4) var(--space-8);
  border-top: 1px solid var(--border-100);
  text-align: center; color: var(--ink-subtle); font-size: 13px;
}

/* --------------------------------------------------------- utilidades --- */

.muted { color: var(--ink-muted); }
.subtle { color: var(--ink-subtle); }
.center { text-align: center; }
.row { display: flex; gap: var(--space-3); align-items: center; flex-wrap: wrap; }
.row--end { justify-content: flex-end; }
.mono { font-family: var(--font-mono); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.hide-desk { display: initial; }
@media (min-width: 1024px) { .hide-desk { display: none; } }
[hidden] { display: none !important; }

/* ------------------------------------------------------------ ícones --- */

.icon { width: 20px; height: 20px; fill: currentColor; flex: none; display: inline-block; vertical-align: middle; }

/* ---------------------------------------------------- folha (dialog) --- */

dialog.sheet {
  width: min(460px, calc(100vw - var(--space-6)));
  margin: auto auto var(--space-4);
  padding: 0;
  border: 1px solid var(--border-100);
  border-radius: var(--radius-xl);
  background: var(--surface-raised);
  color: var(--ink);
  box-shadow: var(--shadow-lg);
}
dialog.sheet::backdrop { background: var(--overlay); }
.sheet__head { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-4); border-bottom: 1px solid var(--border-100); }
.sheet__head .card__title { flex: 1; }
.sheet__body { display: grid; gap: var(--space-2); padding: var(--space-4); }

/* --------------------------------------------- visibilidade por largura --- */

.hide-320 { display: none; }
@media (min-width: 400px) { .hide-320 { display: inline; } }
