/* ── Botões ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 15px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: 13px;
  font-family: var(--font);
  font-weight: 500;
  cursor: pointer;
  transition: background var(--tr-fast), border-color var(--tr-fast), box-shadow var(--tr-fast), opacity var(--tr-fast);
  white-space: nowrap;
  line-height: 1.4;
  text-decoration: none;
}
.btn:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--surface-3);
  border-color: var(--border-strong);
}

.btn-success {
  background: var(--success);
  color: #fff;
  border-color: var(--success);
}
.btn-success:hover:not(:disabled) { filter: brightness(1.10); }

.btn-danger {
  background: var(--danger-bg);
  color: var(--danger-text);
  border-color: var(--danger);
}
.btn-danger:hover:not(:disabled) {
  background: var(--danger);
  color: #fff;
}

.btn-sm   { padding: 5px 11px; font-size: 12px; }
.btn-full { width: 100%; justify-content: center; }
.btn-grp  { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ── Inputs e formulários ────────────────────────────────── */
input[type="text"],
input[type="number"],
input[type="email"],
select,
textarea {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 11px;
  border-radius: var(--radius);
  font-size: 13px;
  font-family: var(--font);
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--focus);
}
input::placeholder, textarea::placeholder { color: var(--muted-2); }
textarea { resize: vertical; line-height: 1.6; }

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23888' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}

label {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.field { margin-bottom: 13px; }
.row   { display: flex; gap: 12px; margin-bottom: 13px; }
.row > * { flex: 1; min-width: 0; }

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md, 12px);
  padding: 22px 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-soft, 0 4px 14px rgba(31,36,48,0.04));
}
.card-title {
  font-family: var(--serif, Georgia, serif);
  font-size: var(--fs-card, 1.15rem);
  font-weight: 400;
  color: var(--text);
  margin-bottom: 14px;
  letter-spacing: -0.012em;
  line-height: 1.25;
}

/* ── Badges ───────────────────────────────────────────────── */
.badge {
  font-size: 10px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 20px;
  background: var(--surface-3);
  color: var(--muted);
  border: 1px solid var(--border);
}
.badge-ok     { background: var(--success-bg); color: var(--success-text); border-color: var(--success); }
.badge-warn   { background: var(--warning-bg); color: var(--warning-text); border-color: var(--warning); }
.badge-danger { background: var(--danger-bg);  color: var(--danger-text);  border-color: var(--danger); }

/* ── Home panel ────────────────────────────────────────────── */
.home-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}

.home-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md, 12px);
  padding: 28px 22px 24px;
  cursor: pointer;
  transition: border-color var(--tr-base), box-shadow var(--tr-base), transform var(--tr-base);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.home-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--primary);
  opacity: 0;
  transition: opacity 0.18s;
}
.home-card:hover {
  border-color: var(--border-strong);
  box-shadow: 0 6px 20px rgba(31,36,48,0.06);
  transform: translateY(-2px);
}
.home-card:hover::after { opacity: 1; }
.home-card:active { transform: translateY(0); }

.home-card-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-dim);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.home-card strong {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  font-family: var(--serif, Georgia, serif);
  font-size: 0.95rem;
  font-weight: 400;
}
.home-card span { font-size: 12px; color: var(--muted); }

/* Como usar — lista de steps */
.how-to-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.how-to-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.55;
}
.how-to-step {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
  font-family: var(--mono);
  letter-spacing: -0.02em;
}
.how-to-item strong { color: var(--text); font-weight: 600; }

/* ── Barra de estatísticas (Editor) ──────────────────────── */
.stats-bar {
  display: flex;
  gap: 0;
  padding: 8px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  align-items: center;
}
.stat {
  display: flex;
  align-items: baseline;
  gap: 4px;
  padding: 0 14px 0 0;
  border-right: 1px solid var(--border);
  margin-right: 14px;
}
.stat:last-child { border-right: none; }
.stat .val {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.stat .lbl {
  font-size: 10px;
  color: var(--muted-2);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.stat-save { margin-left: auto; border: none !important; padding: 0 !important; margin-right: 0 !important; }

/* ── Barra de ferramentas do editor ──────────────────────── */
.editor-bar {
  display: flex;
  gap: 6px;
  padding: 10px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  align-items: center;
}
.editor-bar .btn-primary {
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* ── Editor com syntax highlight ─────────────────────────── */
#editor-wrap {
  position: relative;
  border-radius: var(--radius);
  border: 1px solid var(--editor-border);
  background: var(--editor-bg);
  flex: 1;
  min-height: 320px;
  margin: 12px 0;
}
#editor-wrap:focus-within {
  border-color: rgba(91,130,168,0.6);
  box-shadow: 0 0 0 3px var(--focus);
}
#editor-mirror {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  padding: 14px 16px;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow: auto;
  pointer-events: none;
  z-index: 1;
  color: rgba(255,255,255,0.55);
  tab-size: 2;
  border-radius: var(--radius);
  overflow-wrap: break-word;
}
#editor-ta {
  position: relative;
  z-index: 2;
  height: 100%;
  min-height: 320px;
  width: 100%;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.55;
  background: transparent;
  border: none;
  outline: none;
  padding: 14px 16px;
  tab-size: 2;
  color: transparent;
  caret-color: rgba(255,255,255,0.85);
  resize: vertical;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: break-word;
  -webkit-text-fill-color: transparent;
}

/* Tokens de highlight */
.hl-sep         { color: #3a4c72; display: block; }
.hl-title       { color: #7ba8e0; font-weight: bold; display: block; }
.hl-placeholder { color: #c89638; background: rgba(200,150,56,.08); border-radius: 2px; }
.hl-cite        { color: #70c090; }
.hl-doi         { color: #58c8d8; text-decoration: underline; text-underline-offset: 2px; }
.hl-label       { color: #a88cd4; font-weight: bold; }
.hl-kw          { color: #a88cd4; }

/* ── Anel de score ───────────────────────────────────────── */
.score-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 20px 24px;
}
.score-ring { position: relative; width: 110px; height: 110px; }
.score-ring svg { transform: rotate(-90deg); }
.ring-bg { stroke: var(--ring-track); fill: none; stroke-width: 8; }
.ring-fg {
  fill: none;
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.8s cubic-bezier(0.4,0,0.2,1), stroke 0.4s;
}
.score-num {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 700;
}
.score-lbl { font-size: 12px; color: var(--muted); text-align: center; }

.score-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.score-item {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  text-align: center;
}
.score-item .n {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
  display: block;
}
.score-item .l {
  font-size: 10px;
  color: var(--muted-2);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: block;
}

/* ── Issues (validação) ───────────────────────────────────── */
.issues { display: flex; flex-direction: column; gap: 5px; margin-top: 4px; }
.issue {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius);
  font-size: 12.5px;
  line-height: 1.45;
  border-left: 3px solid;
}
.issue.warn  { background: var(--warning-bg); border-left-color: var(--warning); color: var(--warning-text); }
.issue.ok    { background: var(--success-bg); border-left-color: var(--success); color: var(--success-text); }
.issue.info  { background: transparent; border-left-color: var(--border-strong); color: var(--muted); }
.issue-detail { opacity: 0.75; font-style: italic; }

/* ── Alertas ──────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  border-left: 3px solid;
  margin-bottom: 16px;
  line-height: 1.55;
}
.alert-warn   { background: var(--warning-bg); border-left-color: var(--warning); color: var(--warning-text); }
.alert-info   { background: var(--info-bg);    border-left-color: var(--info);    color: var(--info-text); }
.alert-danger { background: var(--danger-bg);  border-left-color: var(--danger);  color: var(--danger-text); }
.alert strong { display: block; margin-bottom: 5px; font-size: 13px; font-weight: 600; }
.alert ul     { margin: 6px 0 0 18px; }
.alert li     { margin-bottom: 3px; }

/* ── Cabeçalhos de seção (Template / Wizard) ──────────────── */
.sec-hdr {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 13px;
  border-radius: var(--radius);
  margin-bottom: 14px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid;
  letter-spacing: 0.02em;
}
.sec-hdr .tag {
  margin-left: auto;
  font-size: 10px;
  font-weight: 400;
  opacity: 0.7;
  font-family: var(--mono);
}

.sh-blue   { background: var(--info-bg);    color: var(--info-text);    border-color: var(--info); }
.sh-purple { background: var(--primary-dim);color: var(--primary);      border-color: var(--primary); }
.sh-green  { background: var(--success-bg); color: var(--success-text); border-color: var(--success); }
.sh-orange { background: var(--warning-bg); color: var(--warning-text); border-color: var(--warning); }
.sh-pink   { background: var(--primary-dim);color: var(--primary);      border-color: var(--primary); }
.sh-red    { background: var(--danger-bg);  color: var(--danger-text);  border-color: var(--danger); }

/* ── Wizard — grade de tipos ──────────────────────────────── */
.wiz-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.type-btn {
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
  transition: border-color 0.14s, background 0.14s, box-shadow 0.14s;
  text-align: left;
  font-family: var(--font);
  line-height: 1.35;
  font-weight: 500;
}
.type-btn:hover {
  border-color: var(--primary);
  background: var(--primary-dim);
  box-shadow: 0 2px 8px var(--shadow);
}
.type-btn.sel {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-dim);
  font-weight: 600;
}
.type-btn-sub {
  display: block;
  font-size: 11px;
  color: var(--muted);
  font-weight: 400;
  margin-top: 2px;
}
.type-btn.sel .type-btn-sub { color: var(--primary); opacity: 0.75; }

.cat-lbl {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--muted-2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 16px 0 7px;
  display: block;
}
.cat-lbl:first-child { margin-top: 0; }

/* ── Widget DOI ────────────────────────────────────────────── */
.doi-widget {
  margin-top: 12px;
  padding: 14px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.doi-widget-title {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted-2);
  margin-bottom: 9px;
}
.doi-row { display: flex; gap: 8px; }
.doi-row input { flex: 1; font-family: var(--mono); font-size: 12px; }
.doi-result { margin-top: 10px; padding: 10px 12px; border-radius: var(--radius); font-size: 12px; }
.doi-result.hidden { display: none; }
.doi-loading { background: var(--surface); color: var(--muted); border: 1px solid var(--border); }
.doi-error   { background: var(--danger-bg); color: var(--danger-text); border: 1px solid var(--danger); }
.doi-ok      { background: var(--surface); border: 1px solid var(--border); }
.doi-meta { margin-bottom: 8px; display: flex; flex-direction: column; gap: 2px; }
.doi-meta strong { color: var(--text); font-size: 13px; }
.doi-meta span   { color: var(--muted); font-size: 11px; }
.doi-nbr {
  display: block;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 10px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text);
  word-break: break-all;
  white-space: pre-wrap;
  margin-bottom: 10px;
}
.doi-actions { display: flex; gap: 8px; }

/* ── Autosave ─────────────────────────────────────────────── */
.autosave-status {
  font-size: 11px;
  color: var(--muted-2);
  font-style: italic;
  white-space: nowrap;
}

/* ── Preview ──────────────────────────────────────────────── */
.preview-bar {
  position: sticky;
  top: 0;
  z-index: 11;
  display: flex;
  gap: 8px;
  padding: 9px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
#prev-nav-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 7px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--muted);
  position: sticky;
  top: 43px;
  z-index: 10;
}
#prev-nav-label strong { color: var(--primary); font-weight: 700; }
#preview-outer {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}
#prev-pages {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 20px 40px;
  background: var(--canvas);
}

/* ── Separador ────────────────────────────────────────────── */
.sep { height: 1px; background: var(--border); margin: 12px 0; }

/* ── Utilitários ──────────────────────────────────────────── */
.hidden  { display: none !important; }
.muted   { color: var(--muted); font-size: 12px; }
.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;
}
.spin {
  display: inline-block;
  width: 13px; height: 13px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--text);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

#banner-leve {
  font-size: 12px;
  background: var(--warning-bg);
  color: var(--warning-text);
  padding: 6px 14px;
  text-align: center;
  border-bottom: 1px solid var(--warning);
  flex-shrink: 0;
}

@media print {
  #sidebar, header, .preview-bar, #prev-nav-bar { display: none; }
  #preview-outer { background: none; padding: 0; }
  .page { box-shadow: none; margin: 0; }
}

/* ── Wizard form header ──────────────────────────────────── */
.wiz-form-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.wiz-form-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.wiz-form-title #wiz-tipo-nome {
  font-family: var(--serif, Georgia, serif);
  font-size: 1.05rem;
  font-weight: 400;
  color: var(--text);
  letter-spacing: -0.01em;
}

/* ── Template pós-textuais ───────────────────────────────── */
.postex-group { margin-bottom: 16px; }

/* ── Account panel ───────────────────────────────────────── */
.ac-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  margin-bottom: 14px;
}
.ac-title {
  font-family: var(--serif, Georgia, serif);
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--text);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.ac-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  gap: 12px;
  font-size: 13px;
}
.ac-row:last-child { border-bottom: none; }
.ac-row-lbl { color: var(--muted); flex-shrink: 0; }
.ac-row-val { color: var(--text); text-align: right; font-weight: 500; }
.ac-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 20px;
  background: var(--primary-dim);
  color: var(--primary);
}
.ac-btn-row { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 14px; }
.ac-section-lbl {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 10px;
  display: block;
}
.ac-progress {
  height: 5px;
  background: var(--surface-3);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 8px;
}
.ac-progress-bar {
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
  transition: width 0.4s ease;
}
.ac-hist-list { display: flex; flex-direction: column; gap: 2px; }
.ac-hist-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}
.ac-hist-item:last-child { border-bottom: none; }
.ac-hist-num  { font-family: var(--mono); font-size: 11px; color: var(--muted-2); min-width: 24px; }
.ac-hist-date { font-size: 11px; color: var(--muted-2); margin-left: auto; font-family: var(--mono); }
.ac-loading, .ac-empty {
  text-align: center;
  padding: 28px 0;
  color: var(--muted);
  font-size: 13px;
}

/* ── Validação — estado vazio e score layout ─────────────── */
.v-empty {
  text-align: center;
  padding: 70px 0 60px;
}
.v-score-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.v-score-card {
  min-width: 175px;
  flex-shrink: 0;
}
.v-score-right {
  flex: 2;
  min-width: 220px;
}
.score-num { color: var(--primary); }

/* ── Template — referências e pós-textuais ───────────────── */
.ref-textarea {
  font-family: var(--mono);
  font-size: 12px;
}
.ref-hint {
  margin-top: 7px;
  font-size: 11px;
}
.postex-desc {
  margin-bottom: 14px;
  font-size: 12px;
}
.postex-group-second {
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.v-empty-icon { display: block; margin: 0 auto 14px; }
.mt-sm { margin-top: 9px; }

/* ══════════════════════════════════════════════════════════
   HOME — sistema completo
   ══════════════════════════════════════════════════════════ */

/* Container interno da home */
.home-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 32px;
}

/* ── Hero ─────────────────────────────────────────────────── */
.home-hero {
  padding: 52px 32px 48px;
  max-width: 960px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

.home-hero-left {}

.home-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--secondary);
  margin-bottom: 20px;
}

.home-eyebrow-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--secondary);
  flex-shrink: 0;
}

.home-hero h1 {
  font-family: var(--serif, Georgia, serif);
  font-size: var(--fs-hero, clamp(2.2rem, 3.8vw, 3.8rem));
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 20px;
}

.home-hero h1 em {
  font-style: normal;
  color: var(--primary);
}

.home-hero-subtitle {
  font-size: 15px;
  line-height: 1.7;
  color: var(--muted);
  margin-bottom: 28px;
  max-width: 42ch;
}

.home-hero-ctas {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.home-hero-meta {
  display: flex;
  gap: 24px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.home-hero-meta-item {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.home-hero-meta-item strong {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.home-hero-meta-item span {
  font-size: 10.5px;
  color: var(--muted-2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Documento mockup na hero */
.home-doc-mockup {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg, 14px);
  overflow: hidden;
  box-shadow: var(--shadow-doc, 0 12px 36px rgba(31,36,48,0.08));
}

.home-doc-chrome {
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.home-doc-chrome-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border-strong);
}

.home-doc-chrome-name {
  font-size: 11px;
  color: var(--muted-2);
  font-family: var(--mono);
  margin-left: 4px;
}

.home-doc-body {
  padding: 22px 22px 24px;
  font-family: Georgia, 'Times New Roman', serif;
}

.home-doc-line-title {
  font-size: 10px;
  font-weight: bold;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text);
  margin-bottom: 6px;
}

.home-doc-sep {
  height: 1px;
  background: var(--border);
  margin: 8px 0;
}

.home-doc-line {
  height: 7px;
  background: var(--border);
  border-radius: 2px;
  margin-bottom: 5px;
}

.home-doc-line-short {
  width: 60%;
}

.home-doc-line-med {
  width: 85%;
}

.home-doc-section {
  margin-top: 14px;
}

.home-doc-section-title {
  font-size: 8.5px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text);
  margin-bottom: 6px;
  text-align: center;
}

.home-doc-indent {
  padding-left: 12px;
}

/* ── Cards de entrada ─────────────────────────────────────── */
.home-section {
  padding: 36px 32px;
  max-width: 960px;
  margin: 0 auto;
}

.home-section-divider {
  border-top: 1px solid var(--border);
}

.home-section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--secondary);
  margin-bottom: 8px;
}

.home-section-title {
  font-family: var(--serif, Georgia, serif);
  font-size: var(--fs-section, clamp(1.4rem, 2vw, 2.1rem));
  font-weight: 400;
  color: var(--text);
  letter-spacing: -0.018em;
  line-height: 1.2;
  margin-bottom: 8px;
}

.home-section-sub {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.65;
  margin-bottom: 24px;
  max-width: 58ch;
}

/* ── Seção institucional ──────────────────────────────────── */
.home-institutional {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 42px 32px;
}

.home-institutional-inner {
  max-width: 960px;
  margin: 0 auto;
}

.home-inst-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 28px;
}

.home-inst-card {
  padding: 26px 24px;
  border-radius: var(--r-md, 12px);
  border: 1px solid var(--border);
  background: var(--surface);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.home-inst-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}

.home-inst-card:nth-child(1)::before { background: var(--primary); }
.home-inst-card:nth-child(2)::before { background: var(--highlight); }
.home-inst-card:nth-child(3)::before { background: var(--success); }

.home-inst-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 20px;
  margin-bottom: 12px;
}

.home-inst-tag-blue   { background: var(--primary-dim);   color: var(--primary); }
.home-inst-tag-gold   { background: var(--secondary-dim); color: var(--secondary); }
.home-inst-tag-green  { background: var(--success-bg);    color: var(--success); }

.home-inst-title {
  font-family: var(--serif, Georgia, serif);
  font-size: 1rem;
  font-weight: 400;
  color: var(--text);
  margin-bottom: 10px;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.home-inst-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.home-inst-list li {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.5;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.home-inst-list li::before {
  content: '—';
  color: var(--border-strong);
  flex-shrink: 0;
  font-size: 11px;
  margin-top: 2px;
}

/* ── Sidebar refinada ─────────────────────────────────────── */
.nav-brand {
  padding: 18px 16px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-brand-logo {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.nav-brand-name {
  font-family: var(--serif, Georgia, serif);
  font-size: 1rem;
  font-weight: 400;
  color: var(--primary);
  letter-spacing: -0.01em;
}

/* Nav section com estilo editorial */
.nav-sec {
  padding: 14px 14px 4px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-2);
}

/* Nav item com descrição secundária */
.nav-btn-label {
  display: flex;
  flex-direction: column;
  gap: 1px;
  text-align: left;
}

.nav-btn-desc {
  font-size: 10.5px;
  color: var(--muted-2);
  font-weight: 400;
  line-height: 1;
  transition: color 0.14s;
}

.nav-btn:hover .nav-btn-desc,
.nav-btn.active .nav-btn-desc {
  color: var(--muted);
}

.nav-btn.active .nav-btn-desc {
  color: var(--primary);
  opacity: 0.7;
}

.home-hero-right {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Responsivo: hero em coluna em telas menores */
@media (max-width: 860px) {
  .home-hero {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .home-hero-right { display: none; }
  .home-inst-grid  { grid-template-columns: 1fr; }
  .home-grid       { grid-template-columns: 1fr 1fr; }
}
