/* ════════════════════════════════════════════════════════════════════
   Cowork · Legal Pack — shared styles
   Aesthetic: cream editorial · Bricolage Grotesque + Geist + JetBrains Mono
   + Newsreader serif italics for legal voice
   ══════════════════════════════════════════════════════════════════════ */

:root {
  --bg: #efece6;
  --bg-warm: #ebe7df;
  --bg-cool: #ecebe8;
  --card: #fbfaf6;
  --paper: #f6f3ec;
  --ink: #14151a;
  --ink-soft: #2d2f38;
  --ink-mute: #6a6c75;
  --ink-faint: #a0a2ab;
  --rule: #dad6cb;
  --rule-strong: #c0bbac;

  /* Legal Pack agent signatures */
  --c-lgl01: #1a3a8a; --c-lgl01-soft: #e6e9f1;   /* Themis · royal navy */
  --c-lgl02: #5a3a8a; --c-lgl02-soft: #ebe4f1;   /* Iris · indigo violet */
  --c-lgl03: #b07020; --c-lgl03-soft: #f3e8d4;   /* Cronos · warm amber */
  --c-lgl04: #3a6e4a; --c-lgl04-soft: #e2eee5;   /* Janus · forest */
  --c-lgl05: #6a2848; --c-lgl05-soft: #efe1e7;   /* Calíope · deep aubergine */

  --green: #2d8a6a;
  --amber: #c08020;
  --rose: #c93f2c;
  --rose-soft: #f5e1dd;
  --indigo: #1a3a8a;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Geist', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(circle at 18% 8%, rgba(255, 255, 255, 0.5), transparent 50%),
    radial-gradient(circle at 90% 70%, rgba(0, 0, 0, 0.02), transparent 50%);
  overflow-x: hidden;
}
::selection { background: var(--ink); color: var(--card); }

a { color: inherit; }

.italic-serif {
  font-family: 'Newsreader', serif;
  font-style: italic;
  font-weight: 500;
}

/* ─── TOPBAR ─────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  height: 72px;
  padding: 0 32px;
  border-bottom: 1px solid rgba(218, 214, 203, 0.7);
  background: rgba(239, 236, 230, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.45), 0 1px 0 rgba(20, 21, 26, 0.04);
}
.brand {
  display: flex; align-items: center; gap: 14px;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 26px; font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--ink);
  text-decoration: none;
}
.brand-mark {
  width: 38px; height: 38px;
  background: var(--ink); color: var(--card);
  border-radius: 14px;
  display: grid; place-items: center;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 22px; font-weight: 700;
  transform: rotate(-4deg);
  box-shadow: 0 4px 12px -4px rgba(20, 21, 26, 0.25);
}
.brand-mark::before { content: 'C'; transform: rotate(4deg); display: block; }
.brand-tag {
  font-family: 'Geist', sans-serif;
  font-size: 10px; font-weight: 500;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--c-lgl01);
  padding: 4px 9px;
  border: 1px solid rgba(26, 58, 138, 0.3);
  border-radius: 100px;
  background: var(--c-lgl01-soft);
}

.topnav { display: flex; gap: 4px; margin-left: auto; }
.topnav a {
  font-family: 'Geist', sans-serif;
  font-size: 13px; font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 100px;
  transition: all .15s;
}
.topnav a:hover { background: var(--card); }
.topnav a.active { background: var(--ink); color: var(--card); }

.topright { display: flex; gap: 10px; align-items: center; }

.ask-btn {
  display: inline-flex; align-items: center; gap: 10px;
  height: 38px; padding: 0 14px 0 12px;
  background: var(--card);
  border: 1px solid var(--rule-strong);
  border-radius: 100px;
  font-family: 'Geist', sans-serif;
  font-size: 13px; color: var(--ink-mute);
  cursor: pointer;
  transition: all .15s;
}
.ask-btn:hover { border-color: var(--ink); color: var(--ink); }
.ask-btn .star { color: var(--c-lgl01); font-size: 14px; }
.ask-btn .kbd {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  background: var(--bg-warm);
  border: 1px solid var(--rule);
  color: var(--ink-mute);
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 4px;
}
.icon-btn {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 100px;
  color: var(--ink-soft);
  cursor: pointer;
  text-decoration: none;
  position: relative;
  transition: all .15s;
}
.icon-btn:hover { border-color: var(--ink); color: var(--ink); }
.icon-btn.alert {
  background: var(--rose-soft);
  border-color: rgba(201, 63, 44, 0.3);
  color: var(--rose);
}
.icon-btn.alert::after {
  content: attr(data-count);
  position: absolute; top: -3px; right: -3px;
  width: 18px; height: 18px;
  background: var(--rose);
  color: var(--card);
  border-radius: 50%;
  display: grid; place-items: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; font-weight: 700;
  box-shadow: 0 0 0 2px var(--bg);
  animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot { 0%,100% { transform: scale(1); } 50% { transform: scale(1.15); } }

.avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6a85c4 0%, #2c3e8f 100%);
  color: var(--card);
  display: grid; place-items: center;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  border: none;
}

/* ─── SHELL & SIDEBAR ────────────────────────────────────────── */
.shell {
  display: grid;
  grid-template-columns: 280px 1fr 340px;
  min-height: calc(100vh - 72px);
}
.shell.no-rail { grid-template-columns: 280px 1fr; }
.shell.full { grid-template-columns: 1fr; }

.sidebar {
  padding: 22px 18px 32px;
  border-right: 1px solid var(--rule);
}
.new-task-cta {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: 11px 18px;
  background: var(--ink);
  color: var(--card);
  border: none;
  border-radius: 100px;
  font-family: 'Geist', sans-serif;
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  margin-bottom: 22px;
}
.new-task-cta:hover { background: var(--c-lgl01); }
.new-task-cta svg { transition: transform .2s; }
.new-task-cta:hover svg { transform: rotate(90deg); }

.side-section { margin-bottom: 24px; }
.side-h {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 0 12px;
  margin-bottom: 8px;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 12px; font-weight: 600;
  color: var(--ink-soft);
  letter-spacing: -0.01em;
}
.side-h .ct {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  color: var(--ink-faint);
  font-weight: 500;
}

.area {
  display: grid;
  grid-template-columns: 14px 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--ink-soft);
  font-size: 13px;
  text-decoration: none;
  cursor: pointer;
  transition: all .12s;
}
.area:hover { background: var(--card); color: var(--ink); }
.area.active {
  background: var(--ink);
  color: var(--card);
  font-weight: 500;
}
.area.active .ct { color: var(--card); opacity: 0.65; }
.area .caret {
  width: 14px; height: 14px;
  display: grid; place-items: center;
  color: var(--ink-faint);
  font-size: 10px;
  transition: color .12s;
}
.area.active .caret { color: var(--card); }
.area .ct {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  color: var(--ink-faint);
}

.area-child {
  display: grid;
  grid-template-columns: 8px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 6px 12px 6px 36px;
  margin: 1px 0;
  border-radius: 6px;
  color: var(--ink-mute);
  font-size: 12.5px;
  text-decoration: none;
  cursor: pointer;
  transition: all .12s;
}
.area-child:hover { background: var(--card); color: var(--ink); }
.area-child.active {
  background: var(--card);
  color: var(--ink);
  font-weight: 500;
}
.area-child .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--ink-faint);
}
.area-child .dot.live { background: var(--green); }
.area-child .dot.draft { background: var(--ink-faint); }
.area-child .dot.alert { background: var(--rose); animation: pulse-dot 1.6s infinite; }
.area-child .ct {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--ink-faint);
}

.alert-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 1px 8px;
  background: var(--rose-soft);
  color: var(--rose);
  border-radius: 100px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px; font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.side-divider { height: 1px; background: var(--rule); margin: 18px 12px; }

.pack-tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  background: var(--c-lgl01-soft);
  border: 1px solid rgba(26, 58, 138, 0.18);
  border-radius: 100px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; font-weight: 600;
  color: var(--c-lgl01);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 12px 12px;
}
.pack-tag::before { content: '◈'; font-size: 10px; }

.summary-card {
  margin-top: 4px;
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 14px;
}
.summary-card .lbl {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px; font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--ink-mute);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.summary-card .val {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 22px; font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
  margin-bottom: 4px;
}
.summary-card .val em { color: var(--c-lgl01); font-style: normal; }
.summary-card .meta {
  font-size: 11.5px;
  color: var(--ink-mute);
  line-height: 1.4;
  margin-bottom: 10px;
}
.summary-card .roi {
  display: block;
  padding-top: 8px;
  border-top: 1px dashed var(--rule);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; font-weight: 600;
  color: var(--c-lgl04);
}

/* ─── MAIN ───────────────────────────────────────────────────── */
.main {
  padding: 32px 40px 80px;
  max-width: 100%;
  min-width: 0;
}
.main.wide { padding: 32px 36px 80px; }

.crumbs {
  display: flex; align-items: center; gap: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  color: var(--ink-mute);
  letter-spacing: 0.04em;
  margin-bottom: 18px;
}
.crumbs a { color: var(--ink-mute); text-decoration: none; transition: color .12s; }
.crumbs a:hover { color: var(--ink); }
.crumbs .sep { color: var(--ink-faint); }
.crumbs .current { color: var(--ink); font-weight: 600; }

/* compact info-bar (replaces big hero on overview) */
.info-bar {
  position: relative;
  padding: 28px 0 28px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--rule);
}
.info-bar .bar-eye {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px; font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--c-lgl01);
  text-transform: uppercase;
  margin-bottom: 18px;
  display: flex; align-items: center; gap: 10px;
}
.info-bar .bar-eye .pip {
  display: inline-block;
  width: 6px; height: 6px;
  background: var(--c-lgl01);
  border-radius: 50%;
  box-shadow: 0 0 0 4px var(--c-lgl01-soft);
}
.info-bar .bar-stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  margin-bottom: 18px;
}
.info-bar .bar-stat {
  border-right: 1px solid var(--rule);
  padding-right: 18px;
}
.info-bar .bar-stat:last-child { border-right: none; }
.info-bar .bar-stat + .bar-stat { padding-left: 18px; }
.info-bar .bar-num {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 40px; font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1;
}
.info-bar .bar-num em {
  font-family: 'Newsreader', serif;
  font-style: italic;
  font-weight: 500;
  color: var(--c-lgl01);
}
.info-bar .bar-num.crit em { color: var(--rose); }
.info-bar .bar-num small {
  font-family: 'Geist', sans-serif;
  font-size: 14px;
  color: var(--ink-mute);
  margin-left: 3px;
  font-weight: 500;
}
.info-bar .bar-lbl {
  font-size: 11px; font-weight: 500;
  color: var(--ink-mute);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 8px;
}
.info-bar .bar-meta {
  font-size: 13.5px;
  color: var(--ink-mute);
  line-height: 1.55;
  max-width: 78ch;
}
.info-bar .bar-meta strong { color: var(--ink); font-weight: 600; }
.info-bar .bar-glyph {
  position: absolute;
  top: 16px; right: 0;
  width: 80px; height: 80px;
  opacity: 0.08;
  pointer-events: none;
}

/* page header (for detail pages — record list, peca review, etc.) */
.page-header {
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--rule);
}
.page-eye {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--c-lgl01);
  text-transform: uppercase;
  margin-bottom: 12px;
}
.page-title {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 56px; font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 0.95;
  color: var(--ink);
  margin-bottom: 8px;
}
.page-title em {
  font-family: 'Newsreader', serif;
  font-style: italic;
  font-weight: 500;
  color: var(--c-lgl01);
}
.page-sub {
  font-size: 14px;
  color: var(--ink-mute);
  line-height: 1.55;
  max-width: 70ch;
}
.page-sub strong { color: var(--ink); font-weight: 600; }

/* section header */
.section-h {
  display: flex; justify-content: space-between; align-items: end;
  margin-bottom: 18px;
  margin-top: 12px;
}
.section-h h2 {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 24px; font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.section-h h2 em {
  font-family: 'Newsreader', serif;
  font-style: italic;
  font-weight: 500;
  color: var(--c-lgl01);
}
.section-h h2 small {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px; font-weight: 400;
  color: var(--ink-mute);
  margin-left: 10px;
  letter-spacing: 0.04em;
}
.section-h .filters { display: flex; gap: 6px; }

.chip {
  font-family: 'Geist', sans-serif;
  font-size: 12px; font-weight: 500;
  padding: 5px 12px;
  border-radius: 100px;
  border: 1px solid var(--rule);
  background: var(--card);
  color: var(--ink-soft);
  cursor: pointer;
  transition: all .12s;
  text-decoration: none;
  display: inline-block;
}
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip.on { background: var(--ink); color: var(--card); border-color: var(--ink); }

/* ─── ALERT STRIP ────────────────────────────────────────────── */
.alert-strip {
  display: flex; gap: 18px; align-items: center;
  background: var(--card);
  border: 1px solid var(--rose);
  border-radius: 18px;
  padding: 20px 24px;
  margin-bottom: 32px;
  position: relative;
  overflow: hidden;
}
.alert-strip::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 5px;
  background: var(--rose);
}
.alert-icon {
  width: 48px; height: 48px;
  border-radius: 14px;
  background: var(--rose);
  color: var(--card);
  display: grid; place-items: center;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 700;
  font-size: 22px;
  box-shadow: 0 0 0 6px var(--rose-soft);
  flex-shrink: 0;
}
.alert-strip .body { flex: 1; min-width: 0; }
.alert-strip .a-id {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px; font-weight: 700;
  color: var(--rose);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.alert-strip h3 {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 20px; font-weight: 600;
  color: var(--ink);
  line-height: 1.2;
  margin-bottom: 6px;
}
.alert-strip h3 em {
  font-family: 'Newsreader', serif;
  font-style: italic;
  color: var(--rose);
  font-weight: 500;
}
.alert-strip p {
  font-size: 13px;
  color: var(--ink-mute);
  line-height: 1.5;
}
.alert-strip p strong { color: var(--ink); font-weight: 500; }
.alert-strip p .pn {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--ink);
  font-weight: 500;
}
.alert-actions { display: flex; gap: 8px; flex-shrink: 0; }
.btn-primary, .btn-ghost {
  height: 36px; padding: 0 16px;
  border-radius: 100px;
  font-family: 'Geist', sans-serif;
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex; align-items: center;
  transition: all .15s;
  border: none;
}
.btn-primary {
  background: var(--rose);
  color: var(--card);
}
.btn-primary:hover { background: #a3321f; }
.btn-primary.ink { background: var(--ink); }
.btn-primary.ink:hover { background: var(--c-lgl01); }
.btn-primary.indigo { background: var(--c-lgl01); }
.btn-primary.indigo:hover { background: #0e2a6a; }
.btn-primary.green { background: var(--green); }
.btn-primary.green:hover { background: #226c52; }
.btn-ghost {
  background: transparent;
  color: var(--rose);
  border: 1px solid var(--rose);
}
.btn-ghost:hover { background: var(--rose-soft); }
.btn-ghost.ink {
  color: var(--ink);
  border-color: var(--rule-strong);
}
.btn-ghost.ink:hover { border-color: var(--ink); background: var(--card); }
.btn-ghost.indigo {
  color: var(--c-lgl01);
  border-color: rgba(26, 58, 138, 0.4);
}
.btn-ghost.indigo:hover { background: var(--c-lgl01-soft); border-color: var(--c-lgl01); }

/* ─── TASK CARDS ─────────────────────────────────────────────── */
.task-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  margin-bottom: 32px;
}
.task-grid .full { grid-column: 1 / -1; }

.task-card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 22px;
  padding: 22px 24px;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform .25s cubic-bezier(.2,.7,.3,1), box-shadow .25s, border-color .25s;
  display: block;
}
.task-card:hover {
  transform: translateY(-2px);
  border-color: var(--rule-strong);
  box-shadow: 0 16px 36px -12px rgba(20, 21, 26, 0.14);
}

.tc-head {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--accent-soft);
  margin: -22px -24px 14px;
  padding: 22px 24px 18px;
}
.glyph {
  width: 56px; height: 56px;
  border-radius: 16px;
  background: var(--accent);
  color: var(--card);
  display: grid; place-items: center;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 700; font-size: 22px;
  letter-spacing: -0.05em;
  box-shadow: 0 8px 16px -6px rgba(20, 21, 26, 0.3);
  position: relative;
  flex-shrink: 0;
}
.glyph.lg {
  width: 64px; height: 64px;
  font-size: 26px;
  border-radius: 18px;
}
.glyph::after {
  content: '';
  position: absolute;
  top: -3px; right: -3px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--card);
  border: 3px solid var(--card);
}
.glyph.live::after { background: var(--green); }
.glyph.draft::after { background: var(--ink-faint); }
.glyph.alert::after { background: var(--rose); animation: pulse-dot 1.6s infinite; }

.tc-titlewrap { flex: 1; min-width: 0; }
.tc-id {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px; font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.tc-name {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 22px; font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 4px;
}
.tc-area {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--ink-mute);
  letter-spacing: 0.04em;
}
.tc-mission {
  font-size: 13.5px;
  color: var(--ink-mute);
  line-height: 1.55;
  margin-bottom: 16px;
}
.tc-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.tc-tags .tag {
  font-family: 'Geist', sans-serif;
  font-size: 10.5px; font-weight: 500;
  padding: 3px 10px;
  border-radius: 100px;
  background: var(--accent-soft);
  color: var(--accent);
}
.tc-tags .tag.outline {
  background: transparent;
  border: 1px solid var(--rule-strong);
  color: var(--ink-mute);
}
.tc-tags .tag.crit {
  background: var(--rose-soft);
  color: var(--rose);
  font-weight: 600;
}
.tc-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0;
  border-top: 1px solid var(--rule);
  padding-top: 14px;
  margin-bottom: 12px;
}
.tc-stat { border-right: 1px solid var(--rule); padding-right: 10px; }
.tc-stat:last-child { border-right: none; padding-right: 0; }
.tc-stat + .tc-stat { padding-left: 10px; }
.tc-stat .num {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 22px; font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1;
}
.tc-stat .num small {
  font-family: 'Geist', sans-serif;
  font-size: 11px;
  color: var(--ink-mute);
  margin-left: 2px;
  font-weight: 500;
}
.tc-stat .num.accent { color: var(--accent); }
.tc-stat .lbl {
  font-size: 10.5px; font-weight: 500;
  color: var(--ink-mute);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 4px;
}
.tc-foot {
  display: flex; justify-content: space-between; align-items: center;
  border-top: 1px solid var(--rule);
  padding-top: 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--ink-mute);
}
.tc-foot .next-run { display: flex; align-items: center; gap: 6px; }
.tc-foot .next-run::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse-dot 2s infinite;
}
.tc-foot .arrow {
  color: var(--ink);
  font-family: 'Geist', sans-serif;
  font-size: 12px; font-weight: 600;
  text-decoration: none;
  transition: transform .15s;
}
.task-card:hover .tc-foot .arrow { transform: translateX(2px); }

/* ─── TRIAGEM KANBAN ─────────────────────────────────────────── */
.triage-section {
  margin-bottom: 32px;
  padding: 28px 28px 24px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 22px;
  position: relative;
  overflow: hidden;
}
.triage-section::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--c-lgl01) 0%, var(--c-lgl02) 25%, var(--c-lgl05) 50%, var(--c-lgl03) 75%, var(--c-lgl04) 100%);
}
.triage-section .triage-h {
  display: flex; justify-content: space-between; align-items: end;
  margin-bottom: 22px;
}
.triage-section .triage-h h2 {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 28px; font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.triage-section .triage-h h2 em {
  font-family: 'Newsreader', serif;
  font-style: italic;
  color: var(--c-lgl01);
  font-weight: 500;
}
.triage-section .triage-h .meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--ink-mute);
  text-align: right;
  line-height: 1.5;
  letter-spacing: 0.04em;
}
.triage-section .triage-h .meta b { color: var(--c-lgl01); font-weight: 600; }

.kanban {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
}
.kan-col {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 14px 12px 12px;
  min-height: 320px;
  display: flex; flex-direction: column;
}
.kan-col-h {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0 4px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--rule);
}
.kan-col-h .name {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 13px; font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.kan-col-h .ct {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px; font-weight: 600;
  padding: 2px 8px;
  background: var(--bg-warm);
  border-radius: 100px;
  color: var(--ink-mute);
}
.kan-col-h .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  display: inline-block;
  vertical-align: middle;
}
.kan-col.coleta .dot { background: var(--ink-mute); }
.kan-col.classif .dot { background: var(--c-lgl02); }
.kan-col.review .dot { background: var(--c-lgl03); }
.kan-col.aprov .dot { background: var(--green); }
.kan-col.crit .dot { background: var(--rose); animation: pulse-dot 1.6s infinite; }
.kan-col.crit { border-color: var(--rose); background: linear-gradient(180deg, var(--rose-soft) 0%, var(--card) 30%); }
.kan-col.crit .ct { background: var(--rose); color: var(--card); }

.kan-card {
  padding: 10px 12px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 10px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all .15s;
  text-decoration: none;
  display: block;
  color: inherit;
}
.kan-card:hover { border-color: var(--ink); transform: translateX(2px); }
.kan-card .pn {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--ink-mute);
  font-weight: 500;
  margin-bottom: 2px;
  letter-spacing: 0.02em;
}
.kan-card .act {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 13px; font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin-bottom: 2px;
}
.kan-card .act em {
  font-family: 'Newsreader', serif;
  font-style: italic;
  color: var(--c-lgl01);
  font-weight: 500;
}
.kan-card .area {
  display: block;
  padding: 0;
  background: transparent;
  font-family: 'Geist', sans-serif;
  font-size: 11px;
  color: var(--ink-mute);
  grid-template-columns: none;
}
.kan-card .meta-row {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed var(--rule);
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px;
  color: var(--ink-mute);
  letter-spacing: 0.04em;
}
.kan-card .conf {
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 600;
}
.kan-card .conf.high { background: rgba(45, 138, 106, 0.12); color: var(--green); }
.kan-card .conf.mid { background: rgba(192, 128, 32, 0.12); color: var(--c-lgl03); }
.kan-card .conf.low { background: var(--rose-soft); color: var(--rose); }
.kan-card.crit { border-color: var(--rose); }
.kan-card.crit .act { color: var(--rose); }
.kan-more {
  text-align: center;
  padding: 8px 0 0;
  font-family: 'Geist', sans-serif;
  font-size: 11px;
  color: var(--ink-mute);
  border-top: 1px dashed var(--rule);
  margin-top: auto;
  text-decoration: none;
  display: block;
}
.kan-more:hover { color: var(--c-lgl01); }

/* ─── ANATOMIA / SCHEMA OUTPUT ───────────────────────────────── */
.anatomy {
  margin-bottom: 32px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 22px;
  overflow: hidden;
  position: relative;
}
.anatomy-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 0;
}
.anatomy-left {
  padding: 32px 36px 32px 36px;
  background:
    repeating-linear-gradient(180deg, transparent 0, transparent 27px, rgba(26, 58, 138, 0.04) 27px, rgba(26, 58, 138, 0.04) 28px),
    var(--paper);
  border-right: 1px solid var(--rule);
  position: relative;
}
.anatomy-left::before {
  content: '';
  position: absolute;
  top: 24px; left: 0;
  width: 3px; height: 60px;
  background: var(--c-lgl01);
}
.anatomy-eye {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px; font-weight: 600;
  color: var(--c-lgl01);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.anatomy-process {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--ink-mute);
  margin-bottom: 4px;
  letter-spacing: 0.02em;
}
.anatomy-court {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 14px; font-weight: 500;
  color: var(--ink);
  margin-bottom: 16px;
}
.anatomy-text {
  font-family: 'Newsreader', serif;
  font-size: 16.5px;
  line-height: 1.62;
  color: var(--ink-soft);
}
.anatomy-text mark {
  background: rgba(26, 58, 138, 0.12);
  color: var(--c-lgl01);
  font-weight: 500;
  padding: 1px 3px;
  border-radius: 3px;
}
.anatomy-text mark.deadline { background: rgba(176, 112, 32, 0.18); color: var(--c-lgl03); }
.anatomy-text mark.act { background: rgba(90, 58, 138, 0.14); color: var(--c-lgl02); }

.anatomy-right {
  padding: 28px 32px;
  display: flex; flex-direction: column;
  background: var(--card);
}
.anatomy-right h3 {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 18px; font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}
.anatomy-right h3 em {
  font-family: 'Newsreader', serif;
  font-style: italic;
  color: var(--c-lgl01);
  font-weight: 500;
}
.anatomy-right .sub {
  font-size: 12px;
  color: var(--ink-mute);
  margin-bottom: 18px;
}
.schema-row {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 10px;
  align-items: baseline;
  padding: 8px 0;
  border-bottom: 1px dashed var(--rule);
  font-size: 12.5px;
}
.schema-row:last-child { border-bottom: none; }
.schema-row .k {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px; font-weight: 600;
  color: var(--ink-mute);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.schema-row .v { color: var(--ink); font-weight: 500; }
.schema-row .v.tag {
  display: inline-block;
  padding: 2px 8px;
  background: var(--c-lgl02-soft);
  color: var(--c-lgl02);
  border-radius: 100px;
  font-family: 'Geist', sans-serif;
  font-size: 11.5px;
  font-weight: 600;
}
.schema-row .v.tag.amber { background: var(--c-lgl03-soft); color: var(--c-lgl03); }
.schema-row .v.tag.indigo { background: var(--c-lgl01-soft); color: var(--c-lgl01); }
.schema-row .v.tag.green { background: rgba(45, 138, 106, 0.14); color: var(--green); }
.schema-row .v.tag.rose { background: var(--rose-soft); color: var(--rose); }
.schema-row .v.tag.aubergine { background: var(--c-lgl05-soft); color: var(--c-lgl05); }
.schema-row .v .pct { font-family: 'JetBrains Mono', monospace; font-weight: 700; }
.schema-row .v small {
  font-family: 'Geist', sans-serif;
  font-size: 11px;
  color: var(--ink-mute);
  font-weight: 400;
  margin-left: 6px;
  font-style: italic;
}
.anatomy-cta {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--rule);
  display: flex; gap: 8px;
}

/* ─── RIGHT RAIL ─────────────────────────────────────────────── */
.rail {
  border-left: 1px solid var(--rule);
  padding: 32px 24px 32px;
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-warm) 100%);
}
.rail-h {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 22px; font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 18px;
}
.rail-h em {
  font-family: 'Newsreader', serif;
  font-style: italic;
  color: var(--c-lgl01);
  font-weight: 500;
}
.rail-section { margin-bottom: 28px; }
.rail-lbl {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px; font-weight: 600;
  color: var(--ink-mute);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.stat-tile {
  padding: 14px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 12px;
}
.stat-tile .lbl {
  font-size: 10.5px;
  color: var(--ink-mute);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
  font-weight: 500;
}
.stat-tile .val {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 24px; font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
}
.stat-tile .val.green { color: var(--green); }
.stat-tile .val.amber { color: var(--c-lgl03); }
.stat-tile .val.rose { color: var(--rose); }
.stat-tile .val.indigo { color: var(--c-lgl01); }
.stat-tile .val.aubergine { color: var(--c-lgl05); }
.stat-tile .val small {
  font-family: 'Geist', sans-serif;
  font-size: 11px;
  color: var(--ink-mute);
  margin-left: 2px;
  font-weight: 500;
}

.rail-row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 10px 0;
  border-bottom: 1px dashed var(--rule);
  text-decoration: none;
  color: inherit;
  transition: padding-left .12s;
}
.rail-row:hover { padding-left: 4px; padding-right: 4px; }
.rail-row:last-child { border-bottom: none; }
.rail-row .label { font-size: 12.5px; color: var(--ink); }
.rail-row .label small {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--ink-mute);
  margin-top: 2px;
}
.rail-row .val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; font-weight: 500;
  color: var(--ink-soft);
  text-align: right;
}
.rail-row .val.alert { color: var(--rose); font-weight: 700; }
.rail-row .val.warn { color: var(--c-lgl03); font-weight: 600; }
.rail-row .val.green { color: var(--green); font-weight: 600; }

.review-card {
  padding: 12px 14px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 10px;
  margin-bottom: 8px;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: all .15s;
  border-left: 3px solid var(--rose);
}
.review-card:hover { border-color: var(--rose); transform: translateX(2px); }
.review-card .rc-act {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 12.5px; font-weight: 600;
  color: var(--ink);
  margin-bottom: 2px;
  letter-spacing: -0.01em;
}
.review-card .rc-act em {
  font-family: 'Newsreader', serif;
  font-style: italic;
  color: var(--rose);
  font-weight: 500;
}
.review-card .rc-pn {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--ink-mute);
  margin-bottom: 4px;
}
.review-card .rc-foot {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed var(--rule);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--ink-mute);
}
.review-card .rc-foot .deadline {
  color: var(--rose);
  font-weight: 600;
  letter-spacing: 0.04em;
}

/* ─── CUSTOM RECORD TABLE ────────────────────────────────────── */
.rec-toolbar {
  display: flex; gap: 12px; align-items: center;
  margin-bottom: 18px;
  padding: 12px 14px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 14px;
}
.rec-search {
  flex: 1;
  display: flex; align-items: center; gap: 8px;
  padding: 0 10px;
  height: 32px;
}
.rec-search input {
  flex: 1;
  border: none; outline: none; background: transparent;
  font-family: 'Geist', sans-serif;
  font-size: 13px;
  color: var(--ink);
}
.rec-search input::placeholder { color: var(--ink-faint); font-style: italic; }
.rec-search svg { color: var(--ink-mute); }

.rec-table {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 24px;
}
.rec-table .rec-head, .rec-table .rec-row {
  display: grid;
  grid-template-columns: 60px 180px 1fr 180px 140px 110px 80px;
  align-items: center;
  padding: 12px 18px;
  font-size: 12.5px;
  border-bottom: 1px solid var(--rule);
}
.rec-table .rec-head, .audit-head, .rules-head {
  background: var(--paper);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; font-weight: 600;
  color: var(--ink-mute);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.rec-table .rec-row {
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: background .12s;
}
.rec-table .rec-row:hover { background: var(--paper); }
.rec-table .rec-row:last-child { border-bottom: none; }
.rec-table .rec-row .id {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--c-lgl01);
  font-weight: 600;
}
.rec-table .rec-row .pn {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  color: var(--ink);
  font-weight: 500;
}
.rec-table .rec-row .name {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.01em;
  line-height: 1.3;
}
.rec-table .rec-row .name small {
  display: block;
  font-family: 'Geist', sans-serif;
  font-size: 11.5px;
  color: var(--ink-mute);
  font-weight: 400;
  margin-top: 2px;
}
.rec-table .rec-row .meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  color: var(--ink-mute);
}
.rec-table .rec-row .badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 100px;
  font-family: 'Geist', sans-serif;
  font-size: 10.5px;
  font-weight: 600;
}
.badge.b-active, .badge.b-aprov { background: rgba(45, 138, 106, 0.14); color: var(--green); }
.badge.b-draft { background: var(--c-lgl05-soft); color: var(--c-lgl05); }
.badge.b-review { background: var(--c-lgl03-soft); color: var(--c-lgl03); }
.badge.b-edit { background: var(--c-lgl02-soft); color: var(--c-lgl02); }
.badge.b-suspended, .badge.b-discard { background: var(--bg-warm); color: var(--ink-mute); }
.badge.b-crit { background: var(--rose-soft); color: var(--rose); }
.badge.b-signed { background: var(--ink); color: var(--card); }

/* ─── CALÍOPE METRICS / FLOW ─────────────────────────────────── */
.flow-diagram {
  display: grid;
  grid-template-columns: repeat(7, 1fr) auto;
  gap: 4px;
  align-items: stretch;
  margin-bottom: 32px;
  padding: 24px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 18px;
  overflow-x: auto;
}
.flow-step {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 14px 12px;
  position: relative;
  font-size: 11.5px;
  text-align: left;
  display: flex; flex-direction: column;
  min-width: 0;
}
.flow-step.connector { border-color: var(--c-lgl01); background: var(--c-lgl01-soft); }
.flow-step.event { border-color: var(--c-lgl02); background: var(--c-lgl02-soft); }
.flow-step.agent { border-color: var(--c-lgl05); background: var(--c-lgl05-soft); }
.flow-step.review { border-color: var(--c-lgl03); background: var(--c-lgl03-soft); }
.flow-step.approve { border-color: var(--green); background: rgba(45, 138, 106, 0.1); }
.flow-step.sign { background: var(--ink); border-color: var(--ink); color: var(--card); }
.flow-step .step-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--ink-mute);
  text-transform: uppercase;
  margin-bottom: 6px;
}
.flow-step.sign .step-num { color: rgba(255,255,255,0.6); }
.flow-step .step-name {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.15;
  margin-bottom: 4px;
  color: var(--ink);
}
.flow-step.sign .step-name { color: var(--card); }
.flow-step .step-desc {
  font-size: 11px;
  color: var(--ink-mute);
  line-height: 1.35;
}
.flow-step.sign .step-desc { color: rgba(255,255,255,0.7); }
.flow-arrow {
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-faint);
  font-size: 14px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}
.metric-tile {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 18px 18px;
  position: relative;
}
.metric-tile .m-lbl {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px; font-weight: 600;
  color: var(--ink-mute);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.metric-tile .m-val {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 32px; font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.metric-tile .m-val em {
  font-family: 'Newsreader', serif;
  font-style: italic;
  font-weight: 500;
  color: var(--c-lgl05);
}
.metric-tile .m-val small {
  font-family: 'Geist', sans-serif;
  font-size: 13px;
  color: var(--ink-mute);
  margin-left: 3px;
  font-weight: 500;
}
.metric-tile .m-trend {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  color: var(--ink-mute);
  margin-top: 6px;
}
.metric-tile .m-trend.up { color: var(--green); }
.metric-tile .m-trend.down { color: var(--rose); }

.bar-chart {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 22px 22px 18px;
  margin-bottom: 24px;
}
.bar-chart h3 {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 16px; font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}
.bar-chart .sub {
  font-size: 11.5px;
  color: var(--ink-mute);
  margin-bottom: 16px;
}
.bar-row {
  display: grid;
  grid-template-columns: 130px 1fr 90px;
  gap: 12px;
  align-items: center;
  padding: 6px 0;
  font-size: 12.5px;
}
.bar-row .b-name { color: var(--ink); }
.bar-row .b-name em {
  font-family: 'Newsreader', serif;
  font-style: italic;
  color: var(--c-lgl05);
  font-weight: 500;
}
.bar-row .b-track {
  height: 8px;
  background: var(--bg-warm);
  border-radius: 100px;
  overflow: hidden;
}
.bar-row .b-fill {
  height: 100%;
  background: var(--c-lgl05);
  border-radius: 100px;
}
.bar-row .b-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--ink);
  font-weight: 600;
  text-align: right;
  white-space: nowrap;
}

/* ─── PEÇA REVIEW (lawyer review interactive page) ───────────── */
.peca-shell {
  display: grid;
  grid-template-columns: 1fr 480px;
  height: calc(100vh - 72px - 72px);
  min-height: 600px;
}
.peca-editor {
  padding: 28px 36px;
  overflow-y: auto;
  border-right: 1px solid var(--rule);
  background: var(--paper);
}
.peca-doc {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 48px 56px;
  max-width: 760px;
  margin: 0 auto;
  box-shadow: 0 8px 32px -16px rgba(20, 21, 26, 0.08);
}
.peca-doc-head {
  margin-bottom: 28px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--rule);
}
.peca-doc-head .court {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ink-mute);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.peca-doc-head .processo {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  color: var(--ink);
  font-weight: 600;
  margin-bottom: 4px;
}
.peca-doc-head .partes {
  font-size: 12.5px;
  color: var(--ink-mute);
  line-height: 1.5;
}
.peca-doc-title {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 26px; font-weight: 600;
  letter-spacing: -0.02em;
  text-align: center;
  margin: 28px 0 32px;
  color: var(--ink);
}
.peca-doc-body {
  font-family: 'Newsreader', serif;
  font-size: 15.5px;
  line-height: 1.78;
  color: var(--ink-soft);
  text-align: justify;
}
.peca-doc-body p { margin-bottom: 14px; }
.peca-doc-body p strong { color: var(--ink); font-weight: 500; }
.peca-doc-body .cite {
  background: rgba(106, 40, 72, 0.08);
  border-left: 3px solid var(--c-lgl05);
  padding: 14px 18px;
  margin: 18px 0;
  font-style: italic;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.6;
  border-radius: 0 8px 8px 0;
}
.peca-doc-body .cite cite {
  display: block;
  margin-top: 8px;
  font-style: normal;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--c-lgl05);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 600;
}
.peca-doc-body .ai-edit {
  background: rgba(106, 40, 72, 0.06);
  border-bottom: 1px dashed var(--c-lgl05);
  padding: 0 2px;
  cursor: pointer;
  position: relative;
}
.peca-doc-body .ai-edit:hover {
  background: rgba(106, 40, 72, 0.14);
}
.peca-doc-body .lawyer-edit {
  background: rgba(45, 138, 106, 0.08);
  border-bottom: 1px solid var(--green);
  padding: 0 2px;
}

.peca-toolbar {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 22px;
  padding: 14px 18px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 14px;
}
.peca-toolbar-left {
  display: flex; align-items: center; gap: 14px;
}
.peca-toolbar-left .peca-status {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 100px;
  background: var(--c-lgl05-soft);
  color: var(--c-lgl05);
}
.peca-toolbar-left .peca-info {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--ink-mute);
  letter-spacing: 0.04em;
}
.peca-toolbar-left .peca-info b { color: var(--ink); font-weight: 600; }
.peca-toolbar-right { display: flex; gap: 8px; }

.peca-actions {
  position: sticky;
  bottom: 0;
  background: var(--bg-warm);
  border-top: 1px solid var(--rule);
  padding: 16px 36px;
  margin: 28px -36px -28px;
  display: flex; gap: 10px; align-items: center;
}
.peca-actions .spacer { flex: 1; }

/* ─── PEÇA CHAT (right pane) ─────────────────────────────────── */
.peca-chat {
  display: flex; flex-direction: column;
  background: var(--bg);
  height: 100%;
}
.peca-chat-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 20px;
  border-bottom: 1px solid var(--rule);
  background: var(--c-lgl05-soft);
}
.peca-chat-head .agent {
  display: flex; align-items: center; gap: 10px;
}
.peca-chat-head .agent .av {
  width: 32px; height: 32px;
  border-radius: 10px;
  background: var(--c-lgl05);
  color: var(--card);
  display: grid; place-items: center;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 700;
  font-size: 14px;
}
.peca-chat-head .agent .info {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.peca-chat-head .agent .info small {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--ink-mute);
  font-weight: 500;
  margin-top: 2px;
  letter-spacing: 0.04em;
}
.peca-chat-head .iter {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  color: var(--c-lgl05);
  font-weight: 600;
  letter-spacing: 0.06em;
}

.peca-chat-body {
  flex: 1; overflow-y: auto;
  padding: 20px 22px;
}
.peca-chat-input-wrap {
  border-top: 1px solid var(--rule);
  padding: 14px 20px 18px;
  background: var(--bg);
}
.peca-chat-input {
  background: var(--card);
  border: 1px solid var(--rule-strong);
  border-radius: 14px;
  padding: 12px 16px 8px;
  transition: all .15s;
}
.peca-chat-input:focus-within {
  border-color: var(--c-lgl05);
  box-shadow: 0 0 0 4px var(--c-lgl05-soft);
}
.peca-chat-input textarea {
  width: 100%;
  border: none; outline: none; background: transparent;
  font-family: 'Geist', sans-serif;
  font-size: 13.5px;
  color: var(--ink);
  resize: none;
  min-height: 22px;
  line-height: 1.5;
}
.peca-chat-input textarea::placeholder { color: var(--ink-faint); font-style: italic; }
.peca-chat-input-tools {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed var(--rule);
}

/* ─── DRAWER (Ask Cowork) ────────────────────────────────────── */
.ask-fab {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 40;
  display: flex; align-items: center; gap: 10px;
  padding: 14px 20px 14px 18px;
  background: var(--ink);
  color: var(--card);
  border: none;
  border-radius: 100px;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 14px; font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  box-shadow: 0 12px 32px -8px rgba(20, 21, 26, 0.4), 0 0 0 0 var(--c-lgl01-soft);
  transition: all .25s cubic-bezier(.2,.7,.3,1);
}
.ask-fab:hover {
  transform: translateY(-2px);
  background: var(--c-lgl01);
  box-shadow: 0 16px 40px -8px rgba(26, 58, 138, 0.5), 0 0 0 6px var(--c-lgl01-soft);
}
.ask-fab .star {
  font-size: 16px;
  animation: sparkle 3s ease-in-out infinite;
}
@keyframes sparkle {
  0%, 100% { opacity: 1; transform: rotate(0deg); }
  50% { opacity: 0.6; transform: rotate(180deg); }
}
.ask-fab .kbd {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; font-weight: 500;
  background: rgba(255, 255, 255, 0.18);
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 4px;
}

.drawer-backdrop {
  position: fixed; inset: 0;
  background: rgba(20, 21, 26, 0.4);
  backdrop-filter: blur(2px);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
}
.drawer-backdrop.open { opacity: 1; pointer-events: all; }
.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 480px;
  background: var(--bg);
  z-index: 101;
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform .35s cubic-bezier(.2,.7,.3,1);
  box-shadow: -16px 0 48px -16px rgba(20, 21, 26, 0.3);
}
.drawer.open { transform: translateX(0); }
.drawer-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--rule);
}
.drawer-title {
  display: flex; align-items: center; gap: 10px;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 18px; font-weight: 600;
  letter-spacing: -0.02em;
}
.drawer-title .star { color: var(--c-lgl01); font-size: 18px; }
.drawer-title em {
  font-family: 'Newsreader', serif;
  font-style: italic;
  color: var(--c-lgl01);
  font-weight: 500;
}
.drawer-close {
  width: 32px; height: 32px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 100px;
  color: var(--ink-mute);
  cursor: pointer;
  display: grid; place-items: center;
  transition: all .15s;
}
.drawer-close:hover { color: var(--ink); border-color: var(--ink); }
.drawer-body { flex: 1; overflow-y: auto; padding: 24px; }

.chat-msg { margin-bottom: 22px; animation: fade-in .4s; }
@keyframes fade-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.chat-msg.user { display: flex; justify-content: flex-end; }
.chat-msg.user .bubble {
  background: var(--ink);
  color: var(--card);
  padding: 11px 16px;
  border-radius: 18px 18px 4px 18px;
  max-width: 80%;
  font-size: 13.5px;
  line-height: 1.5;
}

.chat-msg.assistant .speaker {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--c-lgl01);
  text-transform: uppercase;
}
.chat-msg.assistant.caliope .speaker { color: var(--c-lgl05); }
.chat-msg.assistant.caliope .speaker .av { background: var(--c-lgl05); }
.chat-msg.assistant .speaker .av {
  width: 22px; height: 22px;
  border-radius: 7px;
  background: var(--c-lgl01);
  color: var(--card);
  display: grid; place-items: center;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 700;
  font-size: 12px;
}
.chat-msg.assistant .text {
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink);
}
.chat-msg.assistant .text strong { font-weight: 600; }
.chat-msg.assistant .text em {
  font-family: 'Newsreader', serif;
  font-style: italic;
  color: var(--c-lgl01);
}
.chat-msg.assistant.caliope .text em { color: var(--c-lgl05); }
.chat-msg.assistant .text .num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  background: var(--bg-warm);
  color: var(--ink);
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 500;
}
.chat-msg.assistant .text p + p { margin-top: 10px; }

.embed {
  margin: 14px 0;
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 14px;
  font-size: 13px;
}
.embed.crit { border-color: var(--rose); background: var(--rose-soft); }
.embed.aubergine { border-color: rgba(106, 40, 72, 0.3); background: var(--c-lgl05-soft); }
.embed .e-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px; font-weight: 700;
  color: var(--rose);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.embed.aubergine .e-tag { color: var(--c-lgl05); }
.embed .e-title {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 16px; font-weight: 600;
  line-height: 1.2;
  margin-bottom: 6px;
}
.embed .e-meta { font-size: 12.5px; color: var(--ink-mute); line-height: 1.5; }
.embed .e-meta .pn {
  font-family: 'JetBrains Mono', monospace;
  color: var(--ink); font-weight: 500;
}
.embed .e-actions {
  display: flex; gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--rule);
}
.embed .e-action {
  font-family: 'Geist', sans-serif;
  font-size: 11.5px; font-weight: 500;
  padding: 5px 12px;
  border-radius: 100px;
  background: transparent;
  border: 1px solid var(--rule);
  color: var(--ink-soft);
  cursor: pointer;
  text-decoration: none;
}
.embed .e-action.primary {
  background: var(--rose);
  color: var(--card);
  border-color: var(--rose);
}
.embed.aubergine .e-action.primary {
  background: var(--c-lgl05);
  border-color: var(--c-lgl05);
}

.quick-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0; }
.quick-row .qa {
  font-family: 'Geist', sans-serif;
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 100px;
  background: var(--card);
  border: 1px solid var(--rule);
  color: var(--ink-soft);
  cursor: pointer;
  text-decoration: none;
  transition: all .12s;
}
.quick-row .qa:hover { border-color: var(--c-lgl01); color: var(--c-lgl01); }
.quick-row.aubergine .qa:hover { border-color: var(--c-lgl05); color: var(--c-lgl05); }

.drawer-input-wrap {
  border-top: 1px solid var(--rule);
  padding: 16px 20px 20px;
  background: var(--bg-warm);
}
.drawer-input {
  background: var(--card);
  border: 1px solid var(--rule-strong);
  border-radius: 16px;
  padding: 14px 18px 10px;
  transition: all .15s;
}
.drawer-input:focus-within {
  border-color: var(--c-lgl01);
  box-shadow: 0 0 0 4px var(--c-lgl01-soft);
}
.drawer-input textarea {
  width: 100%;
  border: none; outline: none; background: transparent;
  font-family: 'Geist', sans-serif;
  font-size: 14px;
  color: var(--ink);
  resize: none;
  min-height: 22px;
  line-height: 1.5;
}
.drawer-input textarea::placeholder { color: var(--ink-faint); font-style: italic; }
.drawer-input-tools {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--rule);
}
.drawer-input-tools .left { display: flex; gap: 4px; }
.tool-btn {
  background: transparent;
  border: 1px solid var(--rule);
  color: var(--ink-mute);
  padding: 4px 10px;
  border-radius: 100px;
  font-family: 'Geist', sans-serif;
  font-size: 11.5px;
  cursor: pointer;
  font-weight: 500;
}
.tool-btn.context {
  background: var(--c-lgl01-soft);
  border-color: rgba(26, 58, 138, 0.3);
  color: var(--c-lgl01);
}
.tool-btn.context.aubergine {
  background: var(--c-lgl05-soft);
  border-color: rgba(106, 40, 72, 0.3);
  color: var(--c-lgl05);
}
.send-btn {
  display: flex; align-items: center; gap: 6px;
  background: var(--ink);
  color: var(--card);
  border: none;
  padding: 7px 14px;
  border-radius: 100px;
  font-family: 'Geist', sans-serif;
  font-size: 12.5px; font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.send-btn:hover { background: var(--c-lgl01); }
.send-btn .kbd {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px;
  background: rgba(255, 255, 255, 0.18);
  padding: 1px 5px;
  border-radius: 3px;
}
.send-btn.aubergine:hover { background: var(--c-lgl05); }

/* ─── MODAL/DIALOG ───────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(20, 21, 26, 0.5);
  backdrop-filter: blur(3px);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
  display: grid; place-items: center;
}
.modal-backdrop.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 22px;
  width: 560px;
  max-width: calc(100vw - 48px);
  max-height: calc(100vh - 48px);
  overflow: hidden;
  display: flex; flex-direction: column;
  transform: translateY(20px);
  opacity: 0;
  transition: all .25s cubic-bezier(.2,.7,.3,1);
  box-shadow: 0 24px 64px -16px rgba(20, 21, 26, 0.3);
}
.modal-backdrop.open .modal {
  transform: translateY(0);
  opacity: 1;
}
.modal-head {
  padding: 20px 24px;
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
  display: flex; justify-content: space-between; align-items: center;
}
.modal-head h2 {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 20px; font-weight: 600;
  letter-spacing: -0.01em;
}
.modal-head h2 em {
  font-family: 'Newsreader', serif;
  font-style: italic;
  color: var(--c-lgl01);
  font-weight: 500;
}
.modal-body {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
}
.modal-foot {
  padding: 16px 24px;
  background: var(--paper);
  border-top: 1px solid var(--rule);
  display: flex; justify-content: flex-end; align-items: center; gap: 8px;
}
.modal-section-lbl {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 10px;
}
.field {
  margin-bottom: 16px;
}
.field-lbl {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 6px;
}
.field-lbl .req { color: var(--rose); margin-left: 2px; }
.field-input, .field-select, .field-textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--card);
  border: 1px solid var(--rule-strong);
  border-radius: 10px;
  font-family: 'Geist', sans-serif;
  font-size: 13.5px;
  color: var(--ink);
  outline: none;
  transition: all .15s;
}
.field-input:focus, .field-select:focus, .field-textarea:focus {
  border-color: var(--c-lgl01);
  box-shadow: 0 0 0 4px var(--c-lgl01-soft);
}
.field-textarea { resize: vertical; min-height: 88px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-help {
  font-size: 11.5px;
  color: var(--ink-mute);
  margin-top: 4px;
  font-style: italic;
}

/* ─── ATMOSPHERE ─────────────────────────────────────────────── */
.ambient-blob {
  position: fixed; pointer-events: none; z-index: 0;
  width: 540px; height: 540px;
  top: -160px; left: -180px;
  background: radial-gradient(circle, rgba(26, 58, 138, 0.07), transparent 65%);
  filter: blur(50px);
}
.ambient-blob.b2 {
  top: auto; left: auto;
  bottom: -200px; right: -200px;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(90, 58, 138, 0.05), transparent 65%);
}
.grain {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 99;
  opacity: 0.04;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.88' numOctaves='3' stitchTiles='stitch'/></filter><rect width='220' height='220' filter='url(%23n)'/></svg>");
}

/* entrance animations */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.info-bar, .alert-strip, .section-h, .task-card, .new-task-cta, .ask-fab, .triage-section, .anatomy, .page-header, .rec-toolbar, .rec-table, .flow-diagram, .metric-tile, .bar-chart, .peca-toolbar, .peca-doc {
  animation: fade-up .55s cubic-bezier(.2,.7,.3,1) backwards;
}
.info-bar, .page-header { animation-delay: 0.05s; }
.alert-strip { animation-delay: 0.1s; }
.section-h { animation-delay: 0.15s; }
.task-card:nth-child(1), .metric-tile:nth-child(1) { animation-delay: 0.18s; }
.task-card:nth-child(2), .metric-tile:nth-child(2) { animation-delay: 0.22s; }
.task-card:nth-child(3), .metric-tile:nth-child(3) { animation-delay: 0.26s; }
.task-card:nth-child(4), .metric-tile:nth-child(4) { animation-delay: 0.30s; }
.task-card:nth-child(5) { animation-delay: 0.34s; }
.triage-section { animation-delay: 0.36s; }
.anatomy, .bar-chart { animation-delay: 0.42s; }
.ask-fab { animation-delay: 0.6s; }

/* misc helpers */
.pn-mono {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  color: var(--ink);
  font-weight: 500;
  letter-spacing: 0.02em;
}
.divider { height: 1px; background: var(--rule); margin: 24px 0; }
.empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--ink-mute);
  font-size: 13px;
  background: var(--paper);
  border: 1px dashed var(--rule);
  border-radius: 14px;
}

/* timeline */
.timeline { padding-left: 22px; position: relative; }
.timeline::before {
  content: '';
  position: absolute;
  top: 6px; bottom: 6px; left: 6px;
  width: 2px;
  background: var(--rule);
}
.tl-item {
  position: relative;
  padding-bottom: 18px;
  padding-left: 14px;
}
.tl-item::before {
  content: '';
  position: absolute;
  left: -22px;
  top: 4px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--card);
  border: 2px solid var(--rule-strong);
}
.tl-item.live::before { border-color: var(--green); background: var(--green); }
.tl-item.warn::before { border-color: var(--c-lgl03); background: var(--c-lgl03); }
.tl-item.crit::before { border-color: var(--rose); background: var(--rose); }
.tl-item.ai::before { border-color: var(--c-lgl05); background: var(--c-lgl05); }
.tl-item .tl-time {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  color: var(--ink-mute);
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}
.tl-item .tl-title {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}
.tl-item .tl-title em {
  font-family: 'Newsreader', serif;
  font-style: italic;
  color: var(--c-lgl05);
  font-weight: 500;
}
.tl-item .tl-desc {
  font-size: 12.5px;
  color: var(--ink-mute);
  line-height: 1.5;
}

/* tabs */
.tabs {
  display: flex; gap: 2px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 22px;
}
.tab {
  padding: 10px 16px;
  border: none;
  background: transparent;
  font-family: 'Geist', sans-serif;
  font-size: 13px; font-weight: 500;
  color: var(--ink-mute);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all .15s;
  text-decoration: none;
}
.tab:hover { color: var(--ink); }
.tab.on {
  color: var(--ink);
  border-bottom-color: var(--c-lgl01);
  font-weight: 600;
}
.tab .ct {
  margin-left: 6px;
  padding: 1px 7px;
  background: var(--bg-warm);
  border-radius: 100px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--ink-mute);
  font-weight: 500;
}
.tab.on .ct { background: var(--c-lgl01); color: var(--card); }

/* ══════════════════════════════════════════════════════════════════
   PREMIUM UPGRADES · Phase 2 — tactile, motion, premium finish
   ══════════════════════════════════════════════════════════════════ */

/* ─── TACTILE BUTTON PRESS ───────────────────────────────────────── */
.btn-primary:active, .btn-ghost:active,
.send-btn:active, .btn-sm:active,
.new-task-cta:active, .ask-btn:active {
  transform: scale(0.97) translateY(0.5px);
  transition-duration: 0.06s;
}
.chip:active { transform: scale(0.95); transition-duration: 0.06s; }
.task-card:active { transform: translateY(-1px) scale(0.99); }
.kan-card:active { transform: scale(0.98); }
.icon-btn:active { transform: scale(0.92); }

/* ─── BAR CHART ANIMATED FILL ────────────────────────────────────── */
@keyframes bar-grow {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}
.b-fill {
  transform-origin: left;
  animation: bar-grow 0.9s cubic-bezier(.2, .7, .3, 1) backwards;
}
.bar-row:nth-child(2) .b-fill { animation-delay: 0.06s; }
.bar-row:nth-child(3) .b-fill { animation-delay: 0.12s; }
.bar-row:nth-child(4) .b-fill { animation-delay: 0.18s; }
.bar-row:nth-child(5) .b-fill { animation-delay: 0.24s; }
.bar-row:nth-child(6) .b-fill { animation-delay: 0.30s; }
.bar-row:nth-child(7) .b-fill { animation-delay: 0.36s; }

/* ─── DEADLINE URGENCY PULSE ─────────────────────────────────────── */
@keyframes deadline-urgency {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
.deadline { animation: deadline-urgency 1.8s ease-in-out infinite; }

/* ─── ALERT STRIP LIVING LEFT INDICATOR ─────────────────────────── */
@keyframes alert-border-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}
.alert-strip::before { animation: alert-border-pulse 2.2s ease-in-out infinite; }

/* ─── METRIC TILE HOVER ACCENT TOP LINE ──────────────────────────── */
.metric-tile { overflow: hidden; }
.metric-tile::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--c-lgl01);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s cubic-bezier(.2, .7, .3, 1);
}
.metric-tile:hover::after { transform: scaleX(1); }

/* ─── STAT TILE HOVER LIFT ────────────────────────────────────────── */
.stat-tile {
  transition: transform 0.2s cubic-bezier(.2, .7, .3, 1), box-shadow 0.2s, border-color 0.2s;
}
.stat-tile:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px -8px rgba(20, 21, 26, 0.12);
  border-color: var(--rule-strong);
}

/* ─── REVIEW CARD HOVER ENHANCED SHADOW ─────────────────────────── */
.review-card:hover {
  box-shadow: -4px 0 0 var(--rose), 0 6px 20px -8px rgba(201, 63, 44, 0.18);
  transform: translateX(3px);
}

/* ─── ASK FAB ATTENTION RING PULSE ──────────────────────────────── */
.ask-fab { overflow: visible; }
.ask-fab::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 100px;
  border: 2px solid rgba(26, 58, 138, 0.28);
  animation: fab-ring-expand 2.8s ease-out infinite;
  pointer-events: none;
}
@keyframes fab-ring-expand {
  0%   { transform: scale(1); opacity: 0.65; }
  70%  { transform: scale(1.4); opacity: 0; }
  100% { transform: scale(1.4); opacity: 0; }
}

/* ─── FLOW STEP HOVER LIFT ────────────────────────────────────────── */
.flow-step {
  transition: transform 0.2s cubic-bezier(.2, .7, .3, 1), box-shadow 0.2s;
  cursor: default;
}
.flow-step:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px -8px rgba(20, 21, 26, 0.14);
}

/* ─── SIDEBAR ACTIVE AREA LEFT TICK ─────────────────────────────── */
.sidebar .area.active {
  box-shadow: inset 3px 0 0 0 var(--c-lgl01);
}

/* ─── ANATOMY RIGHT PANE GLASS EDGE ─────────────────────────────── */
.anatomy-right {
  box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.6);
}

/* ─── KANBAN CRITICAL COLUMN NAME COLOR ─────────────────────────── */
.kan-col.crit .kan-col-h .name { color: var(--rose); }

/* ─── RAIL ROW HOVER BACKGROUND FILL ────────────────────────────── */
.rail-row {
  transition: transform 0.14s, background 0.14s;
  border-radius: 6px;
}
.rail-row:hover {
  transform: translateX(4px);
  background: rgba(255, 255, 255, 0.55);
  border-bottom-color: transparent;
}
.rail-row:hover + .rail-row { border-top-color: transparent; }

/* ─── TABLE ROW HOVER LEFT SLIDE ─────────────────────────────────── */
.rec-table .rec-row {
  transition: background 0.12s, transform 0.15s;
}
.rec-table .rec-row:hover { transform: translateX(4px); }

/* ─── CONNECTION CARD HOVER ─────────────────────────────────────── */
.connections-grid > div,
.connections-grid > a {
  transition: transform 0.2s cubic-bezier(.2, .7, .3, 1), box-shadow 0.2s;
}
.connections-grid > div:hover,
.connections-grid > a:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px -12px rgba(20, 21, 26, 0.14);
}

/* ─── GLYPH HOVER RING ───────────────────────────────────────────── */
.glyph {
  transition: box-shadow 0.2s;
}
.task-card:hover .glyph {
  box-shadow: 0 8px 16px -6px rgba(20, 21, 26, 0.3);
}

/* ─── SEND BUTTON HOVER ARROW EFFECT ────────────────────────────── */
.send-btn::after {
  content: '→';
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.2s, transform 0.2s;
  font-size: 11px;
}
.send-btn:hover::after {
  opacity: 1;
  transform: translateX(0);
}

/* ─── PAGE HEADER TITLE HOVER SERIF ITALIC GLOW ─────────────────── */
.page-title em {
  transition: color 0.2s;
}

/* ─── SUMMARY CARD ROI METRIC ACCENT ────────────────────────────── */
.summary-card .roi {
  background: linear-gradient(to right, rgba(58, 110, 74, 0.08), transparent);
}

/* ─── CHIP ACTIVE STATE ──────────────────────────────────────────── */
.chip.on { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12); }

/* ─── MODAL OPEN SHADOW REFINEMENT ──────────────────────────────── */
.modal-backdrop.open .modal {
  box-shadow:
    0 32px 80px -20px rgba(20, 21, 26, 0.32),
    0 0 0 1px rgba(255, 255, 255, 0.08) inset;
}

/* ─── PECA DOC PAPER DEPTH ────────────────────────────────────────── */
.peca-doc {
  box-shadow:
    0 8px 32px -16px rgba(20, 21, 26, 0.1),
    0 0 0 1px rgba(255, 255, 255, 0.6) inset,
    0 1px 0 rgba(255, 255, 255, 0.9) inset;
}

/* ─── INPUT FOCUS RINGS ──────────────────────────────────────────── */
.field-input:focus, .field-select:focus {
  outline: none;
  box-shadow: 0 0 0 3px var(--c-lgl01-soft), 0 0 0 1px var(--c-lgl01);
  border-color: var(--c-lgl01);
}

/* ─── BADGE HOVER MICRO LIFT ─────────────────────────────────────── */
.badge { transition: transform 0.15s; }

/* ─── ALERT ICON ENTRANCE ────────────────────────────────────────── */
@keyframes alert-icon-pop {
  0% { transform: scale(0.8); }
  60% { transform: scale(1.08); }
  100% { transform: scale(1); }
}
.alert-icon {
  animation: alert-icon-pop 0.5s cubic-bezier(.2, .7, .3, 1) 0.15s backwards;
}

/* ══════════════════════════════════════════════════════════════════
   PREMIUM UPGRADES · Phase 3 — audit rows · advogado cards · rules
   ══════════════════════════════════════════════════════════════════ */

/* ─── AUDIT TABLE ─────────────────────────────────────────────────── */
.audit-head {
  display: grid;
  grid-template-columns: 100px 140px 1fr 130px 110px 80px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--rule);
}
.audit-row {
  display: grid;
  grid-template-columns: 100px 140px 1fr 130px 110px 80px;
  padding: 12px 18px;
  align-items: center;
  border-bottom: 1px solid var(--rule);
  font-size: 12px;
  text-decoration: none;
  color: inherit;
  transition: background 0.12s, transform 0.15s;
}
.audit-row:last-child { border-bottom: none; }
.audit-row:hover { background: var(--paper); transform: translateX(4px); }
.audit-row--crit { background: var(--rose-soft); }
.audit-row--crit:hover { background: rgba(201, 63, 44, 0.1); }

/* ─── ADVOGADO CARD ───────────────────────────────────────────────── */
.adv-card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 16px;
  padding: 20px 22px;
  transition: transform 0.2s cubic-bezier(.2,.7,.3,1), box-shadow 0.2s, border-color 0.2s;
  animation: fade-up 0.45s cubic-bezier(.2,.7,.3,1) backwards;
}
.adv-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px -8px rgba(20,21,26,.12);
  border-color: var(--rule-strong);
}
.adv-card:nth-child(1) { animation-delay: 0.18s; }
.adv-card:nth-child(2) { animation-delay: 0.24s; }
.adv-card:nth-child(3) { animation-delay: 0.30s; }
.adv-card:nth-child(4) { animation-delay: 0.36s; }

/* Trust score mini-bar */
.trust-bar-track {
  height: 3px;
  background: var(--rule);
  border-radius: 2px;
  margin-top: 6px;
  overflow: hidden;
}
.trust-bar-fill {
  height: 100%;
  border-radius: 2px;
  transform-origin: left;
  animation: bar-grow 0.9s cubic-bezier(.2,.7,.3,1) 0.55s backwards;
}
.trust-bar-fill.high { background: var(--green); }
.trust-bar-fill.mid  { background: var(--amber); }
.trust-bar-fill.low  { background: var(--rose); }

/* Advogado stats row */
.adv-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  padding-top: 14px;
  border-top: 1px solid var(--rule);
  font-size: 11.5px;
}
.adv-stats .s-lbl { color: var(--ink-mute); }
.adv-stats .s-val {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  margin-top: 2px;
}

/* ─── RULES TABLE (lgl-03) ────────────────────────────────────────── */
.rules-table {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 14px;
  overflow: hidden;
}
.rules-head {
  display: grid;
  grid-template-columns: 1fr 200px 100px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--rule);
}
.rules-row {
  display: grid;
  grid-template-columns: 1fr 200px 100px;
  padding: 14px 18px;
  align-items: center;
  border-bottom: 1px solid var(--rule);
  font-size: 12.5px;
  transition: background 0.12s;
}
.rules-row:last-child { border-bottom: none; }
.rules-row:hover { background: var(--paper); }

/* ─── JANUS METRIC CARDS (lgl-04) ────────────────────────────────── */
.janus-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.janus-card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 14px;
  transition: transform 0.2s cubic-bezier(.2,.7,.3,1), box-shadow 0.2s;
  animation: fade-up 0.45s cubic-bezier(.2,.7,.3,1) backwards;
}
.janus-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px -6px rgba(20,21,26,.1);
}
.janus-card:nth-child(1) { animation-delay: 0.22s; }
.janus-card:nth-child(2) { animation-delay: 0.28s; }
.janus-card:nth-child(3) { animation-delay: 0.34s; }
.janus-card:nth-child(4) { animation-delay: 0.40s; }
.janus-card .card-eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.janus-card .card-body {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.6;
}

/* ─── SETTINGS EMPTY STATE ────────────────────────────────────────── */
.settings-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 52px 24px;
  background: var(--paper);
  border: 1px dashed var(--rule-strong);
  border-radius: 16px;
  text-align: center;
  gap: 8px;
}
.settings-empty .se-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: grid; place-items: center;
  background: var(--card);
  border: 1px solid var(--rule);
  margin-bottom: 6px;
}
.settings-empty .se-title {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.settings-empty .se-sub {
  font-size: 12.5px;
  color: var(--ink-mute);
  max-width: 340px;
  line-height: 1.6;
}
.settings-empty .se-tag {
  margin-top: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 100px;
  background: var(--bg-warm);
  color: var(--ink-mute);
}
