/* ===========================================================
   Ya-ra Tarifas — design system dark premium
   =========================================================== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  /* superfícies */
  --bg:        #08090C;
  --s1:        #0E1015;
  --s2:        #14171E;
  --s3:        #1B1F28;
  --s4:        #242933;
  --line:      rgba(255,255,255,.065);
  --line-2:    rgba(255,255,255,.11);
  --line-3:    rgba(255,255,255,.18);

  /* texto */
  --tx:        #EBEEF3;
  --tx-2:      #9AA3B2;
  --tx-3:      #626B7A;

  /* marca */
  --gold:      #F0B429;
  --gold-2:    #C4831C;
  --gold-dim:  rgba(240,180,41,.13);
  --teal:      #2DD4BF;
  --teal-2:    #0E9384;
  --teal-dim:  rgba(45,212,191,.12);

  --ok:        #34D399;
  --danger:    #FB7185;

  --r-sm: 8px;
  --r:    12px;
  --r-lg: 16px;
  --r-xl: 22px;

  --shadow:    0 18px 50px -12px rgba(0,0,0,.75);
  --shadow-lg: 0 40px 90px -20px rgba(0,0,0,.85);

  --rail: 68px;
  --panel: 340px;

  --ease: cubic-bezier(.22,.68,.28,1);
}

html, body { height: 100%; }
body {
  font-family: 'Inter', 'Segoe UI Variable', 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  background: var(--bg);
  color: var(--tx);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.008em;
}
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; letter-spacing: inherit; }
.hidden { display: none !important; }
.ico { display: block; flex: 0 0 auto; }
.ico-wrap { display: inline-flex; }
svg { overflow: visible; }

/* ---------- inputs ---------- */
input, textarea, select {
  font: inherit; letter-spacing: inherit; width: 100%;
  background: var(--s1);
  border: 1px solid var(--line-2);
  color: var(--tx);
  border-radius: var(--r);
  padding: 11px 13px;
  outline: none;
  transition: border-color .16s var(--ease), background .16s var(--ease), box-shadow .16s var(--ease);
}
input::placeholder, textarea::placeholder { color: var(--tx-3); }
input:focus, textarea:focus, select:focus {
  border-color: rgba(240,180,41,.55);
  background: var(--s2);
  box-shadow: 0 0 0 3.5px rgba(240,180,41,.09);
}
select { appearance: none; cursor: pointer; padding-right: 34px;
  background-image: linear-gradient(45deg, transparent 50%, var(--tx-2) 50%), linear-gradient(135deg, var(--tx-2) 50%, transparent 50%);
  background-position: calc(100% - 18px) 51%, calc(100% - 13px) 51%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}
textarea { resize: none; line-height: 1.5; }

.field { position: relative; }
.field .field-ico { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--tx-3); pointer-events: none; display: flex; }
.field input, .field select { padding-left: 42px; }
.field input:focus + .field-ico { color: var(--gold); }

.lab { display: block; font-size: .755rem; font-weight: 650; text-transform: uppercase;
  letter-spacing: .07em; color: var(--tx-3); margin: 16px 0 7px; }
.hint { font-size: .78rem; color: var(--tx-3); margin-top: 7px; line-height: 1.5; }

/* ---------- botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: var(--r); padding: 10px 16px;
  font-size: .875rem; font-weight: 600;
  transition: all .16s var(--ease);
  white-space: nowrap;
}
.btn:disabled { opacity: .5; cursor: default; }
.btn-block { width: 100%; }

.btn-accent {
  background: linear-gradient(168deg, var(--gold) 0%, var(--gold-2) 100%);
  color: #14100A;
  box-shadow: 0 6px 22px -8px rgba(240,180,41,.55), inset 0 1px 0 rgba(255,255,255,.28);
}
.btn-accent:hover:not(:disabled) { filter: brightness(1.09); transform: translateY(-1px); }
.btn-accent svg { stroke-width: 2.1; }

.btn-soft {
  background: var(--s3); color: var(--tx); border: 1px solid var(--line-2);
}
.btn-soft:hover { background: var(--s4); border-color: var(--line-3); }
.btn-soft svg { color: var(--gold); }

.btn-line {
  background: rgba(255,255,255,.02); border: 1px solid var(--line-2); color: var(--tx-2);
}
.btn-line:hover { color: var(--tx); border-color: var(--line-3); background: var(--s2); }
.btn-line.on { color: var(--gold); border-color: rgba(240,180,41,.45); background: var(--gold-dim); }

.btn-quiet { color: var(--tx-2); }
.btn-quiet:hover { color: var(--tx); background: var(--s2); }
.btn-quiet svg { color: var(--danger); }

.ghost-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 10px;
  color: var(--tx-2); transition: all .15s var(--ease);
}
.ghost-icon:hover { color: var(--tx); background: var(--s3); }
/* ===========================================================
   LOGIN — split screen: apresentação + formulário
   =========================================================== */
body.auth {
  min-height: 100%;
  background: #07090C;
}
.auth-bg { position: fixed; inset: 0; overflow: hidden; z-index: 0; pointer-events: none; }
.orb { position: absolute; border-radius: 50%; filter: blur(130px); opacity: .5; }
.orb-a { width: 780px; height: 780px; top: -340px; left: -240px;
  background: radial-gradient(circle, rgba(45,212,191,.28), transparent 68%); }
.orb-b { width: 760px; height: 760px; bottom: -380px; right: -220px;
  background: radial-gradient(circle, rgba(240,180,41,.20), transparent 68%); }
.grid-lines {
  position: absolute; inset: 0; opacity: .22;
  background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 68px 68px;
  mask-image: radial-gradient(ellipse 90% 75% at 50% 45%, #000 30%, transparent 100%);
}

.auth-shell {
  position: relative; z-index: 1;
  min-height: 100vh;
  display: grid; grid-template-columns: 1fr 1fr;
}
.auth-story, .auth-entry {
  display: flex; flex-direction: column; justify-content: center;
  padding: 56px clamp(32px, 5.5vw, 88px);
}
.auth-story { border-right: 1px solid var(--line); }

/* selo da marca */
.auth-mark {
  width: 62px; height: 62px; border-radius: 18px;
  display: grid; place-items: center;
  background: linear-gradient(150deg, var(--teal), var(--teal-2));
  color: #04100E;
  box-shadow: 0 16px 38px -12px rgba(45,212,191,.62), inset 0 1px 0 rgba(255,255,255,.32);
}
.auth-mark svg { stroke-width: 2.1; }

/* ---------- lado esquerdo ---------- */
.auth-story h1 {
  margin-top: 42px;
  font-size: clamp(1.9rem, 3.1vw, 2.6rem);
  font-weight: 700; line-height: 1.16; letter-spacing: -.038em;
}
.auth-features { list-style: none; display: grid; gap: 19px; margin-top: 40px; }
.auth-features li {
  display: flex; align-items: center; gap: 14px;
  font-size: .93rem; color: var(--tx-2); line-height: 1.4;
}
.auth-features li > span {
  width: 38px; height: 38px; min-width: 38px; border-radius: 12px;
  display: grid; place-items: center;
  color: var(--teal); background: var(--teal-dim);
  border: 1px solid rgba(45,212,191,.2);
}
.auth-proof {
  display: flex; align-items: center; gap: 9px;
  margin-top: 46px; font-size: .78rem; color: var(--tx-3);
}
.auth-proof b { color: var(--teal); font-weight: 600; }
.live-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--ok);
  box-shadow: 0 0 0 4px rgba(52,211,153,.15);
  animation: pulseDot 2.4s ease-in-out infinite;
}
@keyframes pulseDot { 50% { box-shadow: 0 0 0 8px rgba(52,211,153,0); } }

/* ---------- lado direito: formulário ---------- */
.auth-form { width: min(100%, 420px); }
.auth-form h2 {
  margin-top: 26px;
  font-size: 1.72rem; font-weight: 700; letter-spacing: -.034em;
}
.auth-sub { color: var(--tx-3); font-size: .875rem; margin-top: 7px; }

.auth-lab {
  display: block; margin: 22px 0 8px;
  font-size: .8rem; font-weight: 620; color: var(--tx-2);
}
.auth-field input {
  height: 54px; border-radius: 13px;
  padding-left: 46px; padding-right: 48px;
  background: rgba(9,11,16,.72); font-size: .93rem;
}
.auth-field input:focus {
  border-color: rgba(45,212,191,.5);
  box-shadow: 0 0 0 3.5px rgba(45,212,191,.1);
  background: var(--s2);
}
.auth-field .field-ico { left: 15px; }
.auth-field input:focus ~ .field-ico { color: var(--teal); }
.pass-toggle {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 38px; height: 38px; display: grid; place-items: center;
  border-radius: 10px; color: var(--tx-3);
  transition: all .15s var(--ease);
}
.pass-toggle:hover, .pass-toggle.on { color: var(--teal); background: var(--teal-dim); }

.auth-submit {
  margin-top: 28px; min-height: 54px; border-radius: 13px;
  font-size: .95rem; font-weight: 650;
  background: linear-gradient(165deg, var(--teal) 0%, var(--teal-2) 100%);
  color: #04100E;
  box-shadow: 0 10px 28px -10px rgba(45,212,191,.6), inset 0 1px 0 rgba(255,255,255,.3);
}
.auth-submit:hover:not(:disabled) { filter: brightness(1.08); transform: translateY(-1px); }
.auth-submit:disabled { filter: saturate(.5); transform: none; }

.auth-err { color: var(--danger); font-size: .82rem; margin-top: 12px; min-height: 1.15em; }
.auth-note {
  display: flex; align-items: flex-start; gap: 9px;
  margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line);
  color: var(--tx-3); font-size: .765rem; line-height: 1.55;
}
.auth-note > span { color: var(--teal); flex: 0 0 auto; margin-top: 1px; }

/* ---------- responsivo ---------- */
@media (max-width: 900px) {
  .auth-shell { grid-template-columns: 1fr; min-height: auto; }
  .auth-story {
    border-right: none; border-bottom: 1px solid var(--line);
    padding-top: 46px; padding-bottom: 42px;
  }
  .auth-story h1 { margin-top: 28px; font-size: 1.75rem; }
  .auth-features { gap: 14px; margin-top: 28px; }
  .auth-features li { font-size: .86rem; }
  .auth-proof { margin-top: 30px; }
  .auth-entry { padding-top: 42px; padding-bottom: 56px; }
  .auth-form { width: 100%; margin: 0 auto; }
}
@media (max-width: 560px) {
  .auth-story, .auth-entry { padding-left: 22px; padding-right: 22px; }
  .auth-mark { width: 54px; height: 54px; border-radius: 16px; }
  .auth-form h2 { font-size: 1.5rem; }
}

/* ===========================================================
   SHELL
   =========================================================== */
#shell { display: flex; height: 100vh; }

/* ---------- RAIL ---------- */
#rail {
  width: var(--rail); min-width: var(--rail);
  background: var(--s1);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center;
  padding: 14px 0 14px;
  gap: 20px;
  z-index: 5;
}
.rail-mark {
  width: 42px; height: 42px; border-radius: 13px;
  display: grid; place-items: center;
  background: linear-gradient(150deg, var(--teal), var(--teal-2));
  color: #05100E;
  box-shadow: 0 8px 22px -8px rgba(45,212,191,.65), inset 0 1px 0 rgba(255,255,255,.3);
  transition: transform .2s var(--ease);
}
.rail-mark:hover { transform: scale(1.06) rotate(-4deg); }
.rail-mark svg { stroke-width: 2; }

.rail-group { display: flex; flex-direction: column; gap: 6px; width: 100%; align-items: center; }
.rail-bottom { margin-top: auto; }

.rail-btn {
  position: relative;
  width: 46px; height: 46px; border-radius: 13px;
  display: grid; place-items: center;
  color: var(--tx-3);
  transition: all .16s var(--ease);
}
.rail-btn::before {
  content: ''; position: absolute; left: -14px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 0; border-radius: 3px; background: var(--gold);
  transition: height .2s var(--ease);
}
.rail-btn:hover { color: var(--tx); background: var(--s3); }
.rail-btn.on { color: var(--gold); background: var(--gold-dim); }
.rail-btn.on::before { height: 22px; }

.rail-badge {
  position: absolute; top: 5px; right: 5px;
  min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 9px;
  background: var(--s4); border: 1px solid var(--line-2);
  color: var(--tx-2);
  font-size: .625rem; font-weight: 700;
  display: grid; place-items: center;
}
.rail-btn.on .rail-badge { background: var(--gold); border-color: transparent; color: #14100A; }
.rail-badge.zero { display: none; }

.rail-av {
  width: 40px; height: 40px; border-radius: 12px; overflow: hidden; margin-top: 4px;
  display: grid; place-items: center;
  background: linear-gradient(150deg, var(--c1, #8B93A6), var(--c2, #5B6478));
  color: #0B0C10; font-weight: 750; font-size: .95rem;
  border: 1px solid var(--line-2);
  transition: transform .16s var(--ease);
}
.rail-av:hover { transform: scale(1.07); }
.rail-av img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- PAINEL ---------- */
#panel {
  width: var(--panel); min-width: var(--panel);
  background: var(--s1);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  overflow: hidden;
  transition: width .28s var(--ease), min-width .28s var(--ease),
              opacity .18s var(--ease), border-right-width .28s var(--ease);
}
#panel.closed {
  width: 0; min-width: 0; opacity: 0;
  border-right-width: 0; pointer-events: none;
}
.pane { display: none; flex-direction: column; height: 100%;
  width: var(--panel); min-width: var(--panel); }
.pane.on { display: flex; }

.pane-head {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 16px 16px;
  border-bottom: 1px solid var(--line);
}
.pane-ico {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: var(--gold-dim); color: var(--gold);
  border: 1px solid rgba(240,180,41,.22);
}
.pane-head > div { flex: 1; min-width: 0; }
.pane-head h2 { font-size: 1rem; font-weight: 650; letter-spacing: -.02em; }
.pane-head p { font-size: .74rem; color: var(--tx-3); margin-top: 2px; }
.pane-close { width: 32px; height: 32px; }

.pane-body { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 14px; }
.form-card {
  background: var(--s2); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 13px;
  display: flex; flex-direction: column; gap: 8px;
}
.form-card input, .form-card textarea, .form-card select { font-size: .855rem; padding: 9px 12px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.form-card .btn { margin-top: 2px; }
.kb-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.kb-head strong { font-size: .86rem; }
.kb-head p { color: var(--tx-3); font-size: .72rem; margin-top: 3px; }
.kb-card.syncing .btn { opacity: .65; pointer-events: none; }

.list { display: flex; flex-direction: column; gap: 8px; }
.item {
  position: relative;
  background: var(--s2); border: 1px solid var(--line);
  border-left: 2.5px solid var(--gold-2);
  border-radius: var(--r); padding: 11px 38px 11px 13px;
  transition: all .15s var(--ease);
}
.item:hover { background: var(--s3); border-color: var(--line-2); }
.item h4 { font-size: .875rem; font-weight: 620; letter-spacing: -.012em; }
.item .meta { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 5px; }
.item .chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: .7rem; color: var(--tx-2);
  background: rgba(255,255,255,.035); border-radius: 6px; padding: 2px 7px;
}
.item .chip svg { width: 13px; height: 13px; color: var(--tx-3); }
.item p { font-size: .78rem; color: var(--tx-2); margin-top: 6px; line-height: 1.5; }
.item .kill {
  position: absolute; top: 8px; right: 8px;
  width: 26px; height: 26px; border-radius: 8px;
  display: grid; place-items: center; color: var(--tx-3);
  opacity: 0; transition: all .15s var(--ease);
}
.item:hover .kill { opacity: 1; }
.item .kill:hover { color: var(--danger); background: rgba(251,113,133,.13); }
.item .kill svg { width: 15px; height: 15px; }

.empty { text-align: center; padding: 26px 14px; color: var(--tx-3); font-size: .8rem; line-height: 1.6; }

/* chips coloridos e extras dos cards */
.item .chip.forte { color: var(--teal); background: var(--teal-dim); border: 1px solid rgba(45,212,191,.2); }
.item .chip.forte svg { color: var(--teal); }
.item .chip.ouro { color: var(--gold); background: var(--gold-dim); border: 1px solid rgba(240,180,41,.2); }
.item .chip.ouro svg { color: var(--gold); }
.item p.sub { color: var(--tx-3); font-size: .74rem; margin-top: 4px; }
.item-link {
  display: inline-flex; align-items: center; gap: 5px; margin-top: 7px;
  font-size: .74rem; color: var(--teal); text-decoration: none;
}
.item-link:hover { text-decoration: underline; }
.item.passado { opacity: .55; border-left-color: var(--tx-3); }
.tag-passou {
  font-size: .6rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: var(--tx-3); background: rgba(255,255,255,.05);
  border-radius: 5px; padding: 1px 6px; margin-left: 6px; vertical-align: middle;
}
.mini-lab { display: grid; gap: 5px; font-size: .68rem; color: var(--tx-3); font-weight: 600; }

/* ---------- CALENDÁRIO ---------- */
.cal-nav {
  display: flex; align-items: center; gap: 8px;
  background: var(--s2); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 8px 10px;
}
.cal-nav .ghost-icon { width: 32px; height: 32px; }
#calNext svg { transform: rotate(180deg); }
.cal-mes { flex: 1; text-align: center; display: grid; gap: 2px; }
.cal-mes strong { font-size: .9rem; font-weight: 650; text-transform: capitalize; letter-spacing: -.015em; }
.cal-mes small { font-size: .69rem; color: var(--tx-3); }

.cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px;
  background: var(--s2); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 10px;
}
.cal-dow {
  text-align: center; font-size: .64rem; font-weight: 700;
  color: var(--tx-3); text-transform: uppercase; letter-spacing: .05em;
  padding-bottom: 4px;
}
.cal-vazio { aspect-ratio: 1; }
.cal-dia {
  position: relative; aspect-ratio: 1;
  display: grid; place-items: center;
  border-radius: 9px; border: 1px solid transparent;
  background: var(--s1); color: var(--tx-2);
  font-size: .78rem; font-weight: 600;
  transition: all .13s var(--ease);
}
.cal-dia:hover { background: var(--s4); color: var(--tx); }
.cal-dia.ocupado {
  background: var(--teal-dim); color: var(--teal);
  border-color: rgba(45,212,191,.3); font-weight: 700;
}
.cal-dia.ocupado:hover { background: rgba(45,212,191,.22); }
.cal-dia.hoje { box-shadow: inset 0 0 0 1.5px var(--gold); color: var(--gold); }
.cal-dia.hoje.ocupado { color: var(--teal); }
.cal-dia.aberto { outline: 2px solid var(--teal); outline-offset: 1px; }
.cal-marca {
  position: absolute; top: 3px; right: 4px;
  min-width: 13px; height: 13px; border-radius: 7px;
  background: var(--teal); color: #04100E;
  font-size: .55rem; font-weight: 800; font-style: normal;
  display: grid; place-items: center; padding: 0 3px;
}
.cal-dia.ocupado .cal-marca:empty { min-width: 5px; height: 5px; top: 4px; right: 4px; }

.cal-legenda {
  display: flex; justify-content: center; gap: 14px;
  font-size: .68rem; color: var(--tx-3);
}
.cal-legenda span { display: inline-flex; align-items: center; gap: 5px; }
.cal-legenda i { width: 9px; height: 9px; border-radius: 3px; display: block; }
.dot-livre { background: var(--s4); }
.dot-evento { background: var(--teal); }
.dot-hoje { background: transparent; box-shadow: inset 0 0 0 1.5px var(--gold); }

.cal-detalhe {
  background: var(--s2); border: 1px solid var(--line);
  border-left: 2.5px solid var(--teal);
  border-radius: var(--r); padding: 11px 13px;
  display: grid; gap: 9px;
}
.cal-detalhe-head { display: flex; align-items: center; gap: 7px; color: var(--teal); }
.cal-detalhe-head strong { font-size: .85rem; color: var(--tx); }
.cal-ev { display: grid; gap: 2px; }
.cal-ev b { font-size: .82rem; font-weight: 620; }
.cal-ev small { font-size: .72rem; color: var(--tx-3); }
.cal-livre { font-size: .78rem; color: var(--tx-3); }

.cfg-block.bloqueado { opacity: .55; }

/* ---------- PAINEL DE CUSTO ---------- */
.uso-card {
  margin-top: 14px; padding: 12px 14px;
  background: var(--s2); border: 1px solid var(--line);
  border-left: 2.5px solid var(--teal);
  border-radius: var(--r); display: grid; gap: 7px;
}
.uso-linha { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.uso-linha span { font-size: .78rem; color: var(--tx-3); }
.uso-linha strong { font-size: .86rem; font-weight: 650; color: var(--tx); }
.uso-card .hint { margin-top: 3px; padding-top: 8px; border-top: 1px solid var(--line); }

/* ---------- PAINEL DO TIME ---------- */
#membros {
  width: 232px; min-width: 232px;
  background: var(--s1); border-left: 1px solid var(--line);
  display: flex; flex-direction: column;
  transition: width .26s var(--ease), min-width .26s var(--ease),
              opacity .18s var(--ease), border-left-width .26s var(--ease);
  overflow: hidden;
}
#membros.escondido {
  width: 0; min-width: 0; opacity: 0;
  border-left-width: 0; pointer-events: none;
}
.mb-head {
  display: flex; align-items: center; gap: 10px;
  padding: 15px 14px 13px; border-bottom: 1px solid var(--line);
  min-width: 232px;
}
.mb-head > span { color: var(--tx-3); display: flex; }
.mb-head h2 { font-size: .92rem; font-weight: 650; letter-spacing: -.02em; }
.mb-head p { font-size: .7rem; color: var(--tx-3); margin-top: 2px; }

.mb-lista { flex: 1; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 3px; min-width: 232px; }
.mb-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 8px; border-radius: 10px;
  transition: background .14s var(--ease);
}
.mb-item:hover { background: var(--s2); }
.mb-av {
  position: relative; width: 32px; height: 32px; min-width: 32px;
  border-radius: 10px; overflow: visible;
  display: grid; place-items: center;
  background: linear-gradient(150deg, var(--c1), var(--c2));
  color: #0B0C10; font-weight: 750; font-size: .8rem;
  filter: grayscale(1) brightness(.7); opacity: .55;
  transition: all .18s var(--ease);
}
.mb-av img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; }
.mb-item.on .mb-av { filter: none; opacity: 1; }
.mb-dot {
  position: absolute; right: -2px; bottom: -2px;
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--tx-3); border: 2px solid var(--s1);
}
.mb-item.on .mb-dot { background: var(--ok); box-shadow: 0 0 7px rgba(52,211,153,.6); }
.mb-info { flex: 1; min-width: 0; display: grid; gap: 1px; }
.mb-info b { font-size: .83rem; font-weight: 600; color: var(--tx-2); }
.mb-item.on .mb-info b { color: var(--tx); }
.mb-info small {
  font-size: .68rem; color: var(--tx-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mb-eu {
  font-size: .58rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: var(--gold); background: var(--gold-dim);
  border-radius: 4px; padding: 1px 5px; margin-left: 4px; vertical-align: middle;
}
.mb-chamar {
  width: 26px; height: 26px; border-radius: 8px; flex: 0 0 auto;
  display: grid; place-items: center; color: var(--tx-3);
  opacity: 0; transition: all .14s var(--ease);
}
.mb-item:hover .mb-chamar { opacity: 1; }
.mb-chamar:hover { color: var(--teal); background: var(--teal-dim); }

.mb-foot { padding: 10px; border-top: 1px solid var(--line); min-width: 232px; }
.mb-ia {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 9px; border-radius: 10px;
  background: linear-gradient(180deg, rgba(45,212,191,.07), rgba(45,212,191,.02));
  border: 1px solid rgba(45,212,191,.16);
}
.mb-av-ia {
  width: 32px; height: 32px; min-width: 32px; border-radius: 10px;
  display: grid; place-items: center;
  background: linear-gradient(150deg, var(--teal), var(--teal-2));
  color: #04100E;
  box-shadow: 0 5px 14px -6px rgba(45,212,191,.6);
}
.mb-ia b { font-size: .83rem; color: var(--teal); display: block; }
.mb-ia small { font-size: .68rem; color: var(--tx-3); }

/* ---------- MODO PRIVADO DO NAVEGADOR ---------- */
#brPrivado.on { color: var(--gold); background: var(--gold-dim); }
#brPrivado.pulsando { animation: chamaAtencao 1.1s ease-in-out infinite; }
@keyframes chamaAtencao {
  0%, 100% { box-shadow: 0 0 0 0 rgba(240,180,41,.5); }
  50% { box-shadow: 0 0 0 7px rgba(240,180,41,0); }
}

#brAvisoPrivado {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 13px;
  background: linear-gradient(180deg, rgba(240,180,41,.09), rgba(240,180,41,.03));
  border-bottom: 1px solid rgba(240,180,41,.22);
}
#brAvisoPrivado > span { color: var(--gold); display: flex; flex: 0 0 auto; }
#brAvisoPrivado > div { flex: 1; min-width: 0; }
#brAvisoPrivado strong { display: block; font-size: .84rem; color: var(--gold); }
#brAvisoPrivado p { font-size: .74rem; color: var(--tx-2); margin-top: 2px; line-height: 1.45; }
#brAvisoPrivado .btn { padding: 7px 13px; font-size: .8rem; flex: 0 0 auto; }

.br-bloqueado {
  position: absolute; inset: 0; z-index: 3;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; text-align: center; padding: 30px;
  background: var(--s1);
}
.br-bloqueado .br-empty-ico { color: var(--gold); border-color: rgba(240,180,41,.25); background: var(--gold-dim); }
.br-bloqueado h3 { font-size: .96rem; font-weight: 650; }
.br-bloqueado p { font-size: .8rem; color: var(--tx-3); line-height: 1.6; max-width: 300px; }

/* ===========================================================
   CHAT
   =========================================================== */
#chat { flex: 1; display: flex; flex-direction: column; min-width: 380px;
  background: radial-gradient(1100px 500px at 22% -8%, rgba(240,180,41,.045), transparent 62%),
              radial-gradient(900px 480px at 95% 105%, rgba(45,212,191,.04), transparent 60%); }

.chat-head {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(8,9,12,.55);
  backdrop-filter: blur(14px);
}
.ch-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ch-hash { color: var(--tx-3); display: flex; }
.chat-head h1 { font-size: 1.06rem; font-weight: 650; letter-spacing: -.025em; }
.ch-presence { display: flex; align-items: center; gap: 7px; margin-top: 3px; font-size: .755rem; color: var(--tx-3); }
.pres-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok);
  box-shadow: 0 0 0 3px rgba(52,211,153,.16); flex: 0 0 auto; }
.pres-stack { display: flex; }
.pres-stack .pav {
  width: 21px; height: 21px; border-radius: 7px; overflow: hidden;
  display: grid; place-items: center; margin-left: -5px;
  background: linear-gradient(150deg, var(--c1), var(--c2));
  color: #0B0C10; font-size: .58rem; font-weight: 750;
  border: 1.5px solid var(--s1);
}
.pres-stack .pav:first-child { margin-left: 0; }
.pres-stack .pav img { width: 100%; height: 100%; object-fit: cover; }
.ch-right { display: flex; gap: 8px; }
.ch-right .btn svg { color: var(--tx-2); }
.ch-right .btn.on svg { color: var(--gold); }

/* ---------- mensagens ---------- */
#stream { flex: 1; overflow-y: auto; padding: 22px 20px 10px;
  display: flex; flex-direction: column; gap: 4px; }

.day-sep { display: flex; align-items: center; gap: 12px; margin: 14px 2px 10px; }
.day-sep::before, .day-sep::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.day-sep span { font-size: .68rem; font-weight: 650; text-transform: uppercase;
  letter-spacing: .09em; color: var(--tx-3); }

.msg { display: flex; gap: 12px; padding: 5px 0; animation: rise .22s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
.msg.grouped { padding-top: 0; }
.msg.grouped .m-av { visibility: hidden; height: 0; }
.msg.grouped .m-head { display: none; }

.m-av {
  width: 38px; height: 38px; min-width: 38px; border-radius: 12px; overflow: hidden;
  display: grid; place-items: center;
  background: linear-gradient(150deg, var(--c1, #8B93A6), var(--c2, #5B6478));
  color: #0B0C10; font-weight: 750; font-size: .93rem;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.22);
}
.m-av img { width: 100%; height: 100%; object-fit: cover; }
.m-body { min-width: 0; flex: 1; max-width: 760px; }
.m-head { display: flex; align-items: baseline; gap: 9px; margin-bottom: 4px; }
.m-name { font-size: .875rem; font-weight: 650; letter-spacing: -.015em; text-transform: capitalize; }
.m-time { font-size: .69rem; color: var(--tx-3); }
.m-text {
  font-size: .915rem; line-height: 1.58; color: #DDE2EA;
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.m-text strong { color: #fff; font-weight: 650; }
.m-text code {
  background: rgba(255,255,255,.07); border: 1px solid var(--line);
  border-radius: 5px; padding: 1px 5px; font-size: .86em;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}
.mention {
  color: var(--teal); background: var(--teal-dim);
  border-radius: 5px; padding: 1px 5px; font-weight: 620;
}

.m-img { margin-top: 8px; display: inline-block; border-radius: var(--r);
  overflow: hidden; border: 1px solid var(--line-2); max-width: 380px;
  background: var(--s2); transition: all .18s var(--ease); }
.m-img:hover { border-color: var(--line-3); transform: translateY(-1px); }
.m-img img { display: block; width: 100%; max-height: 320px; object-fit: cover; cursor: zoom-in; }

/* Ya-ra */
.msg.ai .m-av {
  background: linear-gradient(150deg, var(--teal), var(--teal-2));
  color: #05100E;
  box-shadow: 0 6px 18px -8px rgba(45,212,191,.6), inset 0 1px 0 rgba(255,255,255,.28);
}
.msg.ai .m-av svg { stroke-width: 2.1; width: 21px; height: 21px; }
.msg.ai .m-name { color: var(--teal); text-transform: none; }
.msg.ai .m-body {
  background: linear-gradient(180deg, rgba(45,212,191,.055), rgba(45,212,191,.015));
  border: 1px solid rgba(45,212,191,.16);
  border-left: 2.5px solid var(--teal);
  border-radius: 4px var(--r-lg) var(--r-lg) 4px;
  padding: 11px 15px 12px;
  max-width: 780px;
}
.ai-tag {
  font-size: .6rem; font-weight: 700; text-transform: uppercase; letter-spacing: .09em;
  color: var(--teal); background: var(--teal-dim);
  border: 1px solid rgba(45,212,191,.24);
  border-radius: 5px; padding: 1.5px 6px;
}
.msg.ai.pending .m-text::after {
  content: ''; display: inline-block; vertical-align: text-bottom;
  width: 7px; height: 15px; margin-left: 3px;
  background: var(--teal); border-radius: 1.5px;
  animation: blink 1s steps(2) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* sistema */
.msg.sys .m-av { background: var(--s3); color: var(--gold); box-shadow: none;
  border: 1px solid rgba(240,180,41,.25); }
.msg.sys .m-name { color: var(--gold); text-transform: none; }
.msg.sys .m-body {
  background: linear-gradient(180deg, rgba(240,180,41,.05), rgba(240,180,41,.012));
  border: 1px solid rgba(240,180,41,.15);
  border-left: 2.5px solid var(--gold-2);
  border-radius: 4px var(--r-lg) var(--r-lg) 4px;
  padding: 10px 15px 11px;
}
.msg.sys .m-text { color: var(--tx-2); font-size: .875rem; }

/* ---------- digitando ---------- */
#typing { min-height: 24px; padding: 0 22px; display: flex; align-items: center; gap: 8px;
  font-size: .77rem; color: var(--tx-3); }
.dots { display: inline-flex; gap: 3px; }
.dots i { width: 4px; height: 4px; border-radius: 50%; background: var(--tx-3);
  animation: bob 1.1s infinite; }
.dots i:nth-child(2) { animation-delay: .16s; }
.dots i:nth-child(3) { animation-delay: .32s; }
@keyframes bob { 0%,60%,100% { transform: translateY(0); opacity: .4; } 30% { transform: translateY(-4px); opacity: 1; } }

/* ---------- composer ---------- */
.composer-wrap { position: relative; padding: 8px 18px 18px; }

#attachBar {
  display: flex; align-items: center; gap: 12px;
  background: var(--s2); border: 1px solid var(--line-2);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  border-bottom: none; padding: 11px 14px;
  margin: 0 0 -1px;
}
.attach-thumb { position: relative; width: 54px; height: 54px; border-radius: 10px;
  overflow: hidden; border: 1px solid var(--line-2); flex: 0 0 auto; }
.attach-thumb img { width: 100%; height: 100%; object-fit: cover; }
.attach-x {
  position: absolute; top: 2px; right: 2px; width: 20px; height: 20px;
  border-radius: 6px; background: rgba(8,9,12,.85); color: #fff;
  display: grid; place-items: center;
}
.attach-x svg { width: 12px; height: 12px; }
.attach-hint { font-size: .78rem; color: var(--tx-2); }

.composer {
  display: flex; align-items: flex-end; gap: 6px;
  background: var(--s2);
  border: 1px solid var(--line-2);
  border-radius: var(--r-xl);
  padding: 7px 7px 7px 9px;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.composer:focus-within {
  border-color: rgba(240,180,41,.4);
  box-shadow: 0 0 0 4px rgba(240,180,41,.07), var(--shadow);
}
#attachBar:not(.hidden) + #mentionPop + .composer,
#attachBar:not(.hidden) ~ .composer { border-radius: 0 0 var(--r-xl) var(--r-xl); }

.composer textarea {
  border: none; background: none; padding: 9px 4px; max-height: 168px;
  font-size: .93rem;
}
.composer textarea:focus { box-shadow: none; background: none; }
.composer .ghost-icon { width: 36px; min-width: 36px; height: 36px; flex: 0 0 auto; }
.composer .ghost-icon:hover { color: var(--gold); background: var(--gold-dim); }

.send-btn {
  width: 38px; min-width: 38px; height: 38px; flex: 0 0 auto; border-radius: 12px;
  display: grid; place-items: center;
  background: linear-gradient(160deg, var(--gold), var(--gold-2));
  color: #14100A;
  box-shadow: 0 5px 16px -6px rgba(240,180,41,.6), inset 0 1px 0 rgba(255,255,255,.3);
  transition: all .16s var(--ease);
}
.send-btn:hover { filter: brightness(1.1); transform: translateY(-1px) scale(1.03); }
.send-btn svg { stroke-width: 2.2; }

#mentionPop {
  position: absolute; bottom: 100%; left: 18px; margin-bottom: 8px;
  background: rgba(20,23,30,.97); border: 1px solid var(--line-2);
  border-radius: var(--r-lg); padding: 7px;
  box-shadow: var(--shadow-lg); min-width: 300px; z-index: 30;
  backdrop-filter: blur(18px);
  animation: mentionIn .14s var(--ease);
}
@keyframes mentionIn { from { opacity: 0; transform: translateY(5px) scale(.985); } }
.mention-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 10px; border-radius: 11px; text-align: left;
  border: 1px solid transparent;
  transition: background .13s var(--ease), border-color .13s var(--ease);
}
.mention-item:hover, .mention-item.on { background: var(--s4); }
.mention-item.ai:hover, .mention-item.ai.on {
  background: linear-gradient(100deg, rgba(45,212,191,.13), rgba(240,180,41,.07));
  border-color: rgba(45,212,191,.2);
}
.mention-item .mav {
  width: 34px; height: 34px; border-radius: 10px; overflow: hidden;
  display: grid; place-items: center; flex: 0 0 auto;
  background: linear-gradient(150deg, var(--c1), var(--c2));
  color: #0B0C10; font-weight: 750; font-size: .72rem;
}
.mention-item .mav img { width: 100%; height: 100%; object-fit: cover; }
.mention-copy { min-width: 0; display: grid; gap: 2px; flex: 1; }
.mention-item .mn { display: flex; align-items: center; gap: 6px; font-size: .85rem; font-weight: 650; text-transform: capitalize; }
.mention-item .mn i {
  padding: 1px 5px; border-radius: 5px;
  background: var(--teal-dim); color: var(--teal);
  font-size: .55rem; font-style: normal; letter-spacing: .08em;
}
.mention-item .mc { font-size: .68rem; color: var(--tx-3); }
.mention-item.ai .mav { background: linear-gradient(150deg, var(--teal), var(--teal-2)); }
.mention-item.ai .mn { color: var(--teal); text-transform: none; }
.mention-action {
  color: var(--gold); font-size: .63rem; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase;
}

/* ===========================================================
   NAVEGADOR COMPARTILHADO
   =========================================================== */
#browser {
  width: 44%; min-width: 400px; max-width: 900px;
  background: var(--s1); border-left: 1px solid var(--line);
  display: flex; flex-direction: column;
}
.br-head { display: flex; align-items: center; gap: 6px; padding: 10px 12px;
  border-bottom: 1px solid var(--line); }
.br-url { flex: 1; position: relative; display: flex; align-items: center; }
.br-url > span { position: absolute; left: 12px; color: var(--tx-3); display: flex; pointer-events: none; }
.br-url > span svg { width: 18px; height: 18px; }
.br-url input { padding-left: 38px; font-size: .83rem; border-radius: 10px; }

.br-view { flex: 1; position: relative; overflow: auto; background: #000;
  display: flex; align-items: flex-start; justify-content: center; }
#brFrame { width: 100%; display: block; cursor: crosshair; }
.br-empty {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px; text-align: center;
  padding: 30px; background: var(--s1);
}
.br-empty-ico {
  width: 60px; height: 60px; border-radius: 18px; display: grid; place-items: center;
  background: var(--s3); color: var(--tx-3); border: 1px solid var(--line-2);
  margin-bottom: 6px;
}
.br-empty-ico svg { width: 28px; height: 28px; }
.br-empty h3 { font-size: .96rem; font-weight: 650; }
.br-empty p { font-size: .8rem; color: var(--tx-3); line-height: 1.65; }

.br-foot { display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  border-top: 1px solid var(--line); }
.br-foot > span { color: var(--tx-3); display: flex; }
.br-foot > span svg { width: 17px; height: 17px; }
.br-foot input { font-size: .83rem; border-radius: 10px; }

/* ===========================================================
   MODAL
   =========================================================== */
.modal {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(4,5,7,.7); backdrop-filter: blur(6px);
  display: grid; place-items: center; padding: 24px;
  animation: fade .16s var(--ease);
}
@keyframes fade { from { opacity: 0; } }
.modal-card {
  width: 520px; max-width: 100%; max-height: 92vh;
  background: var(--s1); border: 1px solid var(--line-2);
  border-radius: 22px; box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; overflow: hidden;
  animation: pop .22s var(--ease);
}
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.985); } }

.modal-head { display: flex; align-items: center; gap: 13px;
  padding: 20px 20px 18px; border-bottom: 1px solid var(--line); }
.modal-ico { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center;
  background: var(--gold-dim); color: var(--gold); border: 1px solid rgba(240,180,41,.22); }
.modal-head > div { flex: 1; }
.modal-head h2 { font-size: 1.06rem; font-weight: 650; letter-spacing: -.02em; }
.modal-head p { font-size: .755rem; color: var(--tx-3); margin-top: 2px; }

.modal-body { padding: 6px 20px 18px; overflow-y: auto; }
.cfg-block { padding: 16px 0; border-bottom: 1px solid var(--line); }
.cfg-block:last-of-type { border-bottom: none; }
.cfg-block-head { display: flex; align-items: center; gap: 9px; margin-bottom: 4px; }
.cfg-block-head svg { width: 19px; height: 19px; color: var(--gold); }
.cfg-block-head h3 { font-size: .875rem; font-weight: 650; letter-spacing: -.01em; }
.cfg-block > .lab:first-of-type { margin-top: 12px; }

.avatar-editor { display: flex; gap: 16px; align-items: center; margin-top: 14px; }
.avatar-preview {
  width: 76px; height: 76px; min-width: 76px; border-radius: 20px; overflow: hidden;
  display: grid; place-items: center;
  background: linear-gradient(150deg, var(--c1, #8B93A6), var(--c2, #5B6478));
  color: #0B0C10; font-weight: 750; font-size: 1.7rem;
  border: 1px solid var(--line-2);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.22);
}
.avatar-preview img { width: 100%; height: 100%; object-fit: cover; }
.avatar-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.avatar-actions .btn { padding: 8px 13px; font-size: .82rem; }
.avatar-actions .hint { width: 100%; margin-top: 0; }

.pill {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: .655rem; font-weight: 700; letter-spacing: .04em;
  border-radius: 6px; padding: 2px 7px; margin-left: 6px;
  background: var(--s3); color: var(--tx-3); border: 1px solid var(--line-2);
  text-transform: none;
}
.pill.ok { color: var(--ok); background: rgba(52,211,153,.12); border-color: rgba(52,211,153,.28); }
.pill.no { color: var(--gold); background: var(--gold-dim); border-color: rgba(240,180,41,.28); }

.seg { display: flex; gap: 4px; background: var(--s1); border: 1px solid var(--line-2);
  border-radius: var(--r); padding: 4px; }
.seg button { flex: 1; padding: 8px 10px; border-radius: 9px;
  font-size: .81rem; font-weight: 600; color: var(--tx-2);
  transition: all .15s var(--ease); }
.seg button:hover { color: var(--tx); }
.seg button.on { background: var(--s4); color: var(--gold);
  box-shadow: inset 0 0 0 1px rgba(240,180,41,.24); }

.modal-err { color: var(--danger); font-size: .81rem; min-height: 1.1em; margin-top: 10px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px;
  padding: 14px 20px; border-top: 1px solid var(--line); background: var(--s2); }

/* ---------- lightbox ---------- */
#lightbox { position: fixed; inset: 0; z-index: 300; background: rgba(3,4,6,.93);
  display: grid; place-items: center; padding: 40px; animation: fade .15s var(--ease); }
#lightbox img { max-width: 100%; max-height: 100%; border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg); }
.lb-close { position: absolute; top: 20px; right: 22px; width: 42px; height: 42px;
  border-radius: 12px; background: var(--s3); border: 1px solid var(--line-2);
  color: var(--tx); display: grid; place-items: center; }
.lb-close:hover { background: var(--s4); }

/* ---------- scrollbar ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--s4); border-radius: 8px;
  border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #313846; background-clip: content-box; }

/* ---------- responsivo ---------- */
@media (max-width: 1240px) {
  .ch-right .lbl { display: none; }
  .ch-right .btn { padding: 10px 12px; }
}
@media (max-width: 1080px) {
  .auth-shell { width: min(960px, calc(100vw - 32px)); }
  .auth-story, .auth-entry { padding: 44px 38px; }
  #browser { position: fixed; inset: 0 0 0 auto; width: 88vw; min-width: 0; z-index: 120;
    box-shadow: var(--shadow-lg); }
  #panel { position: fixed; left: var(--rail); top: 0; bottom: 0; z-index: 100;
    box-shadow: var(--shadow-lg); }
  #panel.closed { width: var(--panel); min-width: var(--panel);
    transform: translateX(calc(-1 * var(--panel) - var(--rail))); }
}
@media (max-width: 560px) {
  :root { --rail: 58px; }
  #chat { min-width: 0; }
  .chat-head { padding: 12px 10px; }
  .ch-left { gap: 7px; }
  .ch-presence { max-width: 180px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #stream { padding-left: 12px; padding-right: 12px; }
  .composer-wrap { padding-left: 10px; padding-right: 10px; }
  #mentionPop { left: 10px; right: 10px; min-width: 0; }
}
