/* Manual do MIDILIVE (/manual/). Usa os tokens e componentes de site.css. */

/* ---------- Topo com a busca ---------- */

.man-hero {
  padding-bottom: clamp(40px, 6vw, 64px);
}

.man-hero-inner {
  position: relative;
  max-width: 760px;
  margin-inline: auto;
  text-align: center;
}

.man-hero .eyebrow::before {
  display: none;
}

.man-hero h1 {
  margin: 14px 0 10px;
}

.man-hero .page-hero-lead {
  max-width: 52ch;
  margin: 0 auto 28px;
}

.man-search {
  position: relative;
  text-align: left;
}

.man-search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.man-search-box > svg {
  position: absolute;
  left: 20px;
  width: 22px;
  height: 22px;
  color: var(--text-muted);
  pointer-events: none;
}

.man-search input {
  width: 100%;
  min-height: 62px;
  padding: 0 56px 0 54px;
  border: 2px solid transparent;
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 1.08rem;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  transition: border-color 150ms ease;
  -webkit-appearance: none;
  appearance: none;
}

.man-search input::placeholder {
  color: #7d858e;
}

.man-search input:focus {
  outline: none;
  border-color: var(--green);
}

.man-search input::-webkit-search-cancel-button {
  display: none;
}

.man-clear {
  position: absolute;
  right: 10px;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.man-clear:hover {
  background: rgba(21, 25, 30, 0.07);
  color: var(--text);
}

.man-clear svg {
  width: 20px;
  height: 20px;
}

.man-results {
  margin-top: 12px;
  overflow: hidden;
  border-radius: 22px;
  background: #fff;
  color: var(--text);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

.man-results ul {
  margin: 0;
  padding: 6px;
  list-style: none;
}

.man-result {
  display: block;
  padding: 12px 16px;
  border-radius: 16px;
  text-decoration: none;
  cursor: pointer;
}

.man-result:hover,
.man-result[aria-selected="true"] {
  background: #eefaf2;
}

.man-result-sec {
  display: block;
  margin-bottom: 2px;
  color: var(--green-ink);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.man-result-title {
  display: block;
  font-weight: 650;
  line-height: 1.35;
}

.man-result-snip {
  display: block;
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.man-results mark {
  padding: 0 1px;
  border-radius: 3px;
  background: #fff1c2;
  color: inherit;
}

.man-results-foot {
  padding: 12px 22px 14px;
  border-top: 1px solid var(--line);
  color: var(--text-muted);
  font-size: 0.92rem;
}

.man-results-foot a {
  color: var(--green-ink);
  font-weight: 600;
}

.man-more {
  border: 0;
  padding: 0;
  background: none;
  color: var(--green-ink);
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

.man-empty {
  padding: 20px 22px 6px;
}

.man-empty strong {
  display: block;
  margin-bottom: 4px;
}

.man-empty p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.man-popular {
  margin-top: 20px;
}

.man-popular-label {
  margin-bottom: 10px;
  color: var(--on-ink-muted);
  font-size: 0.86rem;
  font-weight: 600;
}

.man-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.man-chip {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 15px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: #e6ebf0;
  font-size: 0.92rem;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 150ms ease, border-color 150ms ease;
}

.man-chip:hover {
  border-color: rgba(94, 220, 138, 0.6);
  background: rgba(94, 220, 138, 0.12);
  color: #fff;
}

/* ---------- Assuntos ---------- */

.man-topics-section {
  padding: clamp(48px, 7vw, 80px) 0 clamp(24px, 4vw, 40px);
}

.man-topics-head {
  margin-bottom: 24px;
}

.man-topics-head h2 {
  margin-top: 10px;
  font-size: clamp(1.6rem, 1.2rem + 1.5vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.man-topics {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr));
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.man-topic {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 14px;
  height: 100%;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-card);
  text-decoration: none;
  transition: transform 160ms var(--ease-out), box-shadow 160ms ease, border-color 160ms ease;
}

.man-topic:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-lift);
}

.man-topic-icon {
  grid-row: span 3;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: #e6f8ee;
  color: var(--green-ink);
}

.man-topic-icon svg {
  width: 24px;
  height: 24px;
}

.tone-teal .man-topic-icon,
.man-section.tone-teal .man-section-icon {
  background: #def6f3;
  color: var(--teal-ink);
}

.tone-amber .man-topic-icon,
.man-section.tone-amber .man-section-icon {
  background: #fdf1d4;
  color: var(--amber-ink);
}

.tone-coral .man-topic-icon,
.man-section.tone-coral .man-section-icon {
  background: #ffe7e1;
  color: #a53a22;
}

.man-topic strong {
  font-family: var(--font-display);
  font-size: 1.04rem;
  font-weight: 700;
  line-height: 1.3;
}

.man-topic span:not(.man-topic-icon) {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.man-topic small {
  color: var(--green-ink);
  font-size: 0.8rem;
  font-weight: 600;
}

.man-topic-start {
  border-color: rgba(31, 157, 85, 0.45);
  background: linear-gradient(135deg, #f1fcf5, #fff 60%);
}

.man-topic-start::after {
  content: "Comece aqui";
  position: absolute;
  top: -10px;
  right: 16px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--green);
  color: #06140b;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

/* ---------- Conteúdo ---------- */

.man-content {
  padding: clamp(24px, 4vw, 40px) 0 clamp(64px, 8vw, 100px);
}

.man-layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  align-items: start;
  gap: clamp(28px, 4vw, 56px);
}

.man-toc {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  max-height: calc(100vh - var(--header-h) - 48px);
  overflow-y: auto;
}

.man-toc p {
  margin-bottom: 10px;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.man-toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.man-toc a {
  display: block;
  padding: 7px 12px;
  border-left: 2px solid var(--line);
  color: var(--text-muted);
  font-size: 0.93rem;
  font-weight: 500;
  line-height: 1.35;
  text-decoration: none;
  transition: color 150ms ease, border-color 150ms ease, background-color 150ms ease;
}

.man-toc a:hover {
  color: var(--text);
}

.man-toc a.is-current {
  border-left-color: var(--green-strong);
  background: rgba(94, 220, 138, 0.1);
  color: var(--green-ink);
  font-weight: 650;
}

.man-section + .man-section {
  margin-top: clamp(48px, 6vw, 72px);
}

.man-section-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 6px 16px;
  margin-bottom: 18px;
}

.man-section-icon {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: #e6f8ee;
  color: var(--green-ink);
}

.man-section-icon svg {
  width: 26px;
  height: 26px;
}

.man-section h2 {
  font-size: clamp(1.45rem, 1.1rem + 1.2vw, 1.9rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.man-section-head p {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.5;
}

.man-list {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-card);
}

.man-item + .man-item {
  border-top: 1px solid var(--line);
}

.man-item summary {
  position: relative;
  display: block;
  padding: 18px 56px 18px 22px;
  font-size: 1.04rem;
  font-weight: 600;
  line-height: 1.4;
  list-style: none;
  cursor: pointer;
  transition: color 150ms ease, background-color 150ms ease;
}

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

.man-item summary:hover {
  background: #fbfaf7;
  color: var(--green-ink);
}

.man-item summary::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 24px;
  width: 9px;
  height: 9px;
  margin-top: -7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 250ms var(--ease-out);
}

.man-item[open] summary::after {
  margin-top: -2px;
  transform: rotate(225deg);
}

.man-item[open] summary {
  color: var(--green-ink);
}

.man-item::details-content {
  block-size: 0;
  overflow: hidden;
  transition: block-size 280ms var(--ease-out), content-visibility 280ms allow-discrete;
}

.man-item[open]::details-content {
  block-size: auto;
}

.man-item.is-flash summary {
  animation: man-flash 1.8s ease-out;
}

@keyframes man-flash {
  0%,
  35% {
    background: #fff1c2;
  }
  100% {
    background: transparent;
  }
}

.man-body {
  padding: 0 22px 20px;
  color: #2c333b;
  font-size: 1rem;
  line-height: 1.65;
}

.man-body > * + * {
  margin-top: 12px;
}

.man-body p,
.man-body li {
  max-width: 70ch;
}

.man-body a {
  color: var(--green-ink);
  font-weight: 600;
}

.man-body ul {
  padding-left: 20px;
}

.man-body ul li + li {
  margin-top: 6px;
}

.man-body li::marker {
  color: var(--green-strong);
}

/* Passos numerados */
.man-steps {
  counter-reset: man-step;
  margin: 0;
  padding: 0;
  list-style: none;
}

.man-steps > li {
  position: relative;
  min-height: 30px;
  padding-left: 42px;
  counter-increment: man-step;
}

.man-steps > li + li {
  margin-top: 10px;
}

.man-steps > li::before {
  content: counter(man-step);
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--ink-1);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1;
}

/* Caminho dentro do app: Configurações › Áudio › Buffer */
.ui-path > span {
  font-weight: 650;
  white-space: nowrap;
}

.ui-path > span + span::before {
  content: "›";
  margin: 0 6px;
  color: var(--green-strong);
  font-weight: 700;
}

/* Botão do app, como aparece na tela */
.ui {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 7px;
  background: var(--ink-2);
  color: #eef2f5;
  font-size: 0.82em;
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1.6;
  white-space: nowrap;
}

.ui-on {
  background: #1d6b40;
  color: #eafff1;
}

.ui-ic {
  display: inline-grid;
  place-items: center;
  width: 1.75em;
  height: 1.75em;
  margin: 0 1px;
  border-radius: 8px;
  background: var(--ink-2);
  color: #eef2f5;
  vertical-align: -0.45em;
}

.ui-ic svg {
  width: 1.1em;
  height: 1.1em;
}

.ui-ic-green {
  background: var(--green);
  color: #06140b;
}

/* Etiquetas de plataforma */
.plat {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.6;
  vertical-align: 2px;
  white-space: nowrap;
}

.plat-android {
  background: #e6f8ee;
  color: var(--green-ink);
}

.plat-ios {
  background: #e9eef6;
  color: #2b4a75;
}

.plat-pro {
  background: #fdf1d4;
  color: var(--amber-ink);
}

/* Recurso novo: quem está numa versão antiga não procura um botão que não tem. */
.plat-ver {
  background: #eceef1;
  color: #4a525c;
}

/* Dica e atenção */
.tip {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid #cfeedd;
  border-radius: 14px;
  background: #f2fbf6;
  font-size: 0.96rem;
}

.tip > svg {
  width: 20px;
  height: 20px;
  margin-top: 3px;
  color: var(--green-ink);
}

.tip-warn {
  border-color: #efdcae;
  background: #fffaf0;
}

.tip-warn > svg {
  color: var(--amber-ink);
}

.tip strong:first-child {
  color: var(--text);
}

/* Tabelas curtas */
.man-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.man-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
}

.man-table th,
.man-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.man-table tr:last-child td {
  border-bottom: 0;
}

.man-table th {
  background: #faf8f3;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.man-table td:first-child {
  font-weight: 650;
  white-space: nowrap;
}

/* Rodapé de cada resposta */
.man-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin-top: 18px !important;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  font-size: 0.88rem;
}

.man-copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.man-copy:hover {
  border-color: var(--green-strong);
  color: var(--green-ink);
}

.man-copy svg {
  width: 16px;
  height: 16px;
}

.man-copy.is-done {
  border-color: var(--green-strong);
  background: #eefaf2;
  color: var(--green-ink);
}

.man-foot-help {
  color: var(--text-muted);
}

.man-foot-help a {
  color: var(--text-muted);
  font-weight: 600;
}

/* ---------- Mapa da tela do projeto ---------- */

.man-figure {
  margin: 16px 0 0;
  padding: 16px;
  border-radius: 18px;
  background: var(--ink-1);
  color: var(--on-ink);
}

.man-figure + .man-figure {
  margin-top: 14px;
}

.man-figure figcaption {
  margin-bottom: 12px;
  color: var(--on-ink-muted);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.mock-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 10px;
  padding: 12px 14px;
  border: 1px solid var(--ink-line);
  border-radius: 14px;
  background: #0d1217;
}

.mock-title {
  margin-right: auto;
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 700;
}

.mock-chip {
  padding: 2px 9px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  color: #cfd6dd;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.mock-chip-ok {
  border-color: rgba(94, 220, 138, 0.5);
  color: var(--green);
}

.mock-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  color: #eef2f5;
}

.mock-btn svg {
  width: 22px;
  height: 22px;
}

.mock-btn-fab {
  border-radius: 12px;
  background: var(--green);
  color: #06140b;
}

[data-n]::after {
  content: attr(data-n);
  position: absolute;
  top: -9px;
  right: -9px;
  display: grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 4px;
  border: 2px solid #0d1217;
  border-radius: 999px;
  background: var(--amber);
  color: #241a00;
  font-size: 0.7rem;
  font-weight: 800;
  line-height: 1;
}

.mock-chip[data-n] {
  position: relative;
}

.mock-legend {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 8px 22px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.92rem;
  line-height: 1.45;
}

.mock-legend li {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 10px;
  color: var(--on-ink-muted);
}

.mock-legend b {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--amber);
  color: #241a00;
  font-size: 0.72rem;
  font-weight: 800;
}

.mock-legend strong {
  color: #fff;
}

.mock-track-wrap {
  display: grid;
  grid-template-columns: minmax(0, 250px) minmax(0, 1fr);
  align-items: center;
  gap: 22px;
}

.mock-track-wrap .mock-legend {
  grid-template-columns: minmax(0, 1fr);
  margin: 0;
}

.mock-track {
  width: 100%;
  height: auto;
}

.man-figure-note {
  margin-top: 12px;
  color: var(--on-ink-muted);
  font-size: 0.88rem;
}

/* ---------- Ajuda no fim ---------- */

.man-help {
  margin-top: clamp(48px, 6vw, 72px);
  padding: clamp(24px, 4vw, 36px);
  border-radius: var(--radius-lg);
  background: var(--ink-1);
  color: var(--on-ink-muted);
}

.man-help h2 {
  margin-bottom: 8px;
  color: #fff;
  font-size: clamp(1.4rem, 1.1rem + 1vw, 1.8rem);
  font-weight: 700;
}

.man-help-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.man-help-links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}

.man-help-links a:hover {
  background: rgba(255, 255, 255, 0.07);
}

.man-help-links svg {
  width: 18px;
  height: 18px;
  color: var(--green);
}

.man-download {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  margin-top: 16px;
  padding: 20px clamp(20px, 3vw, 28px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
}

.man-download strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.05rem;
}

.man-download p {
  color: var(--text-muted);
  font-size: 0.94rem;
}

.man-download .cta-group {
  margin: 0;
}

.man-download .store-btn-secondary {
  border-color: transparent;
  background: var(--ink-1);
  color: #fff;
}

.man-download .store-btn-secondary:hover {
  background: #202a35;
}

/* Botão para voltar à busca */
.man-totop {
  position: fixed;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 45;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 18px 0 14px;
  border: 0;
  border-radius: 999px;
  background: var(--ink-1);
  color: #fff;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 200ms ease, transform 200ms var(--ease-out);
}

.man-totop.is-visible {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.man-totop svg {
  width: 18px;
  height: 18px;
  color: var(--green);
}

/* ---------- Telas menores ---------- */

@media (max-width: 1000px) {
  .man-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .man-toc {
    display: none;
  }
}

@media (max-width: 400px) {
  .page-manual .simple-nav .nav-optional {
    display: none;
  }
}

@media (max-width: 640px) {
  .man-search input {
    min-height: 56px;
    font-size: 1rem;
  }

  .man-item summary {
    padding: 16px 48px 16px 16px;
    font-size: 1rem;
  }

  .man-item summary::after {
    right: 20px;
  }

  .man-body {
    padding: 0 16px 18px;
  }

  .man-steps > li {
    padding-left: 38px;
  }

  .mock-track-wrap {
    grid-template-columns: minmax(0, 1fr);
  }

  .mock-track {
    max-width: 260px;
    margin-inline: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .man-item::details-content,
  .man-topic,
  .man-totop {
    transition: none;
  }

  .man-item.is-flash summary {
    animation: none;
    background: #fff1c2;
  }
}
