:root {
  --bg: #f5f7fb;
  --bg-glow: #efe9f8;
  --surface: #ffffff;
  --subtle: #fafbfe;
  --input-bg: #fafbfe;
  --hover: #f5f8fd;
  --topbar-bg: rgba(255, 255, 255, .8);
  --ink: #16233d;
  --ink-soft: #5b6b86;
  --muted: #8996ac;
  --blue: #160230;
  --blue-strong: #4c1d95;
  --blue-soft: #efe9f8;
  --blue-line: #ddd0f0;
  --line: #e9edf4;
  --hl: #fff2b8;
  --hl-line: #f2d675;
  --hl-ink: #4a3a00;
  --thumb: linear-gradient(135deg, #dbe7ff, #eef3ff);
  --shadow: 0 12px 34px rgba(22, 2, 48, .07);
  --shadow-sm: 0 1px 3px rgba(22, 35, 61, .05);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0d0e12;
  --bg-glow: #1e0a3a;
  --surface: #17181d;
  --subtle: #1d1e24;
  --input-bg: #1d1e24;
  --hover: rgba(255, 255, 255, .035);
  --topbar-bg: rgba(20, 21, 26, .8);
  --ink: #eceef2;
  --ink-soft: #9a9caa;
  --muted: #6b6e7a;
  --blue: #a78bfa;
  --blue-strong: #c4b5fd;
  --blue-soft: rgba(167, 139, 250, .16);
  --blue-line: rgba(167, 139, 250, .34);
  --line: rgba(255, 255, 255, .08);
  --hl: rgba(250, 204, 21, .2);
  --hl-line: rgba(250, 204, 21, .45);
  --hl-ink: #f4d375;
  --thumb: linear-gradient(135deg, #1f2b45, #232634);
  --shadow: 0 16px 40px rgba(0, 0, 0, .45);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, .3);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { height: 100%; overflow: hidden; }

body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background:
    radial-gradient(1200px 460px at 100% -10%, var(--bg-glow) 0%, transparent 60%),
    var(--bg);
  color: var(--ink);
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overscroll-behavior: none;
  transition: background .25s ease, color .25s ease;
}

button { font: inherit; cursor: pointer; }
a { color: inherit; }
.muted { color: var(--muted); }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 14px 28px;
  background: var(--topbar-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 42px; height: 42px;
  flex: 0 0 auto;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 6px 16px rgba(22, 2, 48, .22);
}
.brand-mark img { width: 100%; height: 100%; object-fit: cover; display: block; }
.brand-mark-lg { width: 54px; height: 54px; border-radius: 15px; }
.brand h1 { margin: 0; font-size: 16px; letter-spacing: -.2px; }
.brand p { margin: 1px 0 0; font-size: 12px; color: var(--muted); }

.tabs { display: flex; gap: 4px; margin-left: 8px; }
.tab {
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  padding: 9px 16px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 13.5px;
}
.tab.is-active { background: var(--blue-soft); color: var(--blue-strong); }

.icon-button {
  margin-left: auto;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  padding: 9px 14px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 13px;
  box-shadow: var(--shadow-sm);
  transition: border-color .15s, color .15s;
}
.icon-button:hover { border-color: var(--blue-line); color: var(--blue); }
.icon-button.icon-only { margin-left: 0; padding: 9px 11px; font-size: 15px; line-height: 1; }
#themeToggle { margin-left: auto; }
#refreshButton { margin-left: 0; }

/* ---------- Layout ---------- */
.wrap { max-width: 1120px; margin: 0 auto; padding: 30px 28px 80px; }

.list-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.list-header h2 { margin: 0 0 4px; font-size: 22px; letter-spacing: -.4px; }
.list-header p { margin: 0; font-size: 13px; }
.summary { display: flex; gap: 10px; }
.chip {
  padding: 8px 14px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  font-size: 12px;
  color: var(--ink-soft);
  white-space: nowrap;
}
.chip strong { color: var(--blue-strong); font-size: 15px; }

/* ---------- Grid de cards ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

.card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--blue-line); }

.thumb {
  aspect-ratio: 16 / 9;
  background: var(--thumb);
  background-size: cover;
  background-position: center;
  display: grid;
  place-items: center;
  color: #9db6ea;
  font-size: 30px;
}
.card-body { padding: 14px 15px 15px; }
.card-title {
  margin: 0 0 8px;
  font-size: 14.5px;
  font-weight: 750;
  line-height: 1.35;
  letter-spacing: -.1px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 40px;
}
.card-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.src-badge {
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .2px;
}
.src-youtube { background: #ffe6e6; color: #d33; }
.src-disney { background: #e6efff; color: #1a49b8; }
.src-unknown { background: #eef1f6; color: #6b7790; }

.pill {
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue-strong);
  font-size: 10.5px;
  font-weight: 800;
}
.pill.ghost { background: var(--subtle); color: var(--muted); }

.card-date { margin-left: auto; font-size: 11px; color: var(--muted); }

.card-del {
  position: absolute;
  top: 10px; right: 10px;
  width: 30px; height: 30px;
  border-radius: 9px;
  border: 0;
  background: var(--topbar-bg);
  color: #c04b4b;
  font-size: 14px;
  opacity: 0;
  transition: opacity .15s;
  box-shadow: var(--shadow-sm);
}
.card:hover .card-del { opacity: 1; }
.card-del:hover { background: #ffe6e6; }

/* ---------- Empty ---------- */
.empty { text-align: center; padding: 80px 20px; color: var(--ink-soft); }
.empty-art { font-size: 46px; margin-bottom: 10px; }
.empty h3 { margin: 0 0 8px; font-size: 18px; color: var(--ink); }
.empty p { margin: 0 auto; max-width: 440px; font-size: 13.5px; line-height: 1.6; }

/* ---------- Detalhe ---------- */
.back {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  padding: 8px 14px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}
.back:hover { color: var(--blue); border-color: var(--blue-line); }

.detail-head {
  display: flex;
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  margin-bottom: 18px;
}
.detail-thumb {
  flex: 0 0 200px;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  background: var(--thumb);
  background-size: cover;
  background-position: center;
}
.detail-info h2 { margin: 0 0 8px; font-size: 20px; letter-spacing: -.3px; line-height: 1.3; }
.detail-info .card-meta { margin-bottom: 12px; }
.watch-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: 11px;
  background: linear-gradient(150deg, #3d1a6b, #160230);
  color: #fff;
  font-weight: 750;
  font-size: 13px;
  text-decoration: none;
  box-shadow: 0 8px 20px rgba(22, 2, 48, .28);
}
.watch-link:hover { filter: brightness(1.06); }
.detail-url { margin: 10px 0 0; font-size: 12px; color: var(--muted); word-break: break-all; }

/* ---------- Subtabs ---------- */
.subtabs {
  display: flex;
  gap: 6px;
  padding: 5px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  width: fit-content;
  margin-bottom: 18px;
}
.subtab {
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  padding: 9px 18px;
  border-radius: 10px;
  font-weight: 750;
  font-size: 13.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.subtab.is-active { background: var(--blue); color: #fff; }
.subtab .count {
  padding: 1px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .25);
  font-size: 11px;
}
.subtab:not(.is-active) .count { background: var(--blue-soft); color: var(--blue-strong); }

/* ---------- Transcrição ---------- */
.panel {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  padding: 8px;
}
.line {
  display: flex;
  gap: 14px;
  padding: 11px 14px;
  border-radius: 12px;
  transition: background .12s;
}
.line:hover { background: var(--hover); }
.line + .line { border-top: 1px solid var(--line); }
.line-time {
  flex: 0 0 58px;
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  font-weight: 700;
  color: var(--blue);
  padding-top: 2px;
}
.line-time a { text-decoration: none; }
.line-time a:hover { text-decoration: underline; }
.line-text { font-size: 15px; line-height: 1.6; color: var(--ink); }
.ne-hl {
  background: var(--hl);
  box-shadow: inset 0 -2px 0 var(--hl-line);
  border-radius: 3px;
  padding: 0 2px;
  color: var(--hl-ink);
}

/* ---------- Marcados ---------- */
.mark {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 15px;
}
.mark + .mark { border-top: 1px solid var(--line); }
.mark-time {
  flex: 0 0 64px;
  text-align: center;
}
.mark-time a {
  display: inline-block;
  padding: 6px 8px;
  border-radius: 9px;
  background: var(--blue-soft);
  color: var(--blue-strong);
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-decoration: none;
}
.mark-time a:hover { background: var(--blue); color: #fff; }
.mark-body { flex: 1; min-width: 0; }
.mark-term {
  font-size: 17px;
  font-weight: 750;
  letter-spacing: -.2px;
  color: var(--ink);
}
.mark-kind {
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  vertical-align: middle;
}
.kind-word { background: var(--blue-soft); color: var(--blue-strong); }
.kind-phrase { background: #eafaf0; color: #1c9e57; }
.mark-context { margin: 7px 0 0; font-size: 13px; color: var(--ink-soft); line-height: 1.55; }
.mark-context b { color: var(--ink); background: var(--hl); border-radius: 3px; padding: 0 2px; }
.mark-trans { margin: 6px 0 0; font-size: 13px; color: var(--blue-strong); font-style: italic; }
.mark-del {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 15px;
  padding: 4px 8px;
  border-radius: 8px;
}
.mark-del:hover { background: #ffe6e6; color: #c04b4b; }

/* ---------- Aba Extensão ---------- */
.ext-card {
  max-width: 720px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.ext-hero {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 24px;
  background: var(--subtle);
  border-bottom: 1px solid var(--line);
}
.ext-logo {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 56px; height: 56px;
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(150deg, #3d1a6b, #160230);
  color: #fff;
  font-weight: 900;
  font-size: 18px;
  letter-spacing: -.5px;
  box-shadow: 0 10px 24px rgba(22, 2, 48, .32);
}
.ext-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ext-hero-info { flex: 1; min-width: 0; }
.ext-hero-info h3 { margin: 0 0 8px; font-size: 17px; letter-spacing: -.2px; }
.ext-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 12.5px; }
.ext-download {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 13px;
  background: linear-gradient(150deg, #3d1a6b, #160230);
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  text-decoration: none;
  box-shadow: 0 10px 24px rgba(22, 2, 48, .3);
  transition: filter .15s, transform .15s;
}
.ext-download:hover { filter: brightness(1.06); transform: translateY(-1px); }
.ext-download.disabled { opacity: .5; pointer-events: none; filter: grayscale(.4); }

.ext-steps {
  margin: 0;
  padding: 22px 24px 24px 44px;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.85;
}
.ext-steps code {
  background: var(--blue-soft);
  color: var(--blue-strong);
  padding: 1px 7px;
  border-radius: 6px;
  font-size: 12.5px;
}
.ext-steps strong { color: var(--ink); }

@media (max-width: 560px) {
  .ext-hero { flex-wrap: wrap; }
  .ext-download { width: 100%; justify-content: center; }
}

/* ---------- Loading / toast ---------- */
.loading { padding: 60px; text-align: center; color: var(--muted); }
.toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .22);
  z-index: 50;
}

@media (max-width: 640px) {
  .detail-head { flex-direction: column; }
  .detail-thumb { flex-basis: auto; width: 100%; }
  .topbar { padding: 12px 16px; gap: 12px; }
  .wrap { padding: 22px 16px 60px; }
}

/* ================= DASHBOARD (visão geral) ================= */
.dash-hero {
  position: relative;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 26px 28px;
  border-radius: 22px;
  background:
    radial-gradient(120% 160% at 88% 0%, rgba(167,139,250,.35), transparent 55%),
    linear-gradient(135deg, #2a0f52 0%, #43208a 52%, #5b21b6 100%);
  color: #fff;
  box-shadow: 0 18px 44px rgba(46, 8, 84, .45);
  overflow: hidden;
  margin-bottom: 18px;
}
.dash-hero-icon {
  flex: 0 0 auto;
  width: 64px; height: 64px; border-radius: 20px;
  display: grid; place-items: center;
  background: rgba(255,255,255,.12);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.18), 0 0 30px rgba(167,139,250,.35);
}
.dash-hero-icon svg { width: 30px; height: 30px; color: #fff; }
.dash-hero-main { display: flex; flex-direction: column; gap: 5px; flex: 1; min-width: 0; z-index: 1; }
.dash-hero-label { font-size: 13px; font-weight: 700; color: #d9ccff; letter-spacing: .3px; }
.dash-hero-value { font-size: 44px; font-weight: 900; letter-spacing: -1.2px; line-height: 1.02; font-variant-numeric: tabular-nums; }
.dash-hero-sub { font-size: 13px; color: rgba(255,255,255,.75); }
.dash-hero-filter {
  position: absolute; top: 18px; right: 20px; z-index: 2;
  display: inline-flex; align-items: center; gap: 2px;
  padding: 3px; border-radius: 999px;
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.14);
  backdrop-filter: blur(6px);
}
.dash-hero-filter button {
  border: 0; background: transparent; color: rgba(255,255,255,.72);
  padding: 6px 14px; border-radius: 999px; cursor: pointer;
  font-family: inherit; font-size: 12px; font-weight: 700; letter-spacing: .1px;
  transition: background .14s, color .14s;
}
.dash-hero-filter button:hover { color: #fff; }
.dash-hero-filter button.is-active { background: rgba(255,255,255,.95); color: #3d1a6b; }
.dash-hero-filter input[type="date"] {
  border: 0; background: rgba(255,255,255,.9); color: #3d1a6b;
  border-radius: 999px; padding: 5px 10px; font-family: inherit; font-size: 12px; font-weight: 700;
}
@media (max-width: 620px) {
  .dash-hero-filter { position: static; margin-top: 4px; align-self: flex-start; }
}
@media (max-width: 620px) {
  .dash-hero-spark { display: none; }
  .dash-hero-value { font-size: 36px; }
}

.dash-modes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.mode-card {
  position: relative;
  padding: 17px 18px 18px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid transparent;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: border-color .14s, box-shadow .14s, transform .14s;
}
.mode-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--blue-line); }
.mode-top { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.mode-name { font-size: 12.5px; font-weight: 750; color: var(--ink-soft); }
.mode-level { margin-left: auto; font-size: 10.5px; font-weight: 800; color: var(--muted); }
.mode-main { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mode-time { font-size: 26px; font-weight: 850; letter-spacing: -.6px; font-variant-numeric: tabular-nums; }
.mode-ico {
  flex: 0 0 auto; display: grid; place-items: center;
  width: 36px; height: 36px; border-radius: 11px;
  color: var(--ink); background: var(--subtle);
}
.mode-ico svg { width: 20px; height: 20px; }
.mode-pct { font-size: 12px; color: var(--muted); margin-top: 6px; }
.mode-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: transparent; }
.mode-bar i { display: block; height: 100%; border-radius: 0 3px 3px 0; background: var(--ink); opacity: .32; transition: width .5s ease; }

.dash-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.dash-panel {
  padding: 20px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid transparent;
  box-shadow: var(--shadow-sm);
}
.dash-panel-title { margin: 0 0 16px; font-size: 15px; letter-spacing: -.2px; }

/* Rosca (donut) de distribuição */
.dist-wrap { display: flex; align-items: center; gap: 22px; }
.donut {
  flex: 0 0 auto; position: relative; width: 148px; height: 148px; border-radius: 50%;
  background: conic-gradient(var(--line) 0 100%);
  display: grid; place-items: center;
}
.donut::after {
  content: ""; position: absolute; inset: 20px; border-radius: 50%; background: var(--surface);
}
.donut-hole { position: relative; z-index: 1; text-align: center; line-height: 1.1; }
.donut-hole b { display: block; font-size: 19px; font-weight: 850; letter-spacing: -.4px; color: var(--ink); font-variant-numeric: tabular-nums; }
.donut-hole i { font-size: 11.5px; font-style: normal; font-weight: 700; color: var(--muted); }
.dist-legend { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 9px; }
.dist-row { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 10px; font-size: 12.5px; }
.dist-row .mode-dot { flex: 0 0 auto; width: 9px; height: 9px; border-radius: 999px; box-shadow: none; }
.dist-row .dist-name { color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dist-row .dist-time { font-weight: 700; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.dist-row .dist-val { min-width: 34px; text-align: right; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
@media (max-width: 460px) {
  .dist-wrap { flex-direction: column; align-items: stretch; }
  .donut { margin: 0 auto; }
}

.history { display: flex; flex-direction: column; gap: 4px; }
.hist-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  transition: background .12s;
}
.hist-item:hover { background: var(--hover); }
.hist-thumb {
  flex: 0 0 auto;
  width: 54px; height: 32px;
  border-radius: 7px;
  background: var(--thumb) center/cover;
  display: grid; place-items: center;
  font-size: 14px; color: #9db6ea;
}
.hist-info { flex: 1; min-width: 0; }
.hist-title { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hist-meta { font-size: 11px; color: var(--muted); }
.hist-more { flex: 0 0 auto; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; color: var(--muted); }
.hist-more svg { width: 16px; height: 16px; }
.hist-item:hover .hist-more { color: var(--ink-soft); }

/* ================= LAB CHECKUP ================= */
.add-btn {
  width: 44px; height: 44px;
  border-radius: 14px;
  border: 0;
  background: linear-gradient(150deg, #3d1a6b, #160230);
  color: #fff;
  font-size: 24px;
  font-weight: 400;
  line-height: 1;
  box-shadow: 0 10px 24px rgba(22, 2, 48, .3);
  transition: transform .15s, filter .15s;
}
.add-btn:hover { filter: brightness(1.06); transform: translateY(-1px) rotate(90deg); }

.report-card { padding: 18px 18px 16px; }
.report-card .rc-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: #eafaf0;
  color: #1c9e57;
  font-size: 10.5px;
  font-weight: 800;
  margin-bottom: 10px;
}
.report-card h3 { margin: 0 0 6px; font-size: 15px; }
.report-card .rc-period { font-size: 12.5px; color: var(--ink-soft); }
.report-card .rc-metric { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }

/* ================= MODAL / RELATÓRIO ================= */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(16, 27, 48, .55);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 34px 20px;
  overflow-y: auto;
}
.modal-backdrop[hidden] { display: none; }
.modal {
  width: 100%;
  max-width: 860px;
  background: var(--surface);
  border-radius: 22px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .35);
  overflow: hidden;
}
.modal-bar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 22px;
  background: var(--topbar-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.modal-bar-info { display: flex; flex-direction: column; }
.modal-bar-info strong { font-size: 15px; }
.modal-period { font-size: 12.5px; color: var(--blue-strong); font-weight: 700; }
.modal-bar-actions { display: flex; align-items: center; gap: 8px; }
.btn-soft {
  border: 0;
  background: linear-gradient(150deg, #3d1a6b, #160230);
  color: #fff;
  padding: 9px 18px;
  border-radius: 10px;
  font-weight: 800;
  font-size: 13px;
  box-shadow: 0 8px 18px rgba(22, 2, 48, .28);
}
.btn-close {
  width: 38px; height: 38px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 15px;
}
.btn-close:hover { background: var(--hover); }

.modal-body { padding: 30px 40px 50px; }

/* ---- documento do relatório ---- */
.doc-hero {
  text-align: center;
  padding: 20px 0 26px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 26px;
}
.doc-hero .doc-kicker {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue-strong);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .5px;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.doc-hero h1 { margin: 0 0 4px; font-size: 30px; letter-spacing: -.6px; }
.doc-hero .doc-week { font-size: 15px; color: var(--blue-strong); font-weight: 800; }
.doc-hero p { max-width: 560px; margin: 14px auto 0; font-size: 13.5px; line-height: 1.7; color: var(--ink-soft); }

.doc-attention {
  margin: 18px auto 0;
  max-width: 560px;
  padding: 10px 16px;
  border-radius: 12px;
  background: #fff7e0;
  border: 1px solid #f2d675;
  color: #7a5a00;
  font-size: 12.5px;
  font-weight: 700;
}

.doc-section { margin: 34px 0; }
.doc-section > h2 {
  font-size: 20px;
  letter-spacing: -.3px;
  margin: 0 0 6px;
  display: flex; align-items: center; gap: 10px;
}
.doc-section > h2::before {
  content: "";
  width: 6px; height: 22px;
  border-radius: 4px;
  background: linear-gradient(#3d1a6b, #160230);
}
.doc-section > .doc-intro { margin: 0 0 18px; font-size: 13.5px; line-height: 1.7; color: var(--ink-soft); }

.doc-cards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.doc-card {
  padding: 18px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--subtle);
}
.doc-card.lvl { border-top: 4px solid var(--blue); }
.doc-card.lvl.l1 { border-top-color: #7452ef; }
.doc-card.lvl.l2 { border-top-color: #160230; }
.doc-card.lvl.l3 { border-top-color: #12a45c; }
.doc-card h4 { margin: 0 0 8px; font-size: 14px; }
.doc-card p { margin: 0; font-size: 12.5px; line-height: 1.6; color: var(--ink-soft); }

.doc-note {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--blue-soft);
  color: var(--blue-strong);
  font-size: 12.5px;
  line-height: 1.6;
}

.doc-scale { display: flex; justify-content: space-between; gap: 12px; margin: 18px 0; }
.doc-scale .sc { text-align: center; flex: 1; }
.doc-scale .sc b { display: block; font-size: 22px; color: var(--blue-strong); }
.doc-scale .sc span { font-size: 11.5px; color: var(--muted); }
.doc-scale .sc small { display: block; font-size: 11px; color: var(--ink-soft); margin-top: 2px; }

.doc-signals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 16px; }
.doc-signal { padding: 14px; border-radius: 14px; font-size: 12px; line-height: 1.55; }
.doc-signal h4 { margin: 0 0 6px; font-size: 13px; }
.sig-green { background: #eafaf0; color: #14663a; }
.sig-yellow { background: #fff7e0; color: #7a5a00; }
.sig-red { background: #fdeaea; color: #9a2b2b; }

/* ---- campos preenchíveis ---- */
.field-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-top: 6px; }
.f-field { display: flex; flex-direction: column; gap: 6px; }
.f-field > label { font-size: 12px; font-weight: 700; color: var(--ink-soft); }
.f-field input[type="text"],
.f-field input[type="number"],
.f-field select,
.f-field textarea {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 11px;
  font: inherit;
  font-size: 13px;
  background: var(--subtle);
  color: var(--ink);
  outline: none;
}
.f-field input:focus, .f-field select:focus, .f-field textarea:focus { border-color: var(--blue); background: var(--surface); }
.f-field textarea { min-height: 74px; resize: vertical; }

.f-auto {
  border: 1px solid var(--blue-line) !important;
  background: var(--blue-soft) !important;
  color: var(--blue-strong) !important;
  font-weight: 800;
}
.auto-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  vertical-align: middle;
}

.check-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 6px; }
.check-col h4 { margin: 0 0 10px; font-size: 13px; color: var(--ink); }
.check-item { display: flex; gap: 10px; align-items: flex-start; padding: 7px 0; font-size: 12.5px; color: var(--ink-soft); line-height: 1.4; }
.check-item input { margin-top: 2px; width: 16px; height: 16px; accent-color: var(--blue); flex: 0 0 auto; }
.ec-result {
  margin-top: 16px;
  padding: 14px 18px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 700;
  display: flex; align-items: center; gap: 12px;
}
.ec-score { font-size: 24px; font-weight: 900; }

.fw-block { margin-top: 18px; padding: 18px; border-radius: 16px; border: 1px solid var(--line); background: var(--subtle); }
.fw-block h4 { margin: 0 0 14px; font-size: 14px; color: var(--blue-strong); }
.rating-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }

.doc-slider { margin-top: 6px; }
.doc-slider input[type="range"] { width: 100%; accent-color: var(--blue); }
.doc-slider .val { font-size: 26px; font-weight: 900; color: var(--blue-strong); }

.doc-finale { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 20px; text-align: center; }
.doc-finale .fin b { display: block; font-size: 30px; color: var(--blue-strong); }
.doc-finale .fin span { display: block; font-size: 13px; font-weight: 800; margin: 2px 0 4px; }
.doc-finale .fin small { font-size: 11.5px; color: var(--ink-soft); line-height: 1.5; }

.doc-congrats {
  margin-top: 30px;
  padding: 22px;
  border-radius: 18px;
  text-align: center;
  background: var(--subtle);
  border: 1px solid var(--blue-line);
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--ink-soft);
}

@media (max-width: 1040px) { .dash-modes { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 500px) { .dash-modes { grid-template-columns: 1fr; } }
@media (max-width: 720px) {
  .dash-columns { grid-template-columns: 1fr; }
  .check-grid { grid-template-columns: 1fr; }
  .doc-signals { grid-template-columns: 1fr; }
  .doc-finale { grid-template-columns: 1fr; }
  .modal-body { padding: 22px; }
}

/* ================= AUTENTICAÇÃO ================= */
.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(1000px 500px at 80% -10%, var(--bg-glow) 0%, transparent 60%),
    var(--bg);
}
.auth-screen[hidden] { display: none; }
.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 30px;
}
.auth-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.auth-brand h1 { margin: 0; font-size: 20px; letter-spacing: -.3px; }
.auth-brand p { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }

.auth-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--subtle);
  border-radius: 12px;
  margin-bottom: 20px;
}
.auth-tab {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  padding: 9px;
  border-radius: 9px;
  font-weight: 750;
  font-size: 13.5px;
  cursor: pointer;
}
.auth-tab.is-active { background: var(--surface); color: var(--blue-strong); box-shadow: var(--shadow-sm); }

.auth-field { display: block; margin-bottom: 14px; }
.auth-field > span { display: block; margin: 0 0 6px 2px; font-size: 12px; font-weight: 700; color: var(--ink-soft); }
.auth-field input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 11px 13px;
  font: inherit;
  font-size: 14px;
  background: var(--input-bg);
  color: var(--ink);
  outline: none;
}
.auth-field input:focus { border-color: var(--blue); }

.auth-submit {
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: 13px;
  margin-top: 6px;
  background: linear-gradient(150deg, #3d1a6b, #160230);
  color: #fff;
  font-weight: 800;
  font-size: 14.5px;
  box-shadow: 0 10px 24px rgba(22, 2, 48, .3);
  transition: filter .15s;
  cursor: pointer;
}
.auth-submit:hover { filter: brightness(1.06); }
.auth-submit:disabled { opacity: .6; cursor: default; }
.auth-error { min-height: 18px; margin: 12px 0 0; text-align: center; font-size: 12.5px; color: #f78ca0; font-weight: 600; }

/* (estilos de .user-chip / logout movidos para o rodapé do menu, mais abaixo) */

/* ================= VOZ / SOM ================= */
.mark-term-row { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.mark-speak {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 30px; height: 30px;
  border: 1px solid var(--blue-line);
  border-radius: 9px;
  background: var(--blue-soft);
  color: var(--blue-strong);
  cursor: pointer;
  transition: background .14s, color .14s, transform .1s;
}
.mark-speak:hover { background: var(--blue); color: #fff; }
.mark-speak:active { transform: scale(.94); }
.mark-speak.is-loading { pointer-events: none; opacity: .6; animation: speakPulse 1s ease-in-out infinite; }
@keyframes speakPulse { 50% { opacity: 1; } }

/* ================= MODAL DE CONFIGURAÇÃO ================= */
.modal.modal-sm { max-width: 460px; }
.settings-form { display: flex; flex-direction: column; gap: 15px; }
.s-field { display: flex; flex-direction: column; gap: 6px; }
.s-field > span { font-size: 12.5px; font-weight: 700; color: var(--ink-soft); }
.s-field > span em { color: var(--muted); font-style: normal; font-weight: 600; }
.s-field select,
.s-field input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 11px 13px;
  font: inherit;
  font-size: 14px;
  background: var(--input-bg);
  color: var(--ink);
  outline: none;
}
.s-field select:focus,
.s-field input:focus { border-color: var(--blue); }
.s-actions { display: flex; }
.btn-outline {
  border: 1px solid var(--blue-line);
  background: var(--blue-soft);
  color: var(--blue-strong);
  padding: 10px 16px;
  border-radius: 11px;
  font-weight: 750;
  font-size: 13.5px;
  cursor: pointer;
  transition: background .14s;
}
.btn-outline:hover { background: var(--blue); color: #fff; }
.btn-outline.is-loading { pointer-events: none; opacity: .7; }
.s-hint { margin: 0; font-size: 12px; line-height: 1.55; color: var(--muted); }

/* ---------- Seletor de intervalo do relatório ---------- */
.period-picker { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.period-picker label { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; color: var(--muted); }
.period-picker input[type="date"] {
  border: 1px solid var(--line); background: var(--input-bg); color: var(--ink);
  border-radius: 8px; padding: 5px 8px; font-size: 12px; font-family: inherit;
}
.period-picker input[type="date"]:focus { outline: none; border-color: var(--blue); }
.btn-mini {
  border: 1px solid var(--blue-line); background: var(--blue-soft); color: var(--blue-strong);
  border-radius: 8px; padding: 5px 10px; font-size: 11px; font-weight: 800; cursor: pointer;
}
.btn-mini:hover { background: var(--blue); color: #fff; }

/* ---------- Estudo Ativo (Pomodoro) ---------- */
.pomo-wrap { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 720px) { .pomo-wrap { grid-template-columns: 1fr; } }
.pomo-card {
  --pomo-accent: var(--blue);
  --pomo-accent-soft: var(--blue-soft);
  background: var(--surface); border: 1px solid var(--line); border-radius: 24px;
  box-shadow: var(--shadow); padding: 34px 28px 30px; text-align: center;
}
.pomo-card.is-break { --pomo-accent: #f59e0b; --pomo-accent-soft: rgba(245, 158, 11, .16); }

/* Anel circular de progresso */
.pomo-ring-wrap {
  position: relative; width: 300px; max-width: 76%; aspect-ratio: 1;
  margin: 4px auto 26px; display: grid; place-items: center;
}
.pomo-ring { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.pomo-ring-track { fill: none; stroke: var(--line); stroke-width: 12; opacity: .7; }
.pomo-ring-fill {
  fill: none; stroke: var(--pomo-accent); stroke-width: 12; stroke-linecap: round;
  stroke-dasharray: 841.95; stroke-dashoffset: 841.95;
  filter: drop-shadow(0 0 8px color-mix(in srgb, var(--pomo-accent) 55%, transparent));
  transition: stroke-dashoffset 1s linear, stroke .4s ease;
}
.pomo-card.is-running .pomo-ring-fill { animation: pomoGlow 2.4s ease-in-out infinite; }
@keyframes pomoGlow {
  0%, 100% { filter: drop-shadow(0 0 6px color-mix(in srgb, var(--pomo-accent) 45%, transparent)); }
  50% { filter: drop-shadow(0 0 16px color-mix(in srgb, var(--pomo-accent) 75%, transparent)); }
}
.pomo-ring-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }

.pomo-phase {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 800; letter-spacing: 1.4px; text-transform: uppercase;
  padding: 5px 13px; border-radius: 999px;
  background: var(--pomo-accent-soft); color: var(--pomo-accent);
}
.pomo-phase.is-break { color: #b45309; }
:root[data-theme="dark"] .pomo-phase.is-break { color: #fbbf24; }
.pomo-phase::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pomo-card.is-running .pomo-phase::before { animation: pomoDot 1.4s ease-in-out infinite; }
@keyframes pomoDot { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.7); } }
.pomo-timer {
  font-size: 62px; font-weight: 900; line-height: 1; letter-spacing: -2px;
  color: var(--ink); font-variant-numeric: tabular-nums;
}
.pomo-sub { font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .2px; }
.pomo-actions { display: flex; gap: 10px; justify-content: center; margin-bottom: 22px; }
.pomo-actions .btn-primary,
.pomo-actions .btn-outline { border-radius: 999px; padding-left: 24px; padding-right: 24px; }
.pomo-actions .btn-primary { min-width: 130px; }
.pomo-config { display: flex; gap: 14px; justify-content: center; }
.pomo-config label {
  display: flex; flex-direction: column; gap: 4px; font-size: 11px; font-weight: 700;
  color: var(--muted); text-align: left;
}
.pomo-config input {
  width: 92px; border: 1px solid var(--line); background: var(--input-bg); color: var(--ink);
  border-radius: 10px; padding: 8px 10px; font-size: 15px; font-weight: 800; font-family: inherit;
}
.pomo-config input:focus { outline: none; border-color: var(--blue); }
.pomo-side {
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px;
  box-shadow: var(--shadow-sm); padding: 20px; display: flex; flex-direction: column; gap: 14px;
}
.pomo-stat { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.pomo-stat + .pomo-stat { border-top: 1px solid var(--line); padding-top: 14px; }
.pomo-stat-label { font-size: 12px; color: var(--muted); font-weight: 700; }
.pomo-stat-value { font-size: 24px; font-weight: 900; color: var(--blue); letter-spacing: -.5px; }
.pomo-hint { margin: 6px 0 0; font-size: 12px; line-height: 1.55; color: var(--muted); }
.pomo-add-btn { width: 100%; border-radius: 12px; justify-content: center; margin-top: 4px; }
.addactive-time { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ---------- Configurações: divisória ---------- */
.s-divider { border: 0; border-top: 1px solid var(--line); margin: 18px 0 4px; }

/* ---------- Aba Diálogo ---------- */
.dialog-daybar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.dialog-day-label { font-size: 13px; font-weight: 800; color: var(--ink); }
.dialog-daybar input[type="date"] {
  border: 1px solid var(--line); background: var(--input-bg); color: var(--ink);
  border-radius: 9px; padding: 6px 10px; font-size: 13px; font-family: inherit;
}
.dialog-daybar input[type="date"]:focus { outline: none; border-color: var(--blue); }
.grid-1 { display: flex; flex-direction: column; gap: 14px; }
.dlg-card { padding: 16px 18px; }
.dlg-head { display: flex; align-items: center; gap: 6px; }
.dlg-term { font-size: 16px; font-weight: 800; color: var(--ink); letter-spacing: -.2px; }
.dlg-context { margin: 8px 0 12px; font-size: 13px; color: var(--ink-soft); font-style: italic; line-height: 1.5; }
.dlg-sentences { margin: 4px 0 12px; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 9px; }
.dlg-sentences li {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 11px 13px; border: 1px solid var(--line); border-radius: 11px; background: var(--subtle);
  font-size: 14px; line-height: 1.5; color: var(--ink);
}
.dlg-sentences .mark-speak { flex: 0 0 auto; margin-top: 1px; }
.btn-xs { min-height: 30px; padding: 5px 12px; font-size: 12px; border-radius: 9px; }

/* ---------- Diálogo: controles em lote ---------- */
.dialog-controls { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.dialog-ctl { display: flex; flex-direction: column; gap: 5px; flex: 1 1 180px; }
.dialog-ctl > span { font-size: 11px; font-weight: 800; color: var(--muted); }
.dialog-ctl > span em { font-weight: 600; font-style: normal; opacity: .8; }
.dialog-ctl input {
  border: 1px solid var(--line); background: var(--input-bg); color: var(--ink);
  border-radius: 9px; padding: 8px 11px; font-size: 13px; font-family: inherit;
}
.dialog-ctl input:focus { outline: none; border-color: var(--blue); }
.dlg-pattern { margin-bottom: 14px; border-color: var(--blue-line); }
.dlg-waiting { margin: 6px 0 0; font-size: 13px; color: var(--muted); }

/* ---------- Conversação: agentes ---------- */
.agent-card { position: relative; text-align: center; cursor: pointer; transition: transform .12s, box-shadow .12s; }
.agent-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.agent-avatar {
  width: 66px; height: 66px; margin: 4px auto 10px; border-radius: 18px;
  display: grid; place-items: center; font-size: 30px; overflow: hidden;
  background: var(--blue-soft); box-shadow: var(--shadow-sm);
}
.agent-avatar img { width: 100%; height: 100%; object-fit: cover; }
.agent-card h3 { margin: 0 0 3px; font-size: 15px; color: var(--ink); }
.agent-tone { margin: 0 0 10px; font-size: 12px; color: var(--muted); }
.agent-mode-pill {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  background: var(--subtle); border: 1px solid var(--line); font-size: 10.5px; font-weight: 800; color: var(--ink-soft);
}

/* ---------- Conversação: chat ---------- */
.chat-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.chat-agent { display: flex; align-items: center; gap: 11px; }
.chat-avatar {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  font-size: 20px; overflow: hidden; background: var(--blue-soft); flex: 0 0 auto;
}
.chat-avatar img { width: 100%; height: 100%; object-fit: cover; }
.chat-agent-info { display: flex; flex-direction: column; }
.chat-agent-info strong { font-size: 15px; color: var(--ink); }
.chat-agent-info .muted { font-size: 11.5px; }
.chat-messages {
  min-height: 320px; max-height: 56vh; overflow-y: auto;
  padding: 16px; border: 1px solid var(--line); border-radius: 16px;
  background: var(--subtle); display: flex; flex-direction: column; gap: 10px;
}
.msg { display: flex; align-items: flex-end; gap: 8px; max-width: 82%; }
.msg-user { align-self: flex-end; flex-direction: row-reverse; }
.msg-agent { align-self: flex-start; }
.msg-bubble {
  padding: 10px 14px; border-radius: 15px; font-size: 14px; line-height: 1.5;
  white-space: pre-wrap; word-break: break-word;
}
.msg-user .msg-bubble { background: var(--blue); color: #fff; border-bottom-right-radius: 5px; }
.msg-agent .msg-bubble { background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-bottom-left-radius: 5px; }
.msg-speak {
  flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--surface); cursor: pointer; font-size: 13px; line-height: 1;
}
.msg-speak:hover { background: var(--blue-soft); }
.msg-typing { display: inline-flex; gap: 4px; }
.msg-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.msg-typing span:nth-child(2) { animation-delay: .2s; }
.msg-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 60%, 100% { opacity: .3; } 30% { opacity: 1; } }

.chat-input { display: flex; align-items: center; gap: 9px; margin-top: 12px; }
.chat-input input {
  flex: 1; min-height: 44px; border: 1px solid var(--line); background: var(--input-bg); color: var(--ink);
  border-radius: 12px; padding: 10px 14px; font-size: 14px; font-family: inherit; outline: none;
}
.chat-input input:focus { border-color: var(--blue); }
.chat-mic {
  width: 44px; height: 44px; flex: 0 0 auto; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); cursor: pointer; font-size: 18px;
}
.chat-mic:hover { background: var(--blue-soft); }
.chat-mic.recording { background: #ef4444; border-color: #ef4444; color: #fff; animation: recPulse 1.1s infinite; }
@keyframes recPulse { 50% { box-shadow: 0 0 0 6px rgba(239,68,68,.25); } }
.chat-send {
  min-height: 44px; padding: 0 18px; border: 0; border-radius: 12px; cursor: pointer;
  background: linear-gradient(150deg, #4c1d95, #160230); color: #fff; font-weight: 800; font-size: 14px;
}
:root[data-theme="dark"] .chat-send { background: linear-gradient(150deg, #7c4bc0, #4c1d95); }

/* ---------- Modal do agente ---------- */
.agent-avatar-row { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.agent-avatar-preview {
  width: 60px; height: 60px; flex: 0 0 auto; border-radius: 16px; display: grid; place-items: center;
  font-size: 28px; overflow: hidden; background: var(--blue-soft); border: 1px solid var(--line);
}
.agent-avatar-preview img { width: 100%; height: 100%; object-fit: cover; }
.agent-pick { cursor: pointer; }
.settings-form textarea {
  width: 100%; border: 1px solid var(--line); background: var(--input-bg); color: var(--ink);
  border-radius: 10px; padding: 10px 12px; font-size: 13px; font-family: inherit; resize: vertical;
}
.settings-form textarea:focus { outline: none; border-color: var(--blue); }

/* ---------- Conversação: layout com lista de conversas ---------- */
.chat-head { justify-content: flex-start; }
.chat-new { margin-left: auto; }
.chat-layout { display: grid; grid-template-columns: 230px 1fr; gap: 14px; align-items: start; }
@media (max-width: 720px) { .chat-layout { grid-template-columns: 1fr; } }
.chat-convs {
  display: flex; flex-direction: column; gap: 6px;
  max-height: 62vh; overflow-y: auto;
}
@media (max-width: 720px) { .chat-convs { flex-direction: row; flex-wrap: wrap; max-height: none; } }
.conv-item {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 11px; background: var(--surface);
  cursor: pointer; transition: border-color .12s, background .12s;
}
.conv-item:hover { border-color: var(--blue-line); }
.conv-item.active { border-color: var(--blue); background: var(--blue-soft); }
.conv-title {
  flex: 1; min-width: 0; font-size: 12.5px; font-weight: 700; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.conv-del { flex: 0 0 auto; border: 0; background: transparent; cursor: pointer; font-size: 13px; opacity: .55; }
.conv-del:hover { opacity: 1; }
.chat-main { min-width: 0; }

/* ===================================================================
   Conversação — visual refinado (chat dark/vidro, fundo sólido)
   =================================================================== */
#conversacaoView .agent-avatar { background: linear-gradient(150deg,#a78bfa,#5b21b6); color:#fff; }
#conversacaoView #newAgentButton { }

/* Painel de chat: fundo sólido escuro (sem animação) */
#chatWrap {
  background: #0e0b18;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 22px;
  padding: 18px;
  color: #ececf2;
  box-shadow: 0 20px 50px rgba(22,2,48,.28);
}
#chatWrap .chat-head { margin-bottom: 16px; align-items: center; }
#chatWrap .back { color: #b9a7e6; }
#chatWrap .back:hover { color: #d9ccff; }
#chatWrap .chat-agent-info strong { color: #fff; }
#chatWrap .chat-agent-info .muted { color: rgba(255,255,255,.45); }
#chatWrap .chat-avatar { background: linear-gradient(150deg,#a78bfa,#5b21b6); }
#chatWrap .chat-new {
  background: rgba(255,255,255,.06); color: #e9e3ff; border: 1px solid rgba(255,255,255,.10);
  border-radius: 11px; padding: 8px 14px; font-weight: 800; font-size: 12.5px; cursor: pointer;
}
#chatWrap .chat-new:hover { background: rgba(255,255,255,.12); }

/* Lista de conversas */
#chatWrap .conv-item { background: rgba(255,255,255,.03); border-color: rgba(255,255,255,.07); }
#chatWrap .conv-item:hover { border-color: rgba(167,139,250,.45); background: rgba(255,255,255,.06); }
#chatWrap .conv-item.active { background: rgba(124,75,192,.28); border-color: rgba(167,139,250,.6); }
#chatWrap .conv-title { color: #e7e2f5; }
#chatWrap .conv-del { color: #e7e2f5; }

/* Mensagens */
#chatWrap .chat-messages {
  background: rgba(255,255,255,.02);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 16px;
}
#chatWrap .msg-user .msg-bubble { background: linear-gradient(150deg,#7c4bc0,#5b21b6); color:#fff; border:0; }
#chatWrap .msg-agent .msg-bubble { background: rgba(255,255,255,.06); color:#ededf5; border:1px solid rgba(255,255,255,.09); }
#chatWrap .msg-speak { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.12); color:#cbb8f5; }
#chatWrap .msg-speak:hover { background: rgba(255,255,255,.16); }
#chatWrap .msg-typing span { background: rgba(255,255,255,.7); }

/* Barra de input em pílula (estilo do ref) */
#chatWrap .chat-input {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 16px;
  padding: 8px;
  margin-top: 14px;
  backdrop-filter: blur(6px);
}
#chatWrap .chat-input input { background: transparent; border: 0; color: #fff; }
#chatWrap .chat-input input::placeholder { color: rgba(255,255,255,.3); }
#chatWrap .chat-input input:focus { border: 0; }
#chatWrap .chat-mic { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.10); color:#cbb8f5; }
#chatWrap .chat-mic:hover { background: rgba(255,255,255,.14); }
#chatWrap .chat-send { background: #fff; color: #160230; box-shadow: 0 6px 18px rgba(255,255,255,.10); }
#chatWrap .chat-send:hover { filter: brightness(.96); }

/* Bolha de voz (estilo WhatsApp) */
.voice-bubble { display: flex; align-items: center; gap: 11px; padding: 9px 13px; border-radius: 15px; min-width: 150px; }
.msg-user .voice-bubble { background: linear-gradient(150deg,#7c4bc0,#5b21b6); border-bottom-right-radius: 5px; }
.msg-agent .voice-bubble { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.09); border-bottom-left-radius: 5px; }
.voice-play {
  width: 32px; height: 32px; flex: 0 0 auto; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(255,255,255,.92); color: #160230; font-size: 12px; display: grid; place-items: center;
}
.voice-play:hover { background: #fff; }
.voice-wave { display: flex; align-items: center; gap: 2px; height: 24px; }
.voice-wave span { width: 3px; height: 35%; background: rgba(255,255,255,.55); border-radius: 2px; }
.voice-wave span:nth-child(2n) { height: 65%; }
.voice-wave span:nth-child(3n) { height: 90%; }
.voice-wave span:nth-child(5n) { height: 45%; }
.voice-wave span:nth-child(7n) { height: 100%; }
.playing .voice-wave span { animation: voiceWave 1s ease-in-out infinite; }
.voice-wave span:nth-child(2n) { animation-delay: .1s; }
.voice-wave span:nth-child(3n) { animation-delay: .2s; }
@keyframes voiceWave { 50% { transform: scaleY(.45); } }

/* ---------- Conversação: cards de agente (dark/vidro) ---------- */
#conversacaoView #agentGrid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 15px; }
#conversacaoView .agent-card {
  position: relative; text-align: center; cursor: pointer; overflow: hidden;
  background: linear-gradient(165deg, #191327 0%, #0e0b18 100%);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 20px; padding: 24px 18px 18px; color: #ececf2;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
#conversacaoView .agent-card::before {
  content: ''; position: absolute; top: -46%; left: 50%; transform: translateX(-50%);
  width: 78%; height: 130px; pointer-events: none;
  background: radial-gradient(closest-side, rgba(167,139,250,.30), transparent);
}
#conversacaoView .agent-card:hover {
  transform: translateY(-3px);
  border-color: rgba(167,139,250,.5);
  box-shadow: 0 18px 44px rgba(76,29,149,.38);
}
#conversacaoView .agent-avatar {
  position: relative; z-index: 1;
  width: 74px; height: 74px; margin: 0 auto 13px; border-radius: 20px;
  font-size: 34px; background: linear-gradient(150deg,#a78bfa,#5b21b6);
  box-shadow: 0 10px 22px rgba(0,0,0,.4), 0 0 0 3px rgba(167,139,250,.22);
}
#conversacaoView .agent-card h3 { margin: 0 0 6px; font-size: 16px; color: #fff; letter-spacing: -.2px; }
.agent-desc {
  margin: 0 0 13px; font-size: 12px; line-height: 1.5; color: rgba(255,255,255,.5);
  min-height: 2.4em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.agent-meta { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-bottom: 13px; }
.agent-mode-pill, .agent-tone-pill { padding: 3px 10px; border-radius: 999px; font-size: 10.5px; font-weight: 800; }
#conversacaoView .agent-mode-pill { background: rgba(167,139,250,.16); color: #c4b5fd; border: 1px solid rgba(167,139,250,.28); }
.agent-tone-pill { background: rgba(255,255,255,.06); color: rgba(255,255,255,.6); border: 1px solid rgba(255,255,255,.1); }
.agent-cta { display: inline-block; font-size: 12.5px; font-weight: 800; color: #c4b5fd; opacity: .8; transition: opacity .15s, transform .15s; }
#conversacaoView .agent-card:hover .agent-cta { opacity: 1; transform: translateX(2px); }
.agent-edit {
  position: absolute; top: 11px; right: 11px; z-index: 2;
  width: 30px; height: 30px; border-radius: 50%; cursor: pointer; font-size: 12px;
  border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.07); color: #fff;
}
.agent-edit:hover { background: rgba(255,255,255,.18); }

/* Botão "Novo agente" combinando com o tema roxo */
#conversacaoView #newAgentButton { background: linear-gradient(150deg,#7c4bc0,#4c1d95); color:#fff; }

/* ===================================================================
   Layout com SIDEBAR esquerda (menu vertical com ícones)
   =================================================================== */
.app-shell { display: flex; height: 100vh; overflow: hidden; align-items: stretch; }
.sidebar {
  width: 236px; flex: 0 0 236px; position: sticky; top: 0; align-self: flex-start;
  height: 100vh; display: flex; flex-direction: column; gap: 4px;
  padding: 18px 14px; background: var(--surface); border-right: 1px solid var(--line);
}
.sidebar .brand { width: 100%; border: 0; background: transparent; cursor: pointer; padding: 6px 8px 14px; gap: 11px; }
.sidebar .brand:hover { opacity: .85; }
.sidebar .brand-mark { width: 38px; height: 38px; }
.sidebar .brand-name { font-size: 16px; font-weight: 800; color: var(--ink); letter-spacing: -.2px; }

.side-nav { display: flex; flex-direction: column; gap: 3px; margin: 4px 0; }
.side-nav .tab {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 10px 12px; border-radius: 11px; text-align: left; background: transparent; border: 0;
  color: var(--ink-soft); font-weight: 700; font-size: 13.5px; cursor: pointer;
  transition: background .12s, color .12s;
}
.side-nav .tab:hover { background: var(--hover); color: var(--ink); }
.side-nav .tab.is-active { background: var(--blue-soft); color: var(--blue-strong); }
.side-nav .tab-ico { font-size: 16px; width: 20px; text-align: center; flex: 0 0 auto; }

.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.side-foot-actions { display: flex; gap: 8px; }
.side-foot .icon-button { margin: 0; flex: 1; text-align: center; }
.side-foot .user-chip { justify-content: space-between; }

.content { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; height: 100vh; overflow-y: auto; overscroll-behavior: contain; }
.content-bar { display: flex; justify-content: flex-end; padding: 14px 28px 0; }
.content-bar .icon-button { margin: 0; }
.content .wrap { max-width: 1180px; width: 100%; margin: 0 auto; padding: 16px 28px 80px; }

@media (max-width: 860px) {
  .app-shell { flex-direction: column; height: auto; overflow: visible; }
  .content { height: auto; overflow: visible; }
  .sidebar {
    width: 100%; flex: none; height: auto; position: sticky; top: 0; z-index: 30;
    flex-direction: row; align-items: center; gap: 8px; padding: 10px 12px;
    border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto;
  }
  .sidebar .brand { width: auto; flex: 0 0 auto; padding: 0 6px 0 0; }
  .sidebar .brand-name { display: none; }
  .side-nav { flex-direction: row; gap: 4px; margin: 0; }
  .side-nav .tab-label { display: none; }
  .side-nav .tab { padding: 9px 11px; }
  .side-foot { margin: 0 0 0 auto; flex-direction: row; align-items: center; border-top: 0; padding-top: 0; }
  .side-foot .user-chip { display: none; }
  .content-bar { padding: 10px 16px 0; }
  .content .wrap { padding: 14px 16px 60px; }
}

/* ===================================================================
   Cards de agente — estilo horizontal (imagem à esquerda), tema claro
   =================================================================== */
#conversacaoView #agentGrid { grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
#conversacaoView .agent-card {
  display: grid; grid-template-columns: 66px 1fr; gap: 14px; align-items: center;
  text-align: left; background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: 16px; padding: 15px; overflow: visible;
  box-shadow: var(--shadow-sm); cursor: pointer;
  transition: border-color .14s, box-shadow .14s;
}
#conversacaoView .agent-card::before { content: none; }
#conversacaoView .agent-card:hover { transform: none; border-color: var(--blue-line); box-shadow: var(--shadow); }
#conversacaoView .agent-avatar {
  width: 66px; height: 66px; margin: 0; border-radius: 15px; font-size: 28px;
  background: linear-gradient(150deg,#a78bfa,#5b21b6); box-shadow: var(--shadow-sm); align-self: start;
}
.agent-info { min-width: 0; }
#conversacaoView .agent-card h3 { margin: 0 0 3px; font-size: 15.5px; color: var(--ink); }
#conversacaoView .agent-desc {
  margin: 0 0 9px; font-size: 12.5px; line-height: 1.45; color: var(--muted); min-height: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
#conversacaoView .agent-meta { justify-content: flex-start; margin: 0; }
#conversacaoView .agent-mode-pill { background: var(--blue-soft); color: var(--blue-strong); border: 1px solid var(--blue-line); }
#conversacaoView .agent-tone-pill { background: var(--subtle); color: var(--ink-soft); border: 1px solid var(--line); }
#conversacaoView .agent-edit {
  top: 10px; right: 10px; width: 28px; height: 28px;
  background: var(--subtle); color: var(--ink-soft); border: 1px solid var(--line);
}
#conversacaoView .agent-edit:hover { border-color: var(--blue-line); color: var(--blue); }

.side-foot-actions #themeToggle { margin-left: 0; }

/* Ícones SVG do menu e botões */
.side-nav .tab-ico { display: inline-flex; align-items: center; justify-content: center; width: 20px; flex: 0 0 auto; color: currentColor; }
.side-nav .tab-ico svg { width: 19px; height: 19px; display: block; }
.icon-button.icon-only { display: inline-grid; place-items: center; }
.icon-button.icon-only svg { width: 17px; height: 17px; display: block; }

/* ===================================================================
   Conversação — chat preenche a tela + acabamento moderno
   =================================================================== */
#chatWrap {
  display: flex; flex-direction: column;
  height: calc(100vh - 168px); min-height: 520px;
  padding: 20px 22px; border-radius: 24px;
  background: radial-gradient(130% 70% at 50% -10%, rgba(124,75,192,.16), transparent 60%), #0d0b16;
  border: 1px solid rgba(255,255,255,.07);
  box-shadow: 0 24px 60px rgba(10,4,26,.5);
}
#chatWrap .chat-head { margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid rgba(255,255,255,.06); }
#chatWrap .chat-layout { flex: 1 1 auto; min-height: 0; gap: 18px; }
#chatWrap .chat-convs { max-height: 100%; overflow-y: auto; padding-right: 3px; }
#chatWrap .chat-main { display: flex; flex-direction: column; min-height: 0; }
#chatWrap .chat-messages {
  flex: 1 1 auto; max-height: none; min-height: 0;
  background: transparent; border: 0; border-radius: 0; padding: 4px 6px 6px; gap: 15px;
}
#chatWrap .chat-messages::-webkit-scrollbar { width: 8px; }
#chatWrap .chat-messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 8px; }

#chatWrap .msg { max-width: 74%; }
#chatWrap .msg-bubble { padding: 11px 15px; border-radius: 17px; font-size: 14px; line-height: 1.55; }
#chatWrap .msg-user .msg-bubble { border-bottom-right-radius: 6px; box-shadow: 0 6px 18px rgba(76,29,149,.35); }
#chatWrap .msg-agent .msg-bubble { border-bottom-left-radius: 6px; box-shadow: 0 4px 14px rgba(0,0,0,.22); }

#chatWrap .chat-input {
  margin-top: 14px; padding: 9px 9px 9px 12px; border-radius: 18px;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.09);
}
#chatWrap .chat-input input { min-height: 42px; font-size: 14.5px; }
#chatWrap .chat-mic { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; }
#chatWrap .chat-send { min-height: 42px; border-radius: 13px; padding: 0 22px; font-weight: 800; }

/* Ícones SVG dentro dos botões do chat */
.chat-mic svg { width: 19px; height: 19px; display: block; }
.msg-speak { display: grid; place-items: center; }
.msg-speak svg { width: 15px; height: 15px; }
.conv-del { display: grid; place-items: center; width: 24px; height: 24px; }
.conv-del svg { width: 14px; height: 14px; }
.voice-play { display: grid; place-items: center; }
.voice-play svg { width: 13px; height: 13px; margin-left: 1px; }
.voice-play.is-loading { opacity: .55; }
.agent-edit { display: grid; place-items: center; }
.agent-edit svg { width: 14px; height: 14px; }

/* Voz um pouco maior/limpa */
.voice-bubble { min-width: 170px; padding: 10px 14px; }
.voice-wave { height: 26px; }

@media (max-width: 860px) {
  #chatWrap { height: calc(100vh - 150px); }
  #chatWrap .chat-layout { grid-template-columns: 1fr; }
  #chatWrap .chat-convs { max-height: 92px; }
}

/* Corrige: display:flex do #chatWrap estava vencendo o [hidden] */
#chatWrap[hidden] { display: none !important; }

/* ===================================================================
   Conversação — FLAT (sem gradiente) + input flutuante (estilo Claude)
   =================================================================== */
/* Fundo sólido, sem brilho/gradiente */
#chatWrap {
  background: #17151d;
  border: 1px solid rgba(255,255,255,.06);
  box-shadow: none;
}
#chatWrap .chat-avatar { background: #2c2440; }

/* Bolhas sólidas */
#chatWrap .msg-user .msg-bubble { background: #4c1d95; color: #fff; box-shadow: none; }
#chatWrap .msg-agent .msg-bubble { background: rgba(255,255,255,.05); color: #ededf5; border: 1px solid rgba(255,255,255,.07); box-shadow: none; }
.msg-user .voice-bubble { background: #4c1d95; }
.msg-agent .voice-bubble { background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.07); }
.voice-play { background: rgba(255,255,255,.92); }

/* Input FLUTUANTE, centralizado */
#chatWrap .chat-main { position: relative; }
#chatWrap .chat-input {
  margin: 16px auto 6px; max-width: 760px; width: 100%;
  background: #211d2a; border: 1px solid rgba(255,255,255,.10);
  border-radius: 18px; padding: 10px 10px 10px 14px;
  box-shadow: 0 12px 34px rgba(0,0,0,.4);
}
#chatWrap .chat-send { background: #fff; color: #160230; }
#chatWrap .chat-send:hover { filter: brightness(.95); }
#chatWrap .chat-mic { background: rgba(255,255,255,.06); }
#chatWrap .chat-new { background: rgba(255,255,255,.06); }

/* Avatares dos cards de agente e "Novo agente": sólido, sem gradiente */
#conversacaoView .agent-avatar { background: #2c2440; }
#conversacaoView #newAgentButton { background: #4c1d95; }
#conversacaoView #newAgentButton:hover { filter: brightness(1.08); }

/* ===================================================================
   Chat: input FIXO embaixo + SCROLL INTERNO das mensagens + maior
   =================================================================== */
.content .wrap { max-width: 1300px; }
#chatWrap { height: calc(100vh - 150px); min-height: 480px; overflow: hidden; }
#chatWrap .chat-layout { display: flex; flex: 1 1 auto; min-height: 0; gap: 18px; }
#chatWrap .chat-convs { flex: 0 0 224px; min-height: 0; max-height: none; overflow-y: auto; }
#chatWrap .chat-main { flex: 1 1 auto; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
#chatWrap .chat-messages { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
#chatWrap .chat-input { flex: 0 0 auto; max-width: 840px; }
@media (max-width: 860px) {
  #chatWrap { height: calc(100vh - 130px); }
  #chatWrap .chat-layout { flex-direction: column; }
  #chatWrap .chat-convs { flex: 0 0 auto; max-height: 84px; }
}

/* Corrige: a coluna do chat precisa esticar até o fim para o input ficar fixo */
#chatWrap .chat-layout { align-items: stretch; }
#chatWrap .chat-main { display: grid; grid-template-rows: minmax(0, 1fr) auto; min-height: 0; }

/* ===================================================================
   Chat: sem barra "Atualizar", modal mais alto (cima e baixo) + divisória
   =================================================================== */
.content-bar { display: none; }

/* Na aba Conversação, aperta o padding do wrap pra sobrar altura pro chat */
.app-shell.chat-mode .content .wrap { padding: 18px 28px; }
.app-shell.chat-mode #chatWrap { height: calc(100vh - 52px); min-height: 480px; }

/* Dashboard: cabe na tela, sem scroll — elementos compactados p/ caber */
.app-shell.dash-mode .content { overflow: hidden; }
.app-shell.dash-mode .content .wrap { display: flex; flex-direction: column; height: 100%; padding: 40px 28px 20px; }
.app-shell.dash-mode #dashboardView { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }

.app-shell.dash-mode .dash-hero { margin-bottom: 12px; padding: 18px 24px; }
.app-shell.dash-mode .dash-hero-icon { width: 52px; height: 52px; border-radius: 16px; }
.app-shell.dash-mode .dash-hero-icon svg { width: 24px; height: 24px; }
.app-shell.dash-mode .dash-hero-value { font-size: 34px; }

.app-shell.dash-mode .dash-modes { margin-bottom: 12px; gap: 12px; }
.app-shell.dash-mode .mode-card { padding: 13px 15px 14px; }
.app-shell.dash-mode .mode-top { margin-bottom: 8px; }
.app-shell.dash-mode .mode-time { font-size: 22px; }
.app-shell.dash-mode .mode-ico { width: 32px; height: 32px; }
.app-shell.dash-mode .mode-ico svg { width: 18px; height: 18px; }
.app-shell.dash-mode .mode-pct { margin-top: 4px; }

.app-shell.dash-mode .dash-columns { flex: 1 1 auto; min-height: 0; gap: 14px; }
.app-shell.dash-mode .dash-panel { padding: 16px 18px; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.app-shell.dash-mode .dash-panel-title { margin-bottom: 12px; }
.app-shell.dash-mode .dist-wrap { min-height: 0; }
.app-shell.dash-mode .donut { width: 128px; height: 128px; }
.app-shell.dash-mode .history { min-height: 0; overflow-y: auto; }

@media (max-width: 860px) {
  .app-shell.dash-mode .content .wrap { display: block; height: auto; padding: 22px 16px 60px; }
  .app-shell.dash-mode #dashboardView { display: block; }
  .app-shell.dash-mode .dash-columns { display: grid; }
  .app-shell.dash-mode .dash-panel { display: block; overflow: visible; }
}

/* Estudo Ativo: cabe na tela, sem scroll */
.app-shell.estudo-mode .content { overflow: hidden; }
.app-shell.estudo-mode .content .wrap { display: flex; flex-direction: column; height: 100%; padding: 34px 28px 24px; }
.app-shell.estudo-mode #estudoView { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.app-shell.estudo-mode #estudoView .list-header { margin-bottom: 14px; }
.app-shell.estudo-mode .pomo-wrap { align-content: start; }

@media (max-width: 860px) {
  .app-shell.dash-mode .content,
  .app-shell.estudo-mode .content { overflow: visible; }
  .app-shell.estudo-mode .content .wrap { display: block; height: auto; }
}

/* Linha vertical separando a lista de conversas das mensagens */
#chatWrap .chat-convs {
  border-right: 1px solid rgba(255,255,255,.09);
  padding-right: 16px;
}
@media (max-width: 860px) {
  .app-shell.chat-mode #chatWrap { height: calc(100vh - 40px); }
  #chatWrap .chat-convs { border-right: 0; border-bottom: 1px solid rgba(255,255,255,.09); padding-right: 0; padding-bottom: 10px; }
}

/* ===================================================================
   Gravação de áudio — estilo WhatsApp (onda animada + cancelar/enviar)
   =================================================================== */
.chat-recording { display: none; }
#chatInputBar.is-recording > .chat-mic,
#chatInputBar.is-recording > #chatText,
#chatInputBar.is-recording > .chat-send { display: none; }
#chatInputBar.is-recording .chat-recording {
  display: flex; align-items: center; gap: 12px; width: 100%;
}
.rec-cancel, .rec-send {
  width: 40px; height: 40px; flex: 0 0 auto; border: 0; border-radius: 12px;
  display: grid; place-items: center; cursor: pointer;
}
.rec-cancel svg, .rec-send svg { width: 18px; height: 18px; }
.rec-cancel { background: rgba(255,255,255,.06); color: #ff8a8a; }
.rec-cancel:hover { background: rgba(239,68,68,.22); color: #fff; }
.rec-send { background: #fff; color: #160230; }
.rec-send:hover { filter: brightness(.95); }
.rec-dot { width: 9px; height: 9px; flex: 0 0 auto; border-radius: 50%; background: #ef4444; animation: recBlink 1.1s infinite; }
@keyframes recBlink { 50% { opacity: .25; } }
.rec-time { flex: 0 0 auto; min-width: 40px; font-size: 13px; font-variant-numeric: tabular-nums; color: #e7e2f5; font-weight: 700; }
.rec-wave { flex: 1 1 auto; display: flex; align-items: center; justify-content: space-between; gap: 2px; height: 28px; overflow: hidden; }
.rec-wave span {
  flex: 1 1 auto; min-width: 2px; max-width: 4px; height: 35%;
  background: rgba(167,139,250,.75); border-radius: 2px;
  animation: recWave 1s ease-in-out infinite;
}
.rec-wave span:nth-child(2n) { height: 65%; animation-delay: .12s; }
.rec-wave span:nth-child(3n) { height: 90%; animation-delay: .24s; }
.rec-wave span:nth-child(4n) { height: 50%; animation-delay: .36s; }
.rec-wave span:nth-child(5n) { height: 100%; animation-delay: .48s; }
.rec-wave span:nth-child(7n) { height: 45%; animation-delay: .6s; }
@keyframes recWave { 0%, 100% { transform: scaleY(.3); } 50% { transform: scaleY(1); } }

/* ===================================================================
   Chat: painel VIDRO PRETO (glassmorphism / futurista)
   =================================================================== */
#chatWrap {
  background: rgba(8, 8, 12, 0.5);
  -webkit-backdrop-filter: blur(26px) saturate(1.25);
  backdrop-filter: blur(26px) saturate(1.25);
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 28px 70px rgba(0,0,0,.55);
}
/* Input em vidro também */
#chatWrap .chat-input {
  background: rgba(255, 255, 255, 0.05);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.10);
}
/* Bolha do agente mais "vidro" sobre o preto */
#chatWrap .msg-agent .msg-bubble { background: rgba(255,255,255,.055); border: 1px solid rgba(255,255,255,.08); }

/* Remove o contorno claro do painel do chat */
#chatWrap { border: none; box-shadow: 0 28px 70px rgba(0,0,0,.55); }

/* ---------- Estudo em conversação (cronômetro no chat) ---------- */
.chat-study { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; }
.cstudy-toggle {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.05); color: #e7e2f5;
  border-radius: 10px; padding: 7px 13px; font-weight: 700; font-size: 12.5px; cursor: pointer;
}
.cstudy-toggle:hover { background: rgba(255,255,255,.1); }
.cstudy-toggle svg { width: 12px; height: 12px; }
.chat-study.is-running .cstudy-toggle { background: rgba(18,164,92,.18); border-color: rgba(18,164,92,.45); color: #6ee7a0; }
.cstudy-eye {
  width: 34px; height: 34px; flex: 0 0 auto; border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.05); border-radius: 10px; display: grid; place-items: center; cursor: pointer; color: #cbb8f5;
}
.cstudy-eye:hover { background: rgba(255,255,255,.1); }
.cstudy-eye svg { width: 16px; height: 16px; }
.cstudy-time { font-variant-numeric: tabular-nums; font-weight: 800; font-size: 14px; color: #fff; min-width: 52px; }
.cstudy-time[hidden] { display: none; }

/* ================= Atividades: Quiz e Diálogo (wpp) ================= */
.act-empty { text-align: center; padding: 40px 22px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; }
.act-empty-art { font-size: 40px; margin-bottom: 8px; }
.act-empty h3 { margin: 0 0 6px; font-size: 18px; color: var(--ink); }
.act-empty p { max-width: 460px; margin: 0 auto 18px; font-size: 13.5px; line-height: 1.55; }
.act-lang { margin-bottom: 16px; }
.act-lang label { display: inline-flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 700; color: var(--muted); text-align: left; }
.act-lang select { border: 1px solid var(--line); background: var(--input-bg); color: var(--ink); border-radius: 10px; padding: 9px 12px; font-size: 14px; font-family: inherit; font-weight: 600; }

/* Barra de estudo (timer) */
.act-study { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; flex-wrap: wrap; }
.act-study .cstudy-toggle,
.act-study .cstudy-eye {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  border-radius: 10px; padding: 8px 13px; font-size: 13px; font-weight: 750; font-family: inherit;
}
.act-study .cstudy-eye { padding: 8px; }
.act-study .cstudy-toggle svg { width: 12px; height: 12px; }
.act-study .cstudy-eye svg { width: 16px; height: 16px; }
.act-study .cstudy-toggle:hover, .act-study .cstudy-eye:hover { border-color: var(--blue-strong); }
.act-study.is-running .cstudy-toggle { background: rgba(18,164,92,.14); border-color: rgba(18,164,92,.5); color: #12a45c; }
:root[data-theme="dark"] .act-study.is-running .cstudy-toggle { color: #6ee7a0; }
.act-study .cstudy-time { font-variant-numeric: tabular-nums; font-weight: 800; font-size: 14px; color: var(--ink); min-width: 52px; }
.act-study .cstudy-time[hidden] { display: none; }
.act-regen { margin-left: auto; border: 1px solid var(--line); background: transparent; color: var(--muted); border-radius: 10px; padding: 8px 12px; font-size: 12.5px; font-weight: 700; cursor: pointer; font-family: inherit; }
.act-regen:hover { color: var(--ink); border-color: var(--blue-strong); }

/* Quiz */
.quiz-wrap { display: flex; flex-direction: column; gap: 14px; }
.quiz-score { background: var(--blue-soft); color: var(--blue-strong); border-radius: 12px; padding: 14px 16px; font-size: 15px; font-weight: 700; text-align: center; }
.quiz-q { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px; box-shadow: var(--shadow-sm); }
.quiz-q-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.quiz-num { flex: 0 0 auto; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: var(--blue); color: #fff; font-size: 13px; font-weight: 800; }
:root[data-theme="dark"] .quiz-num { background: var(--blue-strong); }
.quiz-q-head p { margin: 0; font-size: 15px; font-weight: 650; color: var(--ink); line-height: 1.4; }
.quiz-opts { display: flex; flex-direction: column; gap: 9px; }
.quiz-opt {
  display: flex; align-items: center; gap: 11px; text-align: left; cursor: pointer;
  border: 1px solid var(--line); background: var(--input-bg); color: var(--ink);
  border-radius: 11px; padding: 12px 14px; font-size: 14px; font-family: inherit; transition: border-color .12s, background .12s;
}
.quiz-opt:hover:not(:disabled) { border-color: var(--blue-strong); }
.quiz-opt:disabled { cursor: default; }
.quiz-opt-key { flex: 0 0 auto; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 7px; background: var(--surface); border: 1px solid var(--line); font-size: 12px; font-weight: 800; color: var(--muted); }
.quiz-opt.is-correct { border-color: #12a45c; background: rgba(18,164,92,.12); }
.quiz-opt.is-correct .quiz-opt-key { background: #12a45c; color: #fff; border-color: #12a45c; }
.quiz-opt.is-wrong { border-color: #dc2626; background: rgba(220,38,38,.1); }
.quiz-opt.is-wrong .quiz-opt-key { background: #dc2626; color: #fff; border-color: #dc2626; }
.quiz-feedback { margin-top: 12px; font-size: 13px; line-height: 1.5; padding: 11px 13px; border-radius: 10px; }
.quiz-feedback[hidden] { display: none; }
.quiz-feedback.ok { background: rgba(18,164,92,.1); color: var(--ink); }
.quiz-feedback.no { background: rgba(220,38,38,.09); color: var(--ink); }
.quiz-ts { display: inline-block; margin-left: 6px; font-weight: 700; color: var(--blue-strong); white-space: nowrap; }

/* Diálogo (wpp) — estilo áudios de WhatsApp */
.wpp-chat { display: flex; flex-direction: column; gap: 12px; padding: 6px 2px; }
.wpp-row { display: flex; }
.wpp-row.wpp-b { justify-content: flex-end; }
.wpp-bubble { max-width: 78%; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 11px 13px; box-shadow: var(--shadow-sm); }
.wpp-row.wpp-a .wpp-bubble { border-top-left-radius: 5px; }
.wpp-row.wpp-b .wpp-bubble { border-top-right-radius: 5px; background: var(--blue-soft); border-color: var(--blue-line, var(--line)); }
.wpp-name { display: block; font-size: 11px; font-weight: 800; color: var(--blue-strong); margin-bottom: 7px; }
.wpp-voice { display: flex; align-items: center; gap: 11px; }
.wpp-play { flex: 0 0 auto; width: 38px; height: 38px; border-radius: 50%; border: 0; cursor: pointer; background: var(--blue-strong); color: #fff; display: grid; place-items: center; }
.wpp-play svg { width: 18px; height: 18px; }
.wpp-play.is-loading { opacity: .6; pointer-events: none; }
.wpp-wave { display: flex; align-items: center; gap: 2px; height: 22px; flex: 1; }
.wpp-wave span { width: 3px; height: 35%; background: var(--muted); border-radius: 2px; opacity: .6; }
.wpp-wave span:nth-child(2n) { height: 70%; }
.wpp-wave span:nth-child(3n) { height: 100%; }
.wpp-wave span:nth-child(5n) { height: 50%; }
.wpp-text { margin: 9px 0 0; font-size: 13.5px; line-height: 1.45; color: var(--ink); }

/* Botão "Gerar" das atividades — roxo, arredondado */
.act-gen-btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  border: 0; border-radius: 999px; padding: 13px 30px;
  background: linear-gradient(135deg, #a78bfa 0%, #7c4bc0 55%, #4c1d95 100%);
  color: #fff; font-size: 15px; font-weight: 800; font-family: inherit; letter-spacing: .2px;
  box-shadow: 0 10px 26px rgba(76, 29, 149, .35);
  transition: transform .14s ease, box-shadow .14s ease, filter .14s ease;
}
.act-gen-btn:hover { transform: translateY(-1px); box-shadow: 0 14px 32px rgba(76, 29, 149, .45); filter: brightness(1.05); }
.act-gen-btn:active { transform: translateY(0); }
.act-gen-btn:disabled { opacity: .7; cursor: default; transform: none; box-shadow: none; }

/* Player de áudio do Diálogo (wpp): pausar + arrastar o tempo */
.wpp-voice { align-items: center; }
.wpp-track { position: relative; flex: 1; height: 26px; display: flex; align-items: center; }
.wpp-track .wpp-wave { flex: 1; height: 22px; }
.wpp-fill { position: absolute; left: 0; top: 0; height: 100%; width: 0; background: linear-gradient(90deg, rgba(124,75,192,.32), rgba(124,75,192,.18)); border-radius: 6px; pointer-events: none; }
.wpp-seek { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; background: transparent; -webkit-appearance: none; appearance: none; cursor: pointer; opacity: 0; }
.wpp-seek::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 16px; height: 16px; }
.wpp-seek::-moz-range-thumb { width: 16px; height: 16px; border: 0; }
.wpp-time { min-width: 34px; text-align: right; font-size: 11.5px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- Diálogo: palavras/padrão como dropdown (accordion) ---------- */
details.dlg-acc { margin-bottom: 10px; overflow: hidden; }
details.dlg-acc > summary.dlg-head {
  list-style: none; cursor: pointer; user-select: none;
  display: flex; align-items: center; gap: 9px; padding: 2px 0;
}
details.dlg-acc > summary.dlg-head::-webkit-details-marker { display: none; }
details.dlg-acc > summary.dlg-head:hover .dlg-term { color: var(--blue-strong); }
.dlg-count { font-size: 11.5px; font-weight: 700; color: var(--muted); background: var(--subtle); border: 1px solid var(--line); border-radius: 999px; padding: 3px 9px; }
.dlg-chev { margin-left: auto; color: var(--muted); font-size: 14px; transition: transform .18s ease; }
details.dlg-acc[open] > summary.dlg-head .dlg-chev { transform: rotate(180deg); }
details.dlg-acc[open] > summary.dlg-head { margin-bottom: 12px; }
details.dlg-acc .dlg-sentences { margin-bottom: 2px; }
details.dlg-acc .dlg-context { margin-top: 0; }

/* Diálogo: filtro de período + barra de estudo */
.dlg-filter { display: inline-flex; gap: 4px; background: var(--subtle); border: 1px solid var(--line); border-radius: 11px; padding: 3px; }
.dlg-filter button {
  border: 0; background: transparent; color: var(--ink-soft); cursor: pointer;
  padding: 7px 14px; border-radius: 8px; font-size: 13px; font-weight: 700; font-family: inherit;
  transition: background .12s, color .12s;
}
.dlg-filter button:hover { color: var(--ink); }
.dlg-filter button.is-active { background: var(--blue); color: #fff; }
:root[data-theme="dark"] .dlg-filter button.is-active { background: var(--blue-strong); }
.dlg-study-bar { margin: 2px 0 18px; }
.dlg-study-hint { font-size: 12px; color: var(--muted); }
.dlg-study-hint b { color: var(--ink-soft); font-weight: 700; }

/* ================= Sidebar sólida (sem vidro/blur) — segue o print ================= */
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--line);
  box-shadow: none;
}
:root[data-theme="dark"] .sidebar {
  background: #121218;
  border-right: 1px solid rgba(255,255,255,.06);
}

/* Rodapé do menu: tema (segmentado), usuário e sair */
.side-foot { gap: 12px; }
.theme-seg {
  display: flex; gap: 4px; padding: 4px;
  background: var(--subtle); border: 1px solid var(--line); border-radius: 12px;
}
.theme-seg-btn {
  flex: 1; display: grid; place-items: center; height: 34px;
  border: 0; border-radius: 9px; background: transparent; color: var(--muted);
  cursor: pointer; transition: background .14s, color .14s;
}
.theme-seg-btn svg { width: 17px; height: 17px; }
.theme-seg-btn:hover { color: var(--ink-soft); }
.theme-seg-btn.is-active { background: var(--surface); color: var(--blue-strong); box-shadow: var(--shadow-sm); }
:root[data-theme="dark"] .theme-seg-btn.is-active { background: rgba(255,255,255,.08); color: #fff; }

.user-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 8px 8px 8px; border-radius: 12px;
  background: var(--subtle); border: 1px solid var(--line);
}
.user-chip[hidden] { display: none; }
.user-avatar {
  flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; font-size: 13px; font-weight: 800; color: #fff;
  background: linear-gradient(150deg, #a78bfa, #6d28d9);
}
.user-email {
  flex: 1; min-width: 0; font-size: 12.5px; font-weight: 600; color: var(--ink-soft);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-config {
  flex: 0 0 auto; width: 26px; height: 26px; border: 0; background: transparent;
  color: var(--muted); border-radius: 8px; display: grid; place-items: center; cursor: pointer;
}
.user-config svg { width: 16px; height: 16px; }
.user-config:hover { color: var(--ink); background: var(--hover); }

.side-logout {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 10px 12px; border: 0; border-radius: 11px; background: transparent;
  color: var(--muted); font-weight: 700; font-size: 13.5px; cursor: pointer;
  transition: background .12s, color .12s;
}
.side-logout svg { width: 18px; height: 18px; flex: 0 0 auto; }
.side-logout:hover { background: var(--hover); color: #e0554e; }

@media (max-width: 860px) {
  .side-foot { flex-direction: row; align-items: center; gap: 8px; }
  .theme-seg { flex: 0 0 auto; }
  .user-chip { display: none; }
  .side-logout { width: auto; padding: 9px 11px; }
  .side-logout span { display: none; }
}

/* ================= Protocolo Neurofluência (curso) ================= */
#protocoloView { margin-top: 40px; }
.proto-banner {
  position: relative; overflow: hidden;
  border-radius: 22px; padding: 40px 34px; margin-bottom: 26px;
  min-height: 190px; display: flex; align-items: center;
  background:
    radial-gradient(120% 150% at 82% 10%, rgba(167,139,250,.42), transparent 55%),
    linear-gradient(120deg, #1b0b34 0%, #3a1a78 52%, #5b21b6 100%);
  color: #fff;
  box-shadow: 0 20px 46px rgba(40, 8, 78, .45);
}
.proto-banner-glow {
  position: absolute; right: -80px; top: -120px; width: 380px; height: 380px;
  border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(196,181,253,.45), transparent 62%);
  filter: blur(20px);
}
.proto-banner-content { position: relative; z-index: 1; max-width: 640px; }
.proto-kicker {
  display: inline-block; margin-bottom: 12px; padding: 4px 13px; border-radius: 999px;
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.22);
  font-size: 11px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase;
}
.proto-banner h2 { margin: 0 0 8px; font-size: 34px; font-weight: 900; letter-spacing: -.8px; line-height: 1.05; }
.proto-banner p { margin: 0; font-size: 14px; color: rgba(255,255,255,.8); line-height: 1.5; }

.proto-row-head { margin: 0 0 14px; }
.proto-row-head h3 { margin: 0; font-size: 17px; font-weight: 800; letter-spacing: -.2px; color: var(--ink); }

.proto-row {
  display: flex; gap: 16px; overflow-x: auto; padding: 4px 2px 14px;
  scroll-snap-type: x proximity;
}
.proto-row::-webkit-scrollbar { height: 8px; }
.proto-row::-webkit-scrollbar-thumb { background: var(--line); border-radius: 8px; }

.proto-cover {
  position: relative; flex: 0 0 auto; width: 190px; height: 285px;
  border-radius: 16px; overflow: hidden; cursor: pointer; scroll-snap-align: start;
  display: flex; flex-direction: column; justify-content: flex-end;
  background: linear-gradient(165deg, #241a3d 0%, #14101f 100%);
  box-shadow: var(--shadow-sm);
  transition: transform .16s ease, box-shadow .16s ease;
}
.proto-cover:hover { transform: translateY(-4px); box-shadow: 0 20px 40px rgba(20, 6, 44, .5); }
.proto-cover:nth-child(1) { background: linear-gradient(165deg, #3a2568 0%, #17102b 100%); }
.proto-cover:nth-child(2) { background: linear-gradient(165deg, #2a2a6b 0%, #12122a 100%); }
.proto-cover:nth-child(3) { background: linear-gradient(165deg, #4c1d95 0%, #1a0f33 100%); }
.proto-cover:nth-child(4) { background: linear-gradient(165deg, #5b2170 0%, #1f0f2b 100%); }
.proto-cover:nth-child(5) { background: linear-gradient(165deg, #26365e 0%, #101826 100%); }

.proto-cover-art { position: absolute; inset: 0; display: grid; place-items: center; }
.proto-num {
  font-size: 118px; font-weight: 900; line-height: 1; letter-spacing: -4px;
  color: rgba(255,255,255,.12); font-variant-numeric: tabular-nums;
}
.proto-cover-info {
  position: relative; z-index: 1; padding: 14px;
  background: linear-gradient(to top, rgba(6,4,14,.9) 12%, rgba(6,4,14,.55) 60%, transparent);
}
.proto-phase { display: block; font-size: 11px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; color: #c4b5fd; margin-bottom: 3px; }
.proto-title { display: block; font-size: 15px; font-weight: 800; color: #fff; line-height: 1.25; }
.proto-badge {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  padding: 4px 10px; border-radius: 999px; font-size: 10px; font-weight: 800; letter-spacing: .3px;
  background: rgba(0,0,0,.45); color: rgba(255,255,255,.85); border: 1px solid rgba(255,255,255,.18);
  backdrop-filter: blur(4px);
}
