:root {
  color-scheme: light;
  --page: #f2f8fe;
  --surface: #fff;
  --ink: #091b34;
  --muted: #49617a;
  --subtle: #536b83;
  --line: #d6e5f2;
  --accent: #075985;
  --sky: #85d9ff;
  --sky-light: #e8f6ff;
  --nav-muted: #b8cce3;
  --display: "Manrope", "DM Sans", sans-serif;
  --body: "DM Sans", sans-serif;
  --shadow: 0 2px 5px #153f6810;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--page); font: 400 14px/1.5 var(--body); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid #2587b9; outline-offset: 3px; }
[hidden] { display: none !important; }
.icon-library { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.skip-link { position: fixed; z-index: 3; top: 8px; left: 8px; padding: 10px 14px; background: var(--surface); border-radius: 8px; transform: translateY(-150%); }
.skip-link:focus { transform: none; }

.workspace { display: grid; grid-template-columns: 226px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; align-self: start; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; padding: 24px 16px 20px; background: var(--ink); color: var(--surface); }
.brand { display: flex; align-items: center; gap: 11px; width: fit-content; margin-inline: 7px; }
.brand-mark { width: 40px; height: 40px; display: block; }
.brand strong { display: block; font: 800 18px/1.25 var(--display); letter-spacing: -.045em; }
.brand small { display: block; margin-top: 4px; color: var(--nav-muted); font-size: 9px; font-weight: 700; letter-spacing: .105em; }
.sidebar-nav { display: grid; gap: 4px; margin-top: 51px; }
.nav-label { margin: 0 11px 7px; color: var(--nav-muted); font-size: 10px; font-weight: 700; letter-spacing: .105em; }
.sidebar-nav a, .back-link { display: flex; align-items: center; gap: 11px; min-height: 43px; padding: 8px 11px; border-radius: 8px; color: var(--nav-muted); font-weight: 600; transition: color .16s, background-color .16s; }
.sidebar-nav a .icon, .back-link .icon { width: 17px; height: 17px; }
.sidebar-nav a:hover, .back-link:hover { background: #193653; color: var(--surface); }
.sidebar-nav a[aria-current] { background: #214461; color: var(--sky); font-weight: 700; }
.back-link { margin-top: auto; }

.main-column { min-width: 0; }
.topbar { min-height: 68px; display: flex; background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar-inner, .content { width: min(100%, 1352px); margin-inline: auto; padding-inline: clamp(24px, 3vw, 44px); }
.topbar-inner, .breadcrumb { display: flex; align-items: center; }
.topbar-inner { justify-content: space-between; gap: 12px; }
.breadcrumb { gap: 9px; color: var(--muted); font-size: 13px; }
.breadcrumb .icon { width: 14px; height: 14px; color: var(--subtle); }
.breadcrumb strong { color: var(--ink); font-weight: 700; }
.suite-badge, .period, .count, .reply-badge { display: inline-flex; align-items: center; justify-content: center; gap: 7px; width: fit-content; white-space: nowrap; }
.suite-badge { padding: 5px 11px; border: 1px solid var(--line); border-radius: 999px; background: var(--sky-light); color: var(--accent); font-size: 12px; font-weight: 700; }
.suite-badge .icon { width: 15px; height: 15px; }
.content { padding-top: 33px; padding-bottom: 30px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; }
.eyebrow { display: flex; align-items: center; gap: 8px; margin: 0 0 9px; color: var(--accent); font-size: 10px; font-weight: 700; letter-spacing: .145em; }
.eyebrow > span { width: 7px; height: 7px; flex: none; border-radius: 50%; background: #2379ac; box-shadow: 0 0 0 3px #dcefff; }
h1, h2, h3 { font-family: var(--display); }
h1 { margin: 0; font-size: clamp(30px, 3.4vw, 47px); font-weight: 800; line-height: 1.12; letter-spacing: -.055em; }
.section-copy { margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.period { min-height: 35px; margin-bottom: 1px; padding: 6px 10px; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; font-size: 12px; font-weight: 600; box-shadow: var(--shadow); }
.period .icon { width: 15px; height: 15px; }

.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 22px 0 0; }
.metric { min-width: 0; padding: 16px 17px 15px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); box-shadow: var(--shadow); }
.metric-icon { display: grid; place-items: center; width: 34px; height: 34px; margin-bottom: 11px; border-radius: 9px; background: var(--sky-light); color: var(--accent); }
.metric-icon .icon { width: 18px; height: 18px; }
.metric dt { color: var(--muted); font-size: 13px; font-weight: 700; }
.metric dd { margin: 1px 0 0; font: 800 clamp(28px, 2.65vw, 38px)/1.15 var(--display); letter-spacing: -.055em; font-variant-numeric: tabular-nums; }
.metric-unit { color: var(--muted); font-size: 15px; font-weight: 700; letter-spacing: -.02em; }
.metric-note { display: block; margin-top: 5px; color: var(--subtle); font: 400 12px/1.4 var(--body); letter-spacing: 0; }

.conversations { margin-top: 31px; scroll-margin-top: 24px; }
.conversation-heading { margin-bottom: 15px; }
h2 { margin: 0; font-size: 25px; line-height: 1.2; font-weight: 800; letter-spacing: -.045em; }
.conversation-heading .section-copy { margin-top: 5px; }
.count { padding: 4px 9px; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 7px; font-size: 11px; font-weight: 700; }
.inbox { display: grid; grid-template-columns: minmax(238px, 29%) minmax(0, 1fr); border: 1px solid var(--line); border-radius: 15px; background: var(--surface); box-shadow: var(--shadow); }
.inbox-list { min-width: 0; border-right: 1px solid var(--line); }
.inbox-heading { display: flex; align-items: center; gap: 9px; min-height: 64px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.inbox-heading .icon { width: 16px; height: 16px; color: var(--accent); }
h3 { margin: 0; font-size: 14px; font-weight: 800; line-height: 1.3; }
.inbox-list ul { display: grid; gap: 3px; margin: 0; padding: 8px; list-style: none; }
.conversation { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 9px; width: 100%; min-height: 64px; padding: 8px; text-align: left; border: 1px solid transparent; border-radius: 9px; background: transparent; cursor: pointer; transition: background-color .16s, border-color .16s; }
.conversation:hover { background: var(--page); }
.conversation[aria-pressed="true"] { border-color: #bedff5; background: var(--sky-light); }
.avatar { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 50%; font: 800 11px/1 var(--display); }
.avatar-sky { background: #c6eaff; color: #154c72; }
.avatar-steel { background: #e2ebf8; color: #34567b; }
.avatar-navy { background: #dce5f4; color: #263b60; }
.conversation-text { display: grid; gap: 3px; min-width: 0; }
.conversation-text strong { font-size: 13px; }
.conversation-text > span { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.conversation-chevron { width: 14px; height: 14px; color: var(--subtle); }
.conversation[aria-pressed="true"] .conversation-chevron { color: var(--accent); }

.thread { display: grid; grid-template-rows: auto 1fr auto; min-width: 0; }
.thread-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 64px; padding: 10px 18px; border-bottom: 1px solid var(--line); }
.thread-contact { display: flex; align-items: center; gap: 9px; }
.thread-contact p { margin: 3px 0 0; color: var(--subtle); font-size: 11px; line-height: 1.2; }
.reply-badge { padding: 4px 8px; color: var(--accent); background: var(--sky-light); border: 1px solid var(--line); border-radius: 999px; font-size: 11px; font-weight: 700; }
.reply-badge .icon { width: 13px; height: 13px; stroke-width: 2.2; }
.messages { display: flex; flex-direction: column; gap: 15px; min-height: 231px; padding: 14px 20px 17px; background-color: #f8fbff; background-image: radial-gradient(#dceaf6 1px, transparent 1px); background-size: 15px 15px; }
.thread-divider { align-self: center; padding: 1px 7px; background: #f8fbff; color: var(--subtle); font-size: 10px; font-weight: 600; letter-spacing: .025em; }
.message { min-width: 0; width: fit-content; max-width: 85%; }
.message-meta, .message-meta strong { display: flex; align-items: center; gap: 7px; }
.message-meta { margin: 0 0 5px; color: var(--subtle); font-size: 11px; }
.message-meta strong { color: var(--ink); font-weight: 700; }
.message-meta .icon { width: 14px; height: 14px; }
.bubble { margin: 0; padding: 9px 12px; border: 1px solid var(--line); border-radius: 3px 11px 11px; background: var(--surface); font-size: 13px; line-height: 1.55; overflow-wrap: anywhere; }
.bot-message { align-self: end; max-width: min(85%, 422px); }
.bot-message .message-meta { justify-content: end; }
.bot-message strong { color: var(--accent); }
.bot-message .bubble { border-color: #bedff5; border-radius: 11px 3px 11px 11px; background: var(--sky-light); color: var(--ink); }
.typing { display: flex; align-items: center; gap: 8px; }
.typing-dots { display: flex; gap: 3px; }
.typing-dots i { width: 4px; height: 4px; border-radius: 50%; background: var(--accent); animation: bounce .9s ease-in-out infinite alternate; }
.typing-dots i:nth-child(2) { animation-delay: .16s; }
.typing-dots i:nth-child(3) { animation-delay: .32s; }
@keyframes bounce { 0%, 35% { transform: translateY(0); opacity: .55; } 100% { transform: translateY(-3px); opacity: 1; } }
.thread-footer { display: flex; align-items: center; justify-content: space-between; gap: 6px 12px; min-height: 54px; padding: 7px 17px; border-top: 1px solid var(--line); }
.reply-timing, .replay-button, .data-note { display: flex; align-items: center; gap: 6px; }
.reply-timing { color: var(--accent); font-size: 11px; font-weight: 700; }
.reply-timing .icon, .replay-button .icon, .data-note .icon { width: 14px; height: 14px; }
.replay-button { min-height: 34px; padding: 4px 7px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--accent); cursor: pointer; font-size: 12px; font-weight: 700; white-space: nowrap; transition: background-color .16s; }
.replay-button:hover:not([aria-disabled="true"]) { background: var(--sky-light); }
.replay-button[aria-disabled="true"] { color: var(--subtle); cursor: wait; }
.data-note { margin: 13px 0 0; color: var(--subtle); font-size: 11px; }

@media (max-width: 1050px) {
  .workspace { grid-template-columns: 188px minmax(0, 1fr); }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 790px) {
  .workspace { display: block; }
  .sidebar { position: static; min-height: auto; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 13px 8px; padding: 13px 20px 9px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { margin: 0; }
  .sidebar-nav { grid-column: 1 / -1; grid-row: 2; display: flex; gap: 5px; margin: 0; }
  .sidebar-nav a { min-height: 38px; }
  .nav-label { display: none; }
  .back-link { margin: 0; justify-self: end; font-size: 12px; }
  .topbar { min-height: 45px; }
  .topbar-inner, .content { padding-inline: 20px; }
  .content { padding-top: 23px; }
}

@media (max-width: 575px) {
  .section-heading { align-items: start; flex-wrap: wrap; gap: 9px; }
  .metrics { gap: 9px; margin-top: 14px; }
  .metric { padding: 11px; }
  .metric-note { font-size: 11px; }
  .inbox { grid-template-columns: minmax(0, 1fr); }
  .inbox-list { border-right: 0; border-bottom: 1px solid var(--line); }
  .inbox-heading { min-height: 43px; padding: 8px 12px; }
  .inbox-list ul { padding: 5px 7px; }
  .conversation { min-height: 51px; padding: 4px 8px; }
  .thread-heading, .thread-footer { padding-inline: 11px; }
  .messages { padding-inline: 12px; }
  .message, .bot-message { max-width: 94%; }
  .thread-footer { flex-wrap: wrap; }
}

@media (max-width: 360px) {
  .breadcrumb > span, .breadcrumb > .icon { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
