/* AFK Arena Classic — tema premium */
:root {
  --gold: #f5c518;
  --gold-soft: rgba(245, 197, 24, .14);
  --ink: #0a0e14;
  --panel: #121826;
  --card: #161e30;
  --line: #263252;
}

html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background:
    radial-gradient(1100px 480px at 50% -8%, rgba(245, 197, 24, .09), transparent 60%),
    radial-gradient(900px 500px at 85% 10%, rgba(122, 28, 172, .08), transparent 60%),
    #0a0e14;
}
.font-display { font-family: 'Cinzel', serif; }

/* ---------- cards ---------- */
.hero-card {
  position: relative;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  overflow: hidden;
}
.hero-card::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, .12) 50%, transparent 60%);
  transform: translateX(-120%);
  transition: transform .6s ease;
  pointer-events: none;
}
.hero-card:hover { transform: translateY(-6px); border-color: var(--gold) !important; box-shadow: 0 16px 44px rgba(245, 197, 24, .18); }
.hero-card:hover::after { transform: translateX(120%); }
.hero-card.owned { border-color: rgba(245, 197, 24, .55) !important; }

.glow-SSS { box-shadow: inset 0 0 0 1px rgba(255, 45, 85, .5); }
.glow-SS { box-shadow: inset 0 0 0 1px rgba(255, 149, 0, .5); }
.glow-S { box-shadow: inset 0 0 0 1px rgba(245, 197, 24, .45); }

/* ---------- tiers ---------- */
.tier-SSS { background: linear-gradient(135deg, #ff2d55, #ff7a7a); }
.tier-SS { background: linear-gradient(135deg, #ff9500, #ffc247); }
.tier-S { background: linear-gradient(135deg, #f5c518, #ffe27a); }
.tier-A { background: linear-gradient(135deg, #34c759, #8ef0a5); }
.tier-B { background: linear-gradient(135deg, #2196f3, #7cc4ff); }
.tier-C { background: linear-gradient(135deg, #8e8e93, #c7c7cc); }
.tier-none { background: linear-gradient(135deg, #3a3a3c, #636366); }

/* ---------- animações ---------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.fade-up { animation: fadeUp .35s ease both; }
@keyframes popIn { from { opacity: 0; transform: scale(.96) translateY(10px); } to { opacity: 1; transform: none; } }
.pop-in { animation: popIn .25s ease both; }
@keyframes shimmer { from { background-position: -400px 0; } to { background-position: 400px 0; } }
.skeleton {
  background: linear-gradient(90deg, #161e30 25%, #202a44 50%, #161e30 75%);
  background-size: 800px 100%;
  animation: shimmer 1.4s infinite linear;
}
@keyframes toastIn { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: none; } }
.toast { animation: toastIn .22s ease both; }

/* ---------- filtros / pills ---------- */
.pill { transition: all .15s ease; }
.pill.active { background: var(--gold); color: #111; border-color: var(--gold); font-weight: 700; }

select, input[type="text"], input[type="email"], input[type="password"], input[type="number"] {
  color-scheme: dark;
}

/* ---------- scrollbar ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #0a0e14; }
::-webkit-scrollbar-thumb { background: #2a3550; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #f5c518; }
.no-scrollbar::-webkit-scrollbar { display: none; }

/* ---------- banner ---------- */
.hero-banner {
  background:
    linear-gradient(100deg, rgba(10, 14, 20, .94) 30%, rgba(10, 14, 20, .55) 60%, rgba(10, 14, 20, .2)),
    radial-gradient(600px 300px at 80% 20%, rgba(245, 197, 24, .16), transparent 65%);
  border: 1px solid #263252;
}

/* ---------- modal tabs ---------- */
.mtab.active { background: var(--gold); color: #111; font-weight: 700; }

/* ---------- barras ---------- */
.pbar { height: 8px; border-radius: 99px; background: #0a0e14; overflow: hidden; }
.pbar > div { height: 100%; border-radius: 99px; background: linear-gradient(90deg, #f5c518, #ffe27a); transition: width .5s ease; }


/* =========================================================
   AFK ARENA — visual system v2
   Desktop: command-center / Mobile: native-app feel
   ========================================================= */
:root {
  --gold: #f5c518;
  --gold-bright: #ffe27a;
  --ink: #080b11;
  --panel: #101624;
  --card: #151d2c;
  --card-hover: #1a2437;
  --line: #263552;
  --muted: #8490a6;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; background: var(--ink); overscroll-behavior-y: none; }
body {
  min-height: 100dvh;
  overflow-x: hidden;
  overscroll-behavior-y: none;
  background:
    radial-gradient(900px 500px at 50% -12%, rgba(245,197,24,.12), transparent 65%),
    radial-gradient(700px 500px at 100% 30%, rgba(91,42,134,.08), transparent 65%),
    var(--ink);
}
button, input, select { font: inherit; }
button { touch-action: manipulation; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* subtle atmosphere */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  opacity: .035;
  background-image: radial-gradient(rgba(255,255,255,.9) .6px, transparent .6px);
  background-size: 5px 5px;
}

.app-header { box-shadow: 0 1px 0 rgba(245,197,24,.08), 0 12px 40px rgba(0,0,0,.18); }
.app-header-inner { min-height: 68px; }
.brand { flex: 0 0 auto; }
.header-search input {
  height: 44px;
  background: rgba(16,22,36,.9);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.header-search input:focus { background: #141d2e; box-shadow: 0 0 0 4px rgba(245,197,24,.08); }

/* navigation */
.app-nav { position: relative; z-index: 30; }
.nav-item { min-height: 42px; user-select: none; }
.nav-item:hover { transform: translateY(-1px); }

/* page rhythm */
main { position: relative; }
main > * { animation: pageIn .38s cubic-bezier(.22,1,.36,1) both; }
@keyframes pageIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.hero-banner {
  min-height: 250px;
  background:
    linear-gradient(105deg, rgba(10,14,20,.97) 15%, rgba(10,14,20,.78) 55%, rgba(10,14,20,.34)),
    radial-gradient(500px 260px at 85% 20%, rgba(245,197,24,.18), transparent 70%);
  box-shadow: 0 24px 70px rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.03);
}
.hero-banner::before {
  content: '';
  position: absolute;
  width: 280px; height: 280px;
  right: -80px; top: -100px;
  border-radius: 50%;
  border: 1px solid rgba(245,197,24,.14);
  box-shadow: 0 0 0 35px rgba(245,197,24,.025), 0 0 0 70px rgba(245,197,24,.018);
  pointer-events: none;
}

/* stats become compact information tiles */
main .grid > .bg-panel\/80 { box-shadow: 0 8px 24px rgba(0,0,0,.12); transition: transform .2s, border-color .2s, background .2s; }
main .grid > .bg-panel\/80:hover { transform: translateY(-2px); border-color: rgba(245,197,24,.35); background: rgba(18,26,42,.95); }

/* cards */
.hero-card {
  border-radius: 20px;
  background: linear-gradient(180deg, #172033 0%, #121927 100%);
  box-shadow: 0 8px 22px rgba(0,0,0,.16);
  transform: translateZ(0);
}
.hero-card::after { opacity: .55; }
.hero-card:hover { transform: translateY(-5px) scale(1.012); box-shadow: 0 20px 45px rgba(0,0,0,.32), 0 0 0 1px rgba(245,197,24,.22); }
.hero-card:active { transform: scale(.985); transition-duration: .08s; }
.hero-card > div:first-child { height: 190px; }
.hero-card img { transition: transform .45s cubic-bezier(.22,1,.36,1), filter .3s; }
.hero-card:hover img { transform: scale(1.055); filter: saturate(1.08); }
.hero-card .p-3 { min-height: 86px; }

/* collection / faction / generic panels */
.bg-panel\/80, .bg-panel { box-shadow: 0 10px 30px rgba(0,0,0,.12); }

/* interactive controls */
button { transition: transform .18s cubic-bezier(.22,1,.36,1), filter .18s, border-color .18s, background .18s, box-shadow .18s; }
button:active { transform: scale(.97); }

/* tier rows */
.app-nav + main .space-y-2 > div { box-shadow: 0 7px 20px rgba(0,0,0,.12); }
.app-nav + main .space-y-2 > div > div:last-child button { min-height: 42px; }

/* modal / sheet */
.modal-backdrop { animation: backdropIn .2s ease both; }
.modal-backdrop > div { animation: modalIn .28s cubic-bezier(.22,1,.36,1) both; box-shadow: 0 30px 100px rgba(0,0,0,.55); }
@keyframes backdropIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(16px) scale(.97); } to { opacity: 1; transform: none; } }

/* toast */
.fixed.bottom-5.right-5 { bottom: max(20px, var(--safe-bottom)); }
.toast { backdrop-filter: blur(16px); box-shadow: 0 16px 50px rgba(0,0,0,.4); }

/* stagger catalogue entrance */
.hero-card:nth-child(n+1) { animation: cardIn .42s cubic-bezier(.22,1,.36,1) both; }
.hero-card:nth-child(1) { animation-delay: .02s; }
.hero-card:nth-child(2) { animation-delay: .04s; }
.hero-card:nth-child(3) { animation-delay: .06s; }
.hero-card:nth-child(4) { animation-delay: .08s; }
.hero-card:nth-child(5) { animation-delay: .10s; }
.hero-card:nth-child(6) { animation-delay: .12s; }
@keyframes cardIn { from { opacity: 0; transform: translateY(12px) scale(.985); } to { opacity: 1; transform: none; } }

/* desktop footer is intentionally quiet */
footer { margin-top: 40px; }

/* =========================================================
   MOBILE — app shell
   ========================================================= */
@media (max-width: 767px) {
  body { background: #090c12; }
  .app-header { position: sticky; top: 0; border-bottom-color: rgba(255,255,255,.07); }
  .app-header-inner { min-height: 60px; padding: 10px 14px; gap: 9px; }
  .brand > div:last-child { display: none; }
  .brand > div:first-child { width: 40px; height: 40px; border-radius: 13px; }
  .brand { order: 1; }
  .header-search { order: 3; flex-basis: 100%; min-width: 0 !important; }
  .header-search input { height: 42px; border-radius: 14px; font-size: 14px; }
  .app-header-inner > :last-child { order: 2; margin-left: auto; }
  .app-header-inner > :last-child button { min-height: 40px; padding-inline: 13px; border-radius: 12px; }
  .app-header-inner > :last-child span:first-child { display: none; }
  .app-header-inner > :last-child span:nth-child(2) { display: inline-flex; align-items: center; min-height: 32px; }

  /* native tab bar */
  .app-nav {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 60;
    height: calc(64px + var(--safe-bottom));
    padding: 6px 8px var(--safe-bottom);
    margin: 0;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
    max-width: none;
    background: rgba(10,14,20,.94);
    border-top: 1px solid rgba(255,255,255,.08);
    backdrop-filter: blur(24px) saturate(140%);
    box-shadow: 0 -12px 35px rgba(0,0,0,.28);
  }
  .nav-item {
    min-height: 54px;
    padding: 4px 2px !important;
    border: 0 !important;
    border-radius: 13px !important;
    background: transparent !important;
    box-shadow: none !important;
    color: #778298 !important;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    font-size: 9px !important;
    font-weight: 700;
    line-height: 1.1;
  }
  .nav-item span { font-size: 21px; line-height: 23px; filter: grayscale(.35); }
  .nav-item:hover { transform: none; }
  .nav-item:active { transform: scale(.9); }
  .nav-item.bg-gold { color: var(--gold) !important; }
  .nav-item.bg-gold span { filter: none; transform: translateY(-1px); }
  .nav-item.bg-gold::after {
    content: '';
    width: 4px; height: 4px;
    border-radius: 50%;
    background: var(--gold);
    box-shadow: 0 0 10px var(--gold);
  }

  main { padding-bottom: calc(86px + var(--safe-bottom)) !important; }
  main.max-w-7xl { padding-left: 14px; padding-right: 14px; }
  footer { display: none; }

  .hero-banner {
    min-height: 0;
    margin-top: 14px;
    padding: 20px;
    border-radius: 22px;
  }
  .hero-banner h1 { font-size: 25px; line-height: 1.12; }
  .hero-banner p { font-size: 12px; line-height: 1.6; }
  .hero-banner .flex.gap-2 { display: grid; grid-template-columns: 1fr 1fr; }
  .hero-banner .flex.gap-2 button { width: 100%; min-height: 44px; }
  .hero-banner .flex.gap-2 button:last-child { grid-column: 1 / -1; }
  .hero-banner > div:last-child { width: 100%; }

  /* section titles */
  .border-l-4 { border-left-width: 3px; }
  .font-display.text-xl { font-size: 18px; }

  /* cards: denser, thumb-first native grid */
  .hero-card { border-radius: 17px; }
  .hero-card > div:first-child { height: 148px; }
  .hero-card .p-3 { padding: 10px; min-height: 78px; }
  .hero-card h3 { font-size: 12px; }
  .hero-card .flex.gap-1\.5 { gap: 3px; }
  .hero-card .flex.gap-1\.5 span { padding: 3px 4px; font-size: 8px; }
  .hero-card button { width: 38px; height: 38px; }

  /* force catalogue grids to true app density */
  main .grid.grid-cols-2 { gap: 9px; }
  main .grid.sm\\:grid-cols-2 { gap: 9px; }

  /* stats */
  main .grid.grid-cols-2.md\\:grid-cols-4 { gap: 8px; }
  main .grid.grid-cols-2.md\\:grid-cols-4 > div { padding: 11px; border-radius: 15px; min-height: 68px; }
  main .grid.grid-cols-2.md\\:grid-cols-4 > div > div:first-child { font-size: 20px; }
  main .grid.grid-cols-2.md\\:grid-cols-4 .text-xl { font-size: 17px; }

  /* filters become horizontally scrollable chips */
  .bg-panel\\/80.border.border-line.rounded-2xl.p-3 { border-radius: 17px; }
  .bg-panel\\/80 .flex.gap-1\\.5.flex-wrap { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
  .bg-panel\\/80 .flex.gap-1\\.5.flex-wrap::-webkit-scrollbar { display: none; }
  .pill { white-space: nowrap; min-height: 36px; }
  select { min-height: 42px; flex: 1 1 140px; }

  /* tier list horizontal content */
  .app-nav + main .space-y-2 > div { border-radius: 15px; }
  .app-nav + main .space-y-2 > div > div:first-child { min-width: 46px; }
  .app-nav + main .space-y-2 > div > div:last-child { padding: 7px; gap: 6px; }
  .app-nav + main .space-y-2 > div > div:last-child button { min-height: 38px; padding: 4px 8px 4px 4px; }

  /* modal becomes bottom sheet */
  .modal-backdrop { align-items: flex-end; padding: 0; }
  .modal-backdrop > div {
    width: 100% !important;
    max-width: none !important;
    max-height: 92dvh !important;
    border-radius: 24px 24px 0 0 !important;
    border-left: 0 !important;
    border-right: 0 !important;
    border-bottom: 0 !important;
    padding-bottom: max(18px, var(--safe-bottom));
    animation: sheetIn .3s cubic-bezier(.22,1,.36,1) both;
  }
  @keyframes sheetIn { from { transform: translateY(100%); opacity: .8; } to { transform: translateY(0); opacity: 1; } }
  .modal-backdrop > div::before {
    content: '';
    position: absolute;
    top: 7px; left: 50%; transform: translateX(-50%);
    width: 38px; height: 4px; border-radius: 99px;
    background: rgba(255,255,255,.25);
    z-index: 20;
  }
  .modal-backdrop > div > div:first-child { border-radius: 24px 24px 0 0; }
  .modal-backdrop .flex.gap-2.px-5 { overflow-x: auto; padding-inline: 14px; scrollbar-width: none; }
  .modal-backdrop .flex.gap-2.px-5::-webkit-scrollbar { display: none; }
  .modal-backdrop .mtab { min-height: 40px; white-space: nowrap; }

  /* touch targets */
  .hero-card, .nav-item, .pill, select, button { -webkit-user-select: none; user-select: none; }
}

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


/* Home v2 */
.home-action { min-height: 126px; position: relative; overflow: hidden; transition: transform .2s cubic-bezier(.22,1,.36,1), border-color .2s, background .2s, box-shadow .2s; }
.home-action::after { content:''; position:absolute; width:90px; height:90px; right:-35px; bottom:-40px; border-radius:50%; background:rgba(245,197,24,.06); transition:transform .3s; }
.home-action:hover { transform:translateY(-3px); background:#182236; box-shadow:0 14px 30px rgba(0,0,0,.18); }
.home-action:hover::after { transform:scale(1.5); }
.home-action:active { transform:scale(.98); }
@media (max-width:767px) {
  .home-action { min-height:112px; padding:12px !important; border-radius:16px; }
  .home-action div:first-child { font-size:21px; margin-bottom:6px; }
  .home-action b { font-size:12px; }
  .home-action span { font-size:9px; line-height:1.35; display:block; }
}

/* Catalog + collection polish */
.catalog-head{background:linear-gradient(135deg,rgba(245,197,24,.07),rgba(18,24,38,.92));box-shadow:0 10px 30px rgba(0,0,0,.12)}
.catalog-stat{padding:.55rem .75rem;border:1px solid var(--line,#273244);border-radius:.75rem;background:rgba(10,14,20,.55);font-weight:700;transition:all .2s}
.catalog-stat:hover{border-color:#f5c518;color:#f5c518;transform:translateY(-1px)}
.catalog-results{animation:fadeUp .35s ease both}
.collection-kpi{min-height:105px;padding:1rem;border:1px solid var(--line,#273244);border-radius:1rem;background:linear-gradient(145deg,rgba(18,24,38,.95),rgba(12,17,26,.95));display:flex;flex-direction:column;align-items:flex-start;justify-content:center;text-align:left;transition:transform .2s,border-color .2s,box-shadow .2s}
.collection-kpi span{font-size:1.25rem}.collection-kpi b{font-size:1.45rem;color:#f5c518;line-height:1.1;margin-top:.25rem}.collection-kpi small{font-size:.68rem;color:#94a3b8;margin-top:.3rem}.collection-kpi-action{cursor:pointer}.collection-kpi-action:hover{transform:translateY(-2px);border-color:#f5c518;box-shadow:0 12px 28px rgba(0,0,0,.18)}
@media(max-width:767px){.catalog-head{padding:.8rem;border-radius:1rem}.catalog-stat{flex:1;text-align:center;padding:.55rem .35rem;font-size:.68rem}.collection-kpi{min-height:92px;padding:.75rem;border-radius:.9rem}.collection-kpi b{font-size:1.25rem}.collection-kpi small{font-size:.62rem}.catalog-results{margin-top:1rem}}
/* AI + ADMIN command center */
.card-glass{background:linear-gradient(145deg,rgba(18,25,38,.96),rgba(11,16,25,.96));border:1px solid rgba(117,132,166,.18);box-shadow:0 18px 50px rgba(0,0,0,.2)}
.ai-page,.admin-page{padding-bottom:2rem}.ai-hero,.admin-hero{display:flex;justify-content:space-between;align-items:center;gap:20px;padding:26px 30px;border:1px solid rgba(245,197,24,.18);border-radius:26px;background:radial-gradient(500px 180px at 80% 0,rgba(245,197,24,.13),transparent 70%),linear-gradient(135deg,#141d2e,#0e141f);overflow:hidden;position:relative}
.ai-hero:after,.admin-hero:after{content:'';position:absolute;width:220px;height:220px;border:1px solid rgba(245,197,24,.1);border-radius:50%;right:-90px;top:-120px;box-shadow:0 0 0 30px rgba(245,197,24,.025),0 0 0 60px rgba(245,197,24,.018)}
.ai-kicker{font-size:10px;font-weight:900;letter-spacing:.2em;color:#f5c518;margin-bottom:7px}.ai-hero h1,.admin-hero h1{font-size:29px;margin:0;position:relative;z-index:1}.ai-hero h1 span,.admin-hero h1 span{color:#f5c518}.ai-hero p,.admin-hero p{color:#8490a6;font-size:12px;margin-top:6px;max-width:650px}.ai-live{padding:10px 14px;border:1px solid rgba(74,222,128,.2);border-radius:14px;background:rgba(34,197,94,.05);font-size:11px;color:#86efac;white-space:nowrap;z-index:1}.ai-dot{display:inline-block;width:7px;height:7px;background:#4ade80;border-radius:50%;box-shadow:0 0 12px #4ade80;margin-right:7px}
.ai-layout{display:grid;grid-template-columns:minmax(0,1fr) 330px;gap:16px;margin-top:16px}.ai-chat{min-height:620px;border-radius:26px;display:flex;flex-direction:column;overflow:hidden}.ai-chat-head{padding:15px 18px;border-bottom:1px solid rgba(117,132,166,.14);display:flex;align-items:center;justify-content:space-between}.ai-avatar{width:40px;height:40px;border-radius:13px;display:grid;place-items:center;background:linear-gradient(145deg,#f5c518,#a66f00);box-shadow:0 8px 22px rgba(245,197,24,.16)}.ai-chat-head b{font-size:14px}.ai-clear,.ghost-btn{border:1px solid #263552;background:#151d2c;color:#9aa6ba;border-radius:10px;padding:8px 11px;font-size:10px}.ai-body{flex:1;padding:22px;min-height:390px}.ai-welcome{text-align:center;max-width:620px;margin:34px auto}.ai-orb{width:58px;height:58px;margin:auto;display:grid;place-items:center;border-radius:18px;background:rgba(245,197,24,.08);border:1px solid rgba(245,197,24,.2);font-size:25px}.ai-welcome h2{font-size:20px;margin-top:13px}.ai-welcome p{font-size:12px;color:#8490a6}.ai-quick{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:22px;text-align:left}.ai-quick button{padding:13px;border:1px solid #263552;background:#151d2c;border-radius:13px;color:#c7d0df;font-size:11px;text-align:left}.ai-quick button:hover{border-color:#f5c518;transform:translateY(-2px);background:#192338}.ai-quick span{float:right;color:#f5c518}.ai-thinking{display:flex;align-items:center;gap:13px;padding:18px;border:1px solid rgba(245,197,24,.15);border-radius:16px;background:rgba(245,197,24,.04)}.ai-thinking-icon{width:38px;height:38px;display:grid;place-items:center;border-radius:12px;background:rgba(245,197,24,.1);color:#f5c518;animation:pulseAi 1.2s infinite}.ai-thinking p{font-size:11px;color:#8490a6;margin-top:3px}.ai-thinking>span{margin-left:auto;color:#f5c518;font-size:11px}@keyframes pulseAi{50%{transform:scale(1.08);box-shadow:0 0 22px rgba(245,197,24,.15)}}
 .ai-answer{max-width:900px;margin:auto}.ai-answer-head{display:flex;justify-content:space-between;gap:10px;align-items:center;border-bottom:1px solid #263552;padding-bottom:10px;margin-bottom:15px}.ai-answer-head span{font-size:9px;letter-spacing:.15em;font-weight:900;color:#f5c518}.ai-answer-head small{font-size:9px;color:#66738b}.ai-answer-text{white-space:pre-wrap;font-size:13px;line-height:1.8;color:#d6deea}.ai-composer{padding:14px 16px;border-top:1px solid rgba(117,132,166,.14);position:relative}.ai-composer textarea{width:100%;min-height:68px;resize:none;padding:13px 52px 24px 14px;background:#0b1019;border:1px solid #263552;border-radius:15px;color:#e5e7eb;outline:none;font-size:12px}.ai-composer textarea:focus{border-color:#f5c518;box-shadow:0 0 0 3px rgba(245,197,24,.07)}.ai-send{position:absolute;right:25px;top:24px;width:38px;height:38px;border-radius:11px;background:#f5c518;color:#111;font-size:20px;font-weight:900}.ai-send:disabled{opacity:.35}.ai-hint{font-size:9px;color:#59667c;margin-top:5px}.ai-sidebar{display:flex;flex-direction:column;gap:12px}.ai-config,.ai-history,.ai-info{border-radius:20px;padding:17px}.ai-side-title,.side-heading{display:flex;gap:10px;align-items:center;margin-bottom:15px}.ai-side-title>span{font-size:20px}.ai-side-title b,.side-heading h3{font-size:13px}.ai-side-title small,.side-heading small{display:block;font-size:9px;color:#69758a;margin-top:2px}.ai-config label{display:block;font-size:8px;letter-spacing:.12em;color:#66738b;font-weight:800;margin-top:11px}.ai-config select,.ai-config label>input:not([type=checkbox]){display:block;width:100%;margin-top:5px;padding:10px 11px;background:#0b1019;border:1px solid #263552;border-radius:11px;color:#dce3ee;font-size:11px;outline:none}.ai-config select:focus,.ai-config label>input:focus{border-color:#f5c518}.ai-switch{display:flex!important;align-items:center;gap:10px;padding:10px;background:#0b1019;border:1px solid #263552;border-radius:11px;letter-spacing:0!important}.ai-switch span{flex:1}.ai-switch b{display:block;color:#dce3ee;font-size:10px;letter-spacing:0}.ai-switch small{display:block;color:#68758a;font-size:9px;margin-top:3px}.ai-switch input{display:none}.ai-switch i{width:35px;height:20px;background:#263552;border-radius:99px;position:relative}.ai-switch i:after{content:'';position:absolute;width:14px;height:14px;top:3px;left:3px;border-radius:50%;background:#8490a6;transition:.2s}.ai-switch input:checked+i{background:#b58b00}.ai-switch input:checked+i:after{left:18px;background:#fff}.ai-build{width:100%;margin-top:13px;padding:11px;border-radius:11px;background:linear-gradient(135deg,#f5c518,#d99f00);color:#111;font-size:11px;font-weight:900}.ai-history>b{font-size:11px;color:#dce3ee}.ai-history button{width:100%;display:flex;justify-content:space-between;gap:8px;text-align:left;margin-top:8px;padding:9px;border-radius:10px;background:#0b1019;border:1px solid #202c43;color:#9ca8bb;font-size:9px}.ai-history button small{color:#536078}.ai-info{display:flex;gap:10px;background:rgba(34,197,94,.035)}.ai-info>div{color:#4ade80;font-weight:900}.ai-info p{font-size:10px;color:#aab4c5;line-height:1.5}.ai-info span{color:#657289}
 .admin-hero{margin-bottom:16px}.admin-summary{min-width:115px;text-align:center;padding:13px 16px;border-radius:16px;background:rgba(245,197,24,.06);border:1px solid rgba(245,197,24,.18);z-index:1}.admin-summary b{display:block;font-size:24px;color:#f5c518}.admin-summary small{font-size:9px;color:#78859b}.admin-grid{display:grid;grid-template-columns:minmax(0,1fr) 330px;gap:16px}.admin-main,.admin-side{display:flex;flex-direction:column;gap:16px}.admin-section{border-radius:24px;padding:18px}.admin-section-head{display:flex;align-items:flex-start;justify-content:space-between;gap:15px;margin-bottom:15px}.admin-section-head h2{font-size:15px}.admin-section-head p{font-size:10px;color:#69758a;margin-top:4px}.admin-status{font-size:9px;color:#4ade80;padding:7px 10px;border:1px solid rgba(74,222,128,.2);border-radius:9px;white-space:nowrap}.route-flow{display:flex;align-items:center;gap:8px;padding:12px;border-radius:15px;background:#0b1019;border:1px solid #202c43;overflow:auto}.route-node{min-width:130px;padding:10px;border:1px solid #263552;border-radius:12px;background:#151d2c}.route-node.primary{border-color:rgba(245,197,24,.5);box-shadow:0 0 20px rgba(245,197,24,.05)}.route-node b{font-size:9px;color:#f5c518}.route-node span{display:block;font-size:11px;font-weight:800;margin-top:3px}.route-node small{display:block;font-size:8px;color:#657289;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-top:3px}.route-arrow{color:#f5c518}.empty-admin{font-size:11px;color:#eab308;padding:8px}.provider-list{margin-top:12px;display:flex;flex-direction:column;gap:7px}.provider-row{display:grid;grid-template-columns:54px 40px minmax(0,1fr) auto;align-items:center;gap:11px;padding:11px;border-radius:15px;background:#151d2c;border:1px solid #202c43;position:relative;transition:.2s}.provider-row:hover{border-color:#3b4a68;transform:translateX(2px)}.provider-row.is-primary{border-color:rgba(245,197,24,.3);background:linear-gradient(90deg,rgba(245,197,24,.045),#151d2c)}.provider-row.is-off{opacity:.55}.provider-order{display:flex;align-items:center;gap:4px}.provider-order button{width:20px;height:22px;border:1px solid #263552;border-radius:6px;background:#0b1019;color:#8490a6;font-size:9px}.provider-order strong{font-size:12px;color:#f5c518;min-width:13px;text-align:center}.provider-icon{width:40px;height:40px;border-radius:12px;display:grid;place-items:center;background:#0b1019;border:1px solid #263552;color:#f5c518;font-weight:900}.provider-info{min-width:0}.provider-info b{font-size:12px}.provider-info span,.provider-info em{font-style:normal;font-size:7px;padding:3px 6px;border-radius:99px;margin-left:7px;background:rgba(245,197,24,.1);color:#f5c518}.provider-info em{color:#8390a7;background:#202a3c}.provider-info p{font-size:10px;color:#c3ccda;margin-top:4px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.provider-info small{font-size:8px;color:#56647b;display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.provider-actions{display:flex;gap:5px}.provider-actions button{font-size:9px;padding:7px 8px;border:1px solid #263552;border-radius:8px;background:#101724;color:#aab4c5}.provider-actions .test-btn{color:#86efac;border-color:rgba(74,222,128,.2)}.provider-actions .danger{color:#fca5a5}.key-state{position:absolute;right:11px;bottom:7px;font-size:7px}.key-state.ok{color:#4ade80}.key-state.warn{color:#f59e0b}.provider-form{display:grid;grid-template-columns:1fr 1fr;gap:9px}.provider-form label{font-size:9px;color:#7b879c}.provider-form input:not([type=checkbox]){display:block;width:100%;margin-top:4px;padding:10px 11px;background:#0b1019;border:1px solid #263552;border-radius:10px;color:#e5e7eb;font-size:10px;outline:none}.form-check{display:flex;align-items:center;gap:7px;padding:10px;background:#0b1019;border:1px solid #263552;border-radius:10px}.save-btn{border-radius:10px;background:#f5c518;color:#111;font-weight:900;font-size:10px}.user-row{display:flex;align-items:center;gap:9px;padding:9px;border:1px solid #202c43;background:#0b1019;border-radius:12px;margin-top:7px}.user-avatar{width:32px;height:32px;border-radius:10px;display:grid;place-items:center;background:#202b40;color:#f5c518;font-weight:900}.user-row>div:nth-child(2){min-width:0;flex:1}.user-row b,.user-row small{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.user-row b{font-size:10px}.user-row small{font-size:8px;color:#657289;margin-top:2px}.user-row button{font-size:8px;padding:7px 8px;border:1px solid #263552;border-radius:8px;color:#8c99ad;background:#151d2c}.user-row button.admin-on{color:#f5c518;border-color:rgba(245,197,24,.3)}.knowledge-item{margin-top:8px;padding:10px;border:1px solid #202c43;background:#0b1019;border-radius:11px}.knowledge-item b{font-size:10px;color:#dce3ee}.knowledge-item p{font-size:9px;line-height:1.55;color:#68758a;margin-top:4px;max-height:130px;overflow:auto}
@media(max-width:900px){.ai-layout,.admin-grid{grid-template-columns:1fr}.ai-sidebar{display:grid;grid-template-columns:1fr 1fr}.ai-config{grid-column:1/-1}.admin-side{display:grid;grid-template-columns:1fr 1fr}.ai-hero h1,.admin-hero h1{font-size:25px}}
@media(max-width:767px){.ai-page,.admin-page{padding-bottom:1rem}.ai-hero,.admin-hero{padding:19px;border-radius:20px;align-items:flex-start}.ai-hero h1,.admin-hero h1{font-size:22px}.ai-hero p,.admin-hero p{font-size:10px}.ai-live,.admin-summary{display:none}.ai-layout{margin-top:10px}.ai-chat{min-height:calc(100dvh - 170px);border-radius:20px}.ai-chat-head{padding:12px}.ai-body{padding:14px;min-height:300px}.ai-welcome{margin:18px auto}.ai-welcome h2{font-size:17px}.ai-quick{grid-template-columns:1fr;gap:6px;margin-top:15px}.ai-quick button{padding:11px}.ai-composer{padding:10px}.ai-composer textarea{min-height:64px}.ai-sidebar{display:flex}.ai-config{padding:14px}.ai-history,.ai-info{display:none}.admin-grid{gap:10px}.admin-section{padding:14px;border-radius:18px}.admin-section-head{display:block}.admin-status{display:inline-block;margin-top:9px}.route-flow{padding:9px}.route-node{min-width:110px}.provider-row{grid-template-columns:45px 36px minmax(0,1fr);gap:8px;padding:9px}.provider-icon{width:36px;height:36px}.provider-actions{grid-column:3;justify-content:flex-start;margin-top:5px}.provider-actions button{padding:7px}.key-state{right:9px;top:9px;bottom:auto}.provider-form{grid-template-columns:1fr}.admin-side{display:flex}.user-row{min-height:52px}}

/* AI rich markdown + hero mentions */
.ai-answer-text{white-space:normal;font-size:13px;line-height:1.75;color:#d6deea}
.ai-answer-text p{margin:0 0 12px}.ai-answer-text h1,.ai-answer-text h2,.ai-answer-text h3{font-family:Cinzel,serif;color:#f5c518;font-weight:800;line-height:1.3;margin:18px 0 9px}.ai-answer-text h1{font-size:20px}.ai-answer-text h2{font-size:17px}.ai-answer-text h3{font-size:14px}.ai-answer-text hr{border:0;border-top:1px solid #263552;margin:17px 0}.ai-md-space{height:4px}.ai-md-item{margin:5px 0;padding-left:7px}
.ai-hero-chip{display:inline-flex;align-items:center;gap:5px;vertical-align:middle;margin:0 2px;padding:2px 7px 2px 3px;border:1px solid rgba(245,197,24,.28);background:rgba(245,197,24,.07);border-radius:999px;color:#f8d95a;font-weight:700;line-height:1.2;white-space:nowrap}.ai-hero-chip img{width:24px;height:24px;border-radius:50%;object-fit:cover;border:1px solid rgba(255,255,255,.2);box-shadow:0 2px 7px rgba(0,0,0,.35)}.ai-hero-name{font-weight:700;color:#f8d95a}
@media(max-width:767px){.ai-answer-text{font-size:12px;line-height:1.7}.ai-hero-chip{padding-right:5px}.ai-hero-chip img{width:22px;height:22px}}
.ai-conversation{display:flex;flex-direction:column;gap:14px}
.ai-message{border:1px solid #263552;border-radius:18px;padding:13px 15px;max-width:94%;animation:fadeUp .22s ease}
.ai-message-user{align-self:flex-end;background:rgba(245,197,24,.08);border-color:rgba(245,197,24,.25)}
.ai-message-ai{align-self:flex-start;background:rgba(15,23,42,.72)}
.ai-message-label{font-size:10px;font-weight:800;letter-spacing:.08em;text-transform:uppercase;color:#71809a;margin-bottom:7px}
.ai-message-user .ai-message-label{color:#d7b52b}
.ai-message-text{font-size:13px;line-height:1.65;color:#e5e7eb;white-space:pre-wrap}
.ai-message-ai .ai-answer-text{font-size:13px}
@media(max-width:767px){.ai-message{max-width:100%;padding:11px 12px}.ai-message-text,.ai-message-ai .ai-answer-text{font-size:12px}}

/* ============ layout v3: navbar + sidebar colada à esquerda ============ */
.app-shell{display:flex;align-items:stretch;max-width:none;margin:0;padding:0}
.app-content{flex:1;min-width:0;padding:0 28px 80px}
.app-content-inner{max-width:1160px;margin:0 auto;width:100%}
@media(max-width:1023px){.app-content{padding:0 14px 110px}.app-content-inner{max-width:none}}
/* sidebar fixa, colada na esquerda, altura total abaixo do header */
.app-sidebar{position:sticky;top:65px;height:calc(100vh - 65px);width:252px;flex:0 0 252px;margin:0;border:0;border-right:1px solid rgba(255,255,255,.07);border-radius:0;background:rgba(10,14,20,.92);backdrop-filter:blur(18px);box-shadow:none;flex-direction:column;overflow-y:auto;overflow-x:hidden}
.sidebar-nav{padding:18px 12px 12px;display:flex;flex-direction:column;gap:20px}
.sidebar-group{display:flex;flex-direction:column;gap:8px}
.sidebar-links{display:flex;flex-direction:column;gap:2px}
.sidebar-title{font-size:10px;font-weight:800;letter-spacing:.18em;text-transform:uppercase;color:#5b6a85;margin:0 10px 2px}
.sidebar-item{position:relative;display:flex;align-items:center;gap:11px;min-height:44px;padding:7px 12px 7px 10px;border-radius:12px;color:#aeb9cf;font-size:13.5px;font-weight:600;border:1px solid transparent;text-decoration:none;transition:background .15s,color .15s,border-color .15s}
.sidebar-item::before{content:'';position:absolute;left:0;top:9px;bottom:9px;width:3px;border-radius:99px;background:transparent;transition:background .15s}
.sidebar-item:hover{background:rgba(255,255,255,.045);color:#fff;border-color:transparent;transform:none}
.sidebar-ic{width:32px;height:32px;flex:0 0 32px;display:grid;place-items:center;font-size:16px;border-radius:10px;background:rgba(255,255,255,.05);border:1px solid rgba(255,255,255,.06)}
.sidebar-label{flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sidebar-badge{font-size:10px;font-weight:800;min-width:24px;text-align:center;padding:3px 7px;border-radius:99px;background:rgba(245,197,24,.12);border:1px solid rgba(245,197,24,.3);color:#f5c518}
.sidebar-item.active{background:rgba(245,197,24,.09);border-color:rgba(245,197,24,.22);color:#f8d95a}
.sidebar-item.active::before{background:#f5c518;box-shadow:0 0 10px rgba(245,197,24,.8)}
.sidebar-item.active .sidebar-ic{background:rgba(245,197,24,.14);border-color:rgba(245,197,24,.35)}
.sidebar-item.admin.active{background:rgba(248,113,113,.08);border-color:rgba(248,113,113,.3);color:#fca5a5}
.sidebar-item.admin.active::before{background:#f87171;box-shadow:0 0 10px rgba(248,113,113,.7)}
.sidebar-foot{margin-top:auto;padding:14px;border-top:1px solid rgba(255,255,255,.06)}
.sidebar-meta b{display:block;font-size:11px;color:#c7d0df}
.sidebar-meta span{font-size:10px;color:#5b6a85}
.app-sidebar::-webkit-scrollbar{width:6px}
.app-sidebar::-webkit-scrollbar-thumb{background:#232f49}
.navbar-burger{width:40px;height:40px;border-radius:12px;border:1px solid #263552;background:#151d2c;color:#c7d0df}
.navbar-avatar{width:32px;height:32px;border-radius:10px;display:grid;place-items:center;font-weight:800;background:linear-gradient(145deg,#f5c518,#a66f00);color:#111}
.navbar-menu{position:absolute;right:0;top:calc(100% + 8px);min-width:230px;background:#121826;border:1px solid #2a3550;border-radius:16px;box-shadow:0 24px 60px rgba(0,0,0,.45);overflow:hidden;z-index:50}
.navbar-menu-head{padding:12px 14px;border-bottom:1px solid #202c43}.navbar-menu-head b{display:block;font-size:13px}.navbar-menu-head small{font-size:11px;color:#8490a6}
.navbar-menu a,.navbar-menu button{display:flex;width:100%;text-align:left;padding:11px 14px;font-size:13px;color:#c7d0df;background:none;border:0;text-decoration:none}
.navbar-menu a:hover,.navbar-menu button:hover{background:#1a2437;color:#f5c518}
.navbar-menu .danger{color:#f87171}
.breadcrumbs{display:flex;align-items:center;gap:8px;font-size:12px;color:#8490a6;margin:14px 2px 0}
.breadcrumbs a{color:#8490a6;text-decoration:none}.breadcrumbs a:hover{color:#f5c518}
.breadcrumbs b{color:#e5e7eb}
/* perfil */
.profile-hero{display:flex;gap:16px;align-items:center;padding:20px;border-radius:22px;flex-wrap:wrap}
.profile-avatar{width:64px;height:64px;border-radius:20px;display:grid;place-items:center;font-size:26px;font-weight:800;background:linear-gradient(145deg,#f5c518,#a66f00);color:#111;box-shadow:0 10px 26px rgba(245,197,24,.2)}
.profile-chip{font-size:11px;font-weight:700;padding:6px 10px;border-radius:99px;background:#0b1019;border:1px solid #263552;color:#c7d0df}
.profile-btn{padding:10px 14px;border-radius:12px;background:#f5c518;color:#111;font-size:12px;font-weight:800}
.profile-btn.ghost{background:#151d2c;color:#c7d0df;border:1px solid #263552}
.profile-card{border-radius:20px;padding:18px}
.profile-card h3{font-size:14px;margin-bottom:4px}
.profile-card label{display:block;font-size:10px;letter-spacing:.1em;font-weight:800;color:#69758a;margin-top:12px}
.profile-card label input,.profile-card label textarea{display:block;width:100%;margin-top:6px;padding:11px;background:#0b1019;border:1px solid #263552;border-radius:11px;color:#e5e7eb;font-size:13px;letter-spacing:0;text-transform:none;font-weight:400}
.profile-progress{margin-top:16px}
.profile-danger{margin-top:18px;padding:12px;border:1px solid rgba(248,113,113,.25);border-radius:14px;background:rgba(248,113,113,.05)}
.profile-danger b{font-size:12px}.profile-danger p{font-size:11px;color:#8490a6;margin:4px 0 10px}
.danger-btn{padding:9px 12px;border-radius:10px;border:1px solid rgba(248,113,113,.4);color:#f87171;background:none;font-size:12px;font-weight:700}
/* admin v3 */
.admin-tabs{display:flex;gap:8px;margin:14px 0;flex-wrap:wrap}
.admin-tab{padding:10px 14px;border-radius:12px;border:1px solid #263552;background:#151d2c;color:#9aa6ba;font-size:12px;font-weight:700}
.admin-tab.active{background:#f5c518;color:#111;border-color:#f5c518}
.admin-kpis{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin-bottom:4px}
.admin-kpi{padding:16px;border:1px solid rgba(117,132,166,.16);border-radius:18px;background:linear-gradient(145deg,#141d2e,#0d1420);text-align:center}
.admin-kpi span{font-size:22px}.admin-kpi b{display:block;font-size:24px;color:#f5c518;margin-top:6px}.admin-kpi small{font-size:11px;color:#8490a6}
.admin-search{padding:10px 12px;background:#0b1019;border:1px solid #263552;border-radius:11px;color:#e5e7eb;font-size:12px;min-width:220px}
.user-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:8px;margin-top:12px}
.danger-text{color:#f87171!important}
.provider-form textarea{width:100%;margin-top:5px;padding:11px;background:#0b1019;border:1px solid #263552;border-radius:11px;color:#dce3ee;font-size:12px;min-height:90px;resize:vertical}
/* IA v3 */
.ai-quick-group{margin-top:14px;text-align:left}.ai-quick-group>b{font-size:11px;color:#f5c518;letter-spacing:.06em}
.ai-quick-group .ai-quick{margin-top:8px}
.ai-copy{margin-top:10px;font-size:11px;padding:7px 11px;border-radius:9px;border:1px solid #263552;background:#0b1019;color:#9aa6ba}
.ai-copy:hover{border-color:#f5c518;color:#f5c518}
.ai-body{max-height:560px;overflow:auto}
@media(max-width:1023px){.admin-kpis{grid-template-columns:repeat(2,1fr)}.ai-body{max-height:none}}
@media(max-width:767px){
  .app-header-inner{flex-wrap:nowrap}
  .navbar-menu{position:fixed;left:12px;right:12px;top:64px;min-width:0}
  .profile-hero{padding:16px}.profile-avatar{width:52px;height:52px;font-size:22px}
  .admin-kpis{grid-template-columns:1fr 1fr;gap:8px}.admin-kpi{padding:12px}.admin-kpi b{font-size:20px}
}

/* ============ MOBILE: alvos de toque e legibilidade ============
   Medições em 360x640 e 320x568 (viewport de celular, emulação real):
   a barra inferior encolhia cada link para ~30px e o ☆ dos cards tinha 38px. */
@media (max-width: 767px) {
  /* a barra inferior é um grid de 5 colunas: sem largura o <a> encolhe para o tamanho do texto */
  .nav-item { width: 100%; min-height: 56px; font-size: 11px !important; }
  .nav-item span { font-size: 22px; line-height: 23px; }

  /* nada clicável abaixo de 44x44 */
  .pill { min-height: 44px !important; }
  .catalog-stat { min-height: 44px; }
  .navbar-burger { width: 44px; height: 44px; flex: 0 0 auto; }
  .app-header-inner button, .navbar-burger, .app-header-inner > :last-child span { flex-shrink: 0; }
  .app-header-inner > :last-child button { min-height: 44px; }
  .header-search input { height: 44px; }
  .hero-card .card-fav { width: 44px; height: 44px; min-width: 44px; min-height: 44px; }
  select { min-height: 44px; }
  .modal-backdrop .mtab { min-height: 44px; }
  .app-nav + main .space-y-2 > div > div:last-child button { min-height: 44px; }
  .navbar-menu a, .navbar-menu button { min-height: 44px; }
  .breadcrumbs a { display: inline-flex; align-items: center; min-height: 30px; }

  /* matriz de vantagens: quebra linha no celular em vez de rolar de lado */
  .fac-table { min-width: 100% !important; }
  .fac-table td { white-space: normal !important; padding-right: 10px; }
  .fac-table td:empty { display: none; }

  /* respiro para o conteúdo não ficar sob a barra fixa (inclui a área segura do iPhone) */
  main, .app-content { padding-bottom: calc(92px + var(--safe-bottom)) !important; }
}

/* ============ MOBILE, 2ª passada ============
   A barra inferior é `flex gap-2 flex-wrap` no JSX e o .flex do Tailwind (CDN, injetado depois)
   ganha do display:grid do bloco anterior. Com width:100% cada link virava uma linha inteira e a
   barra esticava para 409px numa tela de 360. Aqui a barra é grid de verdade e as colunas usam
   minmax(0,1fr) — é o "0" que impede o rótulo de empurrar a coluna. */
@media (max-width: 767px) {
  .app-nav {
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    flex-wrap: nowrap !important;
    gap: 2px !important;
    padding: 6px 6px var(--safe-bottom) !important;
    overflow: hidden;
  }
  .nav-item {
    width: auto !important; min-width: 0 !important;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .nav-item span { font-size: 21px; line-height: 22px; }

  /* resto dos alvos medidos abaixo de 44px */
  input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea { min-height: 44px; }
  label.flex.items-center { min-height: 44px; }
  .breadcrumbs a { display: inline-flex; align-items: center; min-height: 40px; padding-inline: 4px; margin-inline: -4px; }

  /* textos de 10px que ficam visíveis no celular */
  .profile-card label, .ai-message-label, .sidebar-title, .sidebar-meta span, .sidebar-badge { font-size: 11px; }
  .catalog-stat, .catalog-stat b, .catalog-stat span { font-size: 11.5px; }

  /* gaveta do modal: espaço para a barra de gestos do iPhone */
  .modal-backdrop > div { padding-bottom: calc(14px + var(--safe-bottom)); }
}

/* ============ MOBILE, 3ª passada ============
   O cabeçalho estourava a tela em 360px: a marca (logo + "AFK ARENA CLASSIC") consumia ~229px e
   empurrava os botões Entrar/Criar conta até 409px. A regra do autor (.brand > div:last-child)
   existia mas a classe "brand" não estava no JSX — agora está. */
@media (max-width: 767px) {
  .breadcrumbs a { min-height: 44px; }
  .hero-card .flex.gap-1\.5 span { font-size: 10px; padding: 3px 5px; }   /* chips S+ do card: eram 8px */
  .home-action span { font-size: 10px; }
  .app-header-inner { gap: 8px; }
}

/* ============ MOBILE, 4ª passada ============ */
@media (max-width: 767px) {
  .brand { min-width: 44px; min-height: 44px; }
  .brand > div:first-child { width: 44px; height: 44px; }
  .breadcrumbs a { min-width: 44px; justify-content: center; }
  button.text-xs.text-gold { min-height: 44px; }
  /* chips de herói da tier list (medidos com 42px) */
  .space-y-2 > .flex > .flex.flex-wrap.gap-2 > button { min-height: 44px; }
  .back-link { display: inline-flex; align-items: center; min-height: 44px; }

  /* matriz de vantagens: cada linha vira uma faixa que quebra sozinha — cabe em 320px sem rolar de lado */
  .fac-table, .fac-table tbody, .fac-table tr { display: block; }
  .fac-table tr { display: flex; flex-wrap: wrap; gap: 3px 6px; padding: 6px 0; }
  .fac-table td { padding: 0 !important; white-space: normal !important; }
}

/* ============ MOBILE, 5ª passada: chips de filtro rápido (38px) ============ */
@media (max-width: 767px) {
  .text-xs.font-semibold.rounded-full { min-height: 44px; }
}

/* ============ MENU DO HAMBÚRGUER (mobile) ============
   Antes: lista chapada dentro do header, sem indicar a página atual, sem fechar fora/Esc, alvo
   de "fechar ✕" de ~28px. Agora: painel ancorado abaixo do header (o header tem backdrop-filter,
   que cria containing block para position:fixed — por isso é absolute contra o header, não fixed),
   com seções, item ativo, badge da coleção, Esc/fora-fecha e bloqueio do scroll do fundo. */
@media (max-width: 1023px) {
  .drawer-overlay {
    position: absolute; top: 100%; left: 0; right: 0;
    height: calc(100dvh - 100%);
    background: rgba(4, 6, 10, .66);
    backdrop-filter: blur(3px);
    z-index: 65;
    animation: drawerFade .16s ease-out;
  }
  .drawer {
    position: absolute; top: 0; right: 0;
    width: min(86vw, 340px); height: 100%;
    overflow-y: auto; overscroll-behavior: contain;
    background: #0f1520; border-left: 1px solid #263252;
    box-shadow: -24px 0 60px rgba(0, 0, 0, .55);
    padding: 10px 10px calc(16px + var(--safe-bottom));
    animation: drawerIn .22s cubic-bezier(.2, .8, .2, 1);
  }
  .drawer-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 2px 4px 10px; border-bottom: 1px solid #202c43; margin-bottom: 6px;
  }
  .drawer-head b { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: #8490a6; }
  .drawer-close {
    width: 44px; height: 44px; border-radius: 12px;
    border: 1px solid #263252; background: #151d2c; color: #c7d0df; font-size: 15px;
  }
  .drawer-close:hover { border-color: var(--gold); color: var(--gold); }
  .drawer-user { display: flex; align-items: center; gap: 10px; padding: 10px 6px 4px; }
  .drawer-user b { display: block; font-size: 13px; color: #e2e8f0; }
  .drawer-user small { font-size: 11px; color: #8490a6; word-break: break-all; }
  .drawer-group {
    font-size: 10.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
    color: #5b6a85; padding: 14px 8px 6px;
  }
  .drawer-item {
    display: flex; align-items: center; gap: 12px; width: 100%;
    min-height: 48px; padding: 10px 12px; border-radius: 12px;
    font-size: 14px; color: #c7d0df; background: none; border: 0;
    text-align: left; text-decoration: none; cursor: pointer;
  }
  .drawer-item:hover, .drawer-item:focus-visible { background: #1a2437; color: var(--gold); }
  .drawer-ic { width: 26px; text-align: center; font-size: 17px; flex: 0 0 auto; }
  .drawer-label { flex: 1; }
  .drawer-item.active {
    background: rgba(245, 197, 24, .12); color: var(--gold);
    box-shadow: inset 3px 0 0 var(--gold); font-weight: 700;
  }
  .drawer-badge {
    font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 9px;
    background: rgba(245, 197, 24, .15); color: var(--gold); border: 1px solid rgba(245, 197, 24, .4);
  }
  .drawer-item.admin { color: var(--gold); }
  .drawer-item.sair { color: #f87171; margin-top: 8px; box-shadow: inset 0 1px 0 #202c43; }
  .drawer-item.sair:hover { background: rgba(248, 113, 113, .1); color: #fca5a5; }
  /* o header é z-40 e a tabbar é z-60: com o menu aberto o header sobe para o painel ficar por cima */
  body.drawer-aberto { overflow: hidden; }
  body.drawer-aberto .app-header { z-index: 70; }
  .navbar-burger.aberto { border-color: var(--gold); color: var(--gold); }
}
@keyframes drawerIn { from { transform: translateX(22px); opacity: .55; } to { transform: none; opacity: 1; } }
@keyframes drawerFade { from { opacity: 0; } to { opacity: 1; } }
