.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

/* ---------- Header ---------- */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: var(--sp-5) var(--sp-8);
  background: var(--bg-header);
  border-bottom: 1px solid var(--border-subtle);
}

.brand { display: flex; align-items: center; gap: var(--sp-3); }

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: linear-gradient(155deg, var(--accent), var(--accent-strong));
  color: #fff;
  box-shadow: 0 8px 20px -8px rgba(245, 48, 76, .5);
}

.brand-text h1 { font-size: 20px; }
.brand-text p  { font-size: 13px; color: var(--text-secondary); }

.brand-note {
  font-size: 12px;
  color: var(--text-tertiary);
  text-align: right;
  line-height: 1.4;
  text-decoration: none;
  transition: color var(--dur) var(--ease);
}
.brand-note:hover { color: var(--accent); text-decoration: underline; }

/* ---------- Main — 1 coluna empilhada, largura máxima 1080px, centralizado ---------- */
.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--sp-6);
  padding: var(--sp-6) var(--sp-8);
  max-width: 1080px;
  width: 100%;
  margin: 0 auto;
}

.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.panel-processing { padding: var(--sp-5); }

.panel-processing-header {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  color: var(--text-secondary);
  margin-bottom: var(--sp-4);
}
.panel-processing-header svg { color: var(--accent); }
.panel-processing-header h2 { font-size: 16px; color: var(--text-primary); }

/* ---------- Footer ---------- */
.app-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-8);
  background: var(--bg-header);
  border-top: 1px solid var(--border-subtle);
}

.footer-brand { display: flex; align-items: center; gap: var(--sp-3); color: var(--text-tertiary); }
.footer-brand svg { color: var(--accent); }
.footer-brand strong { display: block; font-size: 14px; color: var(--text-primary); }
.footer-brand span { font-size: 12px; }

.footer-export { display: flex; align-items: center; gap: var(--sp-4); }

/* =========================================================
   MOBILE  (< 860px) — empilha e prioriza toque
   ========================================================= */
@media (max-width: 860px) {
  .app-header {
    padding: var(--sp-4);
    flex-wrap: wrap;
    row-gap: var(--sp-2);
  }
  .brand-note {
    width: 100%;
    text-align: center;
    font-size: 11px;
  }

  .app-main {
    padding: var(--sp-4);
    gap: var(--sp-4);
  }

  .app-footer {
    flex-direction: column;
    align-items: stretch;
    padding: var(--sp-4);
  }
  .footer-brand { justify-content: center; text-align: center; flex-direction: column; gap: var(--sp-1); }
  .footer-export { flex-direction: column; align-items: stretch; }
  .footer-export .btn-primary { width: 100%; justify-content: center; }
}

@media (max-width: 420px) {
  .brand-text h1 { font-size: 17px; }
}
