@font-face {
  font-family: "Manrope";
  src: url("fonts/manrope.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #07101c;
  --ink: #062033;
  --text: #f3f7fc;
  --muted: #b7c6da;
  --faint: #93a6bd;
  --line: rgba(186, 214, 255, 0.16);
  --accent: #3ee0ff;
  --wait: #f2b544;
  --sent: #3ee0a0;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
  --surface: #101c2e;
  --surface-2: #122338;
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  hyphens: manual;
  -webkit-hyphens: manual;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  font-family: "Manrope", "Inter", "Segoe UI", system-ui, sans-serif;
  font-weight: 500;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(1000px 480px at 0% -10%, rgba(62, 224, 255, 0.15), transparent 55%),
    radial-gradient(900px 520px at 110% -20%, rgba(96, 126, 255, 0.16), transparent 50%),
    linear-gradient(180deg, #081321 0%, #07101c 42%, #060d16 100%);
  background-attachment: fixed;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

p,
h1,
h2,
h3,
ul {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

[hidden] {
  display: none !important;
}

::selection {
  background: var(--accent);
  color: var(--ink);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.noscript {
  margin: 0;
  padding: 28px 20px;
  font-size: 1.1rem;
  font-weight: 650;
}

.app {
  width: min(1760px, calc(100% - 32px));
  margin: 0 auto;
  padding: 20px 0 32px;
  display: grid;
  gap: 16px;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 48px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.brand-mark {
  height: 36px;
  width: auto;
  display: block;
  flex: none;
  color: #f5f8fc;
  overflow: visible;
}

.brand-mark text {
  fill: currentColor;
  font-family: "Manrope", "Inter", "Segoe UI", system-ui, sans-serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.04em;
  dominant-baseline: central;
}

.brand-copy {
  min-width: 0;
  padding-left: 14px;
  border-left: 1px solid var(--line);
}

.product-name {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.product-date {
  margin-top: 3px;
  min-height: 1.2em;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
}

.top-status {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex: none;
}

.live {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--sent);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.live.is-paused {
  color: var(--wait);
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 0 rgba(62, 224, 160, 0.7);
  animation: livePulse 1.8s ease-out infinite;
}

.live.is-paused .live-dot {
  animation: none;
  box-shadow: none;
}

.clock {
  min-width: 16ch;
  min-height: 1.2em;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  text-align: right;
  line-height: 1;
}

.voice-bar {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(220px, 300px);
  gap: 22px;
  align-items: center;
  min-height: 112px;
  padding: 18px 20px;
  border-radius: 26px;
  background: linear-gradient(180deg, #17324d 0%, #10243a 100%);
  border: 1px solid rgba(62, 224, 255, 0.38);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 20px 50px rgba(0, 0, 0, 0.32),
    0 0 80px rgba(62, 224, 255, 0.06);
}

.voice-bar::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), transparent 32%);
}

.voice-bar.is-hot {
  border-color: rgba(62, 224, 255, 0.85);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 0 0 1px rgba(62, 224, 255, 0.25),
    0 0 60px rgba(62, 224, 255, 0.22);
}

.mic {
  position: relative;
  z-index: 1;
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--accent);
  background: radial-gradient(circle at 50% 38%, #184058, #0a1828 72%);
  box-shadow:
    0 0 0 1px rgba(62, 224, 255, 0.55),
    0 0 0 8px rgba(62, 224, 255, 0.08),
    0 10px 24px rgba(0, 0, 0, 0.35);
}

.mic::before {
  content: "";
  position: absolute;
  inset: -7px;
  border-radius: inherit;
  border: 1px solid rgba(62, 224, 255, 0.45);
  animation: ring 2.8s ease-out infinite;
}

.mic:focus-visible {
  outline-offset: 6px;
}

.voice-copy {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.voice-copy h1 {
  font-size: clamp(1.55rem, 2.1vw, 2.15rem);
  font-weight: 750;
  letter-spacing: -0.035em;
  line-height: 1.12;
  text-wrap: balance;
}

.voice-copy p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.35;
}

.voice-slot {
  position: relative;
  z-index: 1;
  min-height: 72px;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 16px;
  background: rgba(4, 10, 18, 0.42);
  border: 1px solid rgba(186, 214, 255, 0.18);
  color: var(--text);
}

.voice-slot:empty::before {
  content: "";
  width: 9px;
  height: 9px;
  flex: none;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}

.voice-slot:empty::after {
  content: "Standing by";
  font-weight: 750;
  font-size: 0.98rem;
  color: #eaf3fb;
}

.voice-slot.is-mounted,
.voice-slot:not(:empty) {
  display: block;
  background: transparent;
  border-color: transparent;
  padding: 0;
}

.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.kpi {
  display: flex;
  flex-direction: column;
  min-height: 124px;
  padding: 16px 18px 14px;
  border-radius: 20px;
  background: linear-gradient(180deg, #15283f 0%, var(--surface-2) 100%);
  border: 1px solid var(--line);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    var(--shadow);
}

.kpi-label {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.3;
  text-wrap: balance;
}

.kpi-value {
  margin-top: 10px;
  font-size: clamp(1.85rem, 2.5vw, 2.75rem);
  font-weight: 750;
  letter-spacing: -0.045em;
  line-height: 0.95;
  font-variant-numeric: tabular-nums;
}

.kpi-note {
  margin-top: auto;
  padding-top: 12px;
  color: var(--faint);
  font-size: 0.88rem;
  font-weight: 650;
}

.board {
  display: grid;
  gap: 16px;
}

.side {
  display: grid;
  gap: 16px;
}

.panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  padding: 18px 18px 14px;
  border-radius: 22px;
  background: linear-gradient(180deg, #14263b 0%, var(--surface) 100%);
  border: 1px solid var(--line);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    var(--shadow);
}

.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.panel h2 {
  font-size: 1.28rem;
  font-weight: 750;
  letter-spacing: -0.03em;
}

.panel-count {
  color: var(--muted);
  font-size: 0.98rem;
  font-weight: 750;
}

.flash-banner {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  margin: 0;
  padding: 0 18px;
  border-radius: 14px;
  font-size: clamp(1.45rem, 2vw, 2.05rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.15;
  transform: translateY(-6px);
  transition: max-height 0.35s ease, opacity 0.35s ease, transform 0.35s ease, margin 0.35s ease, padding 0.35s ease;
}

.flash-banner.show {
  max-height: 96px;
  opacity: 1;
  margin-bottom: 10px;
  padding: 11px 18px;
  transform: none;
}

.flash-banner[data-kind="Approved"].show {
  background: var(--accent);
  color: var(--ink);
}

.flash-banner[data-kind="Sent"].show {
  background: var(--sent);
  color: var(--ink);
}

.alert-list,
.rule-list,
.activity-list {
  min-height: 0;
}

.alert-list {
  display: grid;
  gap: 10px;
  align-content: start;
  grid-auto-rows: max-content;
}

.alert {
  --state: var(--wait);
  position: relative;
  overflow: hidden;
  padding: 12px 16px 10px;
  border-radius: 18px;
  background: rgba(6, 14, 24, 0.38);
  border: 1px solid rgba(186, 214, 255, 0.12);
  box-shadow: inset 4px 0 0 var(--state);
  transition: border-color 0.35s ease, box-shadow 0.35s ease;
}

.alert[data-status="Waiting"] { --state: var(--wait); }
.alert[data-status="Approved"] { --state: var(--accent); }
.alert[data-status="Sent"] { --state: var(--sent); }

.alert[data-status="Approved"],
.alert[data-status="Sent"] {
  border-color: color-mix(in srgb, var(--state) 48%, transparent);
}

.alert::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--state);
  opacity: 0;
  pointer-events: none;
}

.alert.is-flash::after {
  animation: wash 1.5s ease;
}

.alert-top,
.alert-issue,
.alert-action {
  position: relative;
  z-index: 1;
}

.alert-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.eyebrow {
  color: var(--faint);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.alert-owner {
  margin-top: 2px;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.alert-context {
  margin-top: 3px;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 700;
}

.alert-issue {
  margin-top: 10px;
  font-size: 1.28rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.35;
  text-wrap: balance;
}

.alert-action {
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
}

.action-text {
  margin-top: 4px;
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.35;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  min-width: 112px;
  height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--state);
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.pill.is-pop {
  animation: pillPop 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.rule {
  position: relative;
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 12px 12px;
  border-radius: 14px;
}

.rule + .rule {
  margin-top: 4px;
}

.rule-mark {
  width: 8px;
  height: 8px;
  margin-top: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(62, 224, 255, 0.1);
}

.rule-text {
  font-size: 1.04rem;
  font-weight: 650;
  line-height: 1.4;
  overflow-wrap: break-word;
}

.rule-meta {
  margin-top: 4px;
  color: var(--faint);
  font-size: 0.86rem;
  font-weight: 700;
}

.rule-tag {
  display: none;
  position: absolute;
  top: 12px;
  right: 10px;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rule.is-new {
  animation: ruleIn 3.6s ease;
}

.rule.is-new .rule-copy {
  padding-right: 58px;
}

.rule.is-new .rule-tag {
  display: inline-flex;
}

.panel-rules.is-hot {
  animation: rulePanel 3.6s ease;
}

.activity-item {
  display: grid;
  grid-template-columns: 84px 92px minmax(0, 1fr);
  gap: 10px;
  align-items: baseline;
  padding: 12px 6px;
  border-top: 1px solid rgba(186, 214, 255, 0.1);
}

.activity-item:first-child {
  border-top: 0;
}

.activity-time {
  color: var(--faint);
  font-size: 0.88rem;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.activity-actor {
  color: var(--accent);
  font-weight: 800;
  white-space: nowrap;
}

.activity-text {
  font-weight: 600;
  line-height: 1.4;
  overflow-wrap: break-word;
}

.activity-item.is-new {
  animation: activityIn 0.8s ease;
}

.empty {
  margin: 6px 4px 10px;
  color: var(--muted);
  font-weight: 650;
  line-height: 1.45;
}

#presenter {
  position: fixed;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  width: min(1360px, calc(100% - 28px));
  z-index: 30;
}

.presenter-card {
  padding: 12px 14px 12px;
  border-radius: 18px;
  background: rgba(7, 12, 20, 0.94);
  border: 1px solid rgba(242, 181, 68, 0.5);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.48);
}

.presenter-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.presenter-head strong {
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--wait);
}

#presenter-note,
#presenter-sync,
.presenter-state {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 650;
}

#presenter-sync {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}

.presenter-state {
  min-height: 1.3em;
  margin-top: 4px;
}

.presenter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.presenter-actions button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  background: #14263c;
  border: 1px solid rgba(186, 214, 255, 0.22);
  font-size: 0.92rem;
  font-weight: 750;
}

.presenter-actions button:hover {
  border-color: rgba(62, 224, 255, 0.55);
}

.presenter-actions button:active {
  transform: translateY(1px);
}

.presenter-actions kbd {
  color: var(--faint);
  font-family: inherit;
  font-weight: 800;
}

.presenter-actions button[data-act="reset"] {
  background: transparent;
  color: var(--wait);
  border-color: rgba(242, 181, 68, 0.5);
}

@media (min-width: 900px) {
  .app {
    width: min(1760px, calc(100% - 64px));
  }
}

@media (min-width: 1400px) {
  html {
    font-size: 17.5px;
  }
}

@media (min-width: 1100px) and (min-height: 800px) {
  body {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
  }

  .app {
    height: 100vh;
    height: 100dvh;
    padding-top: 20px;
    padding-bottom: 20px;
    grid-template-rows: auto auto auto minmax(0, 1fr);
  }

  body.presenter-on .app {
    height: calc(100vh - 136px);
    height: calc(100dvh - 136px);
  }

  .board {
    min-height: 0;
    height: 100%;
    grid-template-columns: minmax(0, 1.42fr) minmax(340px, 0.92fr);
  }

  .side {
    min-height: 0;
    height: 100%;
    grid-template-rows: auto minmax(180px, 1fr);
  }

  .panel-alerts,
  .panel-activity {
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }

  .panel-rules {
    height: auto;
    max-height: none;
    overflow: hidden;
  }

  .alert-list,
  .activity-list {
    overflow: auto;
    flex: 1 1 auto;
    min-height: 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(186, 214, 255, 0.28) transparent;
  }

  .rule-list {
    flex: none;
    overflow: auto;
    max-height: 224px;
    scrollbar-width: thin;
    scrollbar-color: rgba(186, 214, 255, 0.28) transparent;
  }
}

@media (max-width: 980px) {
  .voice-bar {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 14px;
    padding: 16px;
  }

  .voice-slot {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .kpi-row {
    grid-template-columns: 1fr 1fr;
  }

  .kpi-label {
    min-height: 2.6em;
  }
}

@media (max-width: 640px) {
  .app {
    width: min(1760px, calc(100% - 28px));
    padding-top: 16px;
  }

  .top {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .top-status {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .clock {
    min-width: 0;
    font-size: 1.05rem;
  }

  .mic {
    width: 60px;
    height: 60px;
  }

  .brand-mark {
    height: 32px;
  }

  .activity-item {
    grid-template-columns: 1fr;
    gap: 2px;
    padding: 12px 2px;
  }

  .activity-time,
  .activity-actor {
    white-space: normal;
  }
}

@media (max-width: 800px) {
  body.presenter-on {
    padding-bottom: 280px;
  }
}

@media (hover: hover) and (pointer: fine) {
  .kpi {
    transition: border-color 0.2s ease, transform 0.2s ease;
  }

  .kpi:hover {
    border-color: rgba(62, 224, 255, 0.42);
    transform: translateY(-1px);
  }
}

@keyframes livePulse {
  0% { box-shadow: 0 0 0 0 rgba(62, 224, 160, 0.55); }
  100% { box-shadow: 0 0 0 8px rgba(62, 224, 160, 0); }
}

@keyframes ring {
  0% { transform: scale(1); opacity: 0.55; }
  100% { transform: scale(1.28); opacity: 0; }
}

@keyframes wash {
  0% { opacity: 0; }
  22% { opacity: 0.24; }
  100% { opacity: 0; }
}

@keyframes pillPop {
  0% { transform: scale(0.9); }
  42% { transform: scale(1.16); }
  100% { transform: scale(1); }
}

@keyframes ruleIn {
  0% {
    background: rgba(62, 224, 255, 0.28);
    box-shadow: inset 3px 0 0 var(--accent);
  }
  65% {
    background: rgba(62, 224, 255, 0.12);
    box-shadow: inset 3px 0 0 var(--accent);
  }
  100% {
    background: transparent;
    box-shadow: inset 3px 0 0 transparent;
  }
}

@keyframes rulePanel {
  0% {
    border-color: rgba(62, 224, 255, 0.85);
    box-shadow: 0 0 36px rgba(62, 224, 255, 0.22), var(--shadow);
  }
  100% {
    border-color: var(--line);
    box-shadow: var(--shadow);
  }
}

@keyframes activityIn {
  0% {
    background: rgba(62, 224, 255, 0.16);
    transform: translateY(-6px);
  }
  100% {
    background: transparent;
    transform: none;
  }
}

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

/* Integration sizing for the current stacked NewRev mark. */
.brand-mark { width:64px; height:64px; object-fit:contain; flex:0 0 64px; }
.kpi-value { font-size:clamp(24px,2.6vw,44px); overflow-wrap:anywhere; }
.voice-slot script { display:none; }
@media(max-width:640px){ .brand-mark{width:52px;height:52px;flex-basis:52px;} .kpi-value{font-size:26px;} }

/* Internal task routing is never an email sent state. */
.pill[data-status="Routed to Robert"] { color:var(--teal); background:rgba(34,211,238,.1); border-color:rgba(34,211,238,.25); }
