:root {
  color-scheme: light;
  --paper: #f4f0e8;
  --paper-deep: #eae4d8;
  --card: #fffdf8;
  --ink: #1c201d;
  --ink-soft: #565c56;
  --line: #d9d3c8;
  --lime: #d7ff64;
  --lime-deep: #b9e53f;
  --coral: #ff795f;
  --sky: #98d9ff;
  --lavender: #c7b9ff;
  --yellow: #ffd65c;
  --green: #54ad74;
  --red: #b84332;
  --shadow: 0 18px 55px rgb(40 42 35 / 8%);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  font-family:
    Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-width: 320px;
  background: var(--paper);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 10%, rgb(215 255 100 / 14%), transparent 26rem),
    var(--paper);
  -webkit-font-smoothing: antialiased;
}

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

button,
select {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgb(28 32 29 / 28%);
  outline-offset: 3px;
}

button:disabled {
  cursor: wait;
  opacity: 0.6;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  letter-spacing: -0.045em;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 3.75rem);
  font-weight: 650;
  line-height: 0.98;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.25rem, 2vw, 1.7rem);
  font-weight: 650;
  line-height: 1.05;
}

h3 {
  font-size: 1rem;
  line-height: 1.25;
}

.grain {
  position: fixed;
  z-index: 20;
  inset: 0;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.7'/%3E%3C/svg%3E");
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.eyebrow,
.kicker {
  margin-bottom: 0.5rem;
  color: var(--ink-soft);
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.15em;
  line-height: 1.2;
  text-transform: uppercase;
}

.muted {
  color: var(--ink-soft);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.05rem;
  font-weight: 720;
  letter-spacing: -0.035em;
}

.brand--large {
  font-size: 1.2rem;
}

.brand-mark {
  display: grid;
  width: 2.25rem;
  height: 2.25rem;
  place-items: center;
  border-radius: 11px;
  color: var(--lime);
  background: var(--ink);
  font-size: 0.83rem;
  font-weight: 800;
  letter-spacing: -0.08em;
  transform: rotate(-3deg);
}

.login-view {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(0, 1.15fr) minmax(390px, 0.85fr);
}

.login-intro {
  position: relative;
  display: flex;
  min-height: 100vh;
  padding: clamp(2rem, 5vw, 5rem);
  overflow: hidden;
  flex-direction: column;
  justify-content: space-between;
  background: var(--lime);
}

.login-intro::after {
  position: absolute;
  width: 28rem;
  height: 28rem;
  border: 1px solid rgb(28 32 29 / 14%);
  border-radius: 50%;
  content: "";
  right: -10rem;
  top: -12rem;
  box-shadow:
    0 0 0 5rem rgb(28 32 29 / 2%),
    0 0 0 10rem rgb(28 32 29 / 2%);
}

.login-copy {
  position: relative;
  z-index: 1;
  max-width: 46rem;
  margin: auto 0;
}

.login-copy h1 {
  max-width: 9ch;
  font-size: clamp(4.5rem, 9vw, 9.5rem);
  line-height: 0.82;
}

.login-copy > p:last-child {
  max-width: 36rem;
  margin: 2rem 0 0;
  font-size: clamp(1.05rem, 1.8vw, 1.45rem);
  line-height: 1.5;
}

.login-signal {
  display: flex;
  height: 4.5rem;
  align-items: center;
  gap: clamp(0.35rem, 1vw, 0.8rem);
}

.login-signal span {
  display: block;
  width: clamp(0.35rem, 0.6vw, 0.65rem);
  height: 35%;
  border-radius: 999px;
  background: var(--ink);
}

.login-signal span:nth-child(2),
.login-signal span:nth-child(11) {
  height: 70%;
}

.login-signal span:nth-child(3),
.login-signal span:nth-child(9) {
  height: 100%;
}

.login-signal span:nth-child(4),
.login-signal span:nth-child(8) {
  height: 48%;
}

.login-signal span:nth-child(5),
.login-signal span:nth-child(7) {
  height: 82%;
}

.login-panel {
  display: grid;
  min-height: 100vh;
  padding: clamp(2rem, 6vw, 7rem);
  place-items: center;
  background: var(--paper);
}

.login-card {
  width: min(100%, 30rem);
}

.login-card h2 {
  margin-bottom: 0.7rem;
  font-size: clamp(2.4rem, 5vw, 4.5rem);
}

.login-card > .muted {
  margin-bottom: 2.5rem;
  font-size: 1.02rem;
}

.login-card label,
.form-grid label {
  display: grid;
  gap: 0.55rem;
  font-size: 0.78rem;
  font-weight: 700;
}

.password-field {
  position: relative;
}

input,
select {
  width: 100%;
  height: 3.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  outline: none;
  background: var(--card);
  padding: 0 1rem;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

input:focus,
select:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgb(28 32 29 / 8%);
}

.password-field input {
  height: 3.75rem;
  padding-right: 4.5rem;
}

.text-button {
  position: absolute;
  right: 0.8rem;
  top: 50%;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font-size: 0.77rem;
  font-weight: 750;
  transform: translateY(-50%);
}

.form-error {
  min-height: 1.3rem;
  margin: 0.6rem 0;
  color: var(--red);
  font-size: 0.8rem;
}

.primary-button,
.secondary-button,
.upload-button {
  display: inline-flex;
  min-height: 3rem;
  border: 1px solid var(--ink);
  border-radius: var(--radius-sm);
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  padding: 0.75rem 1.05rem;
  font-size: 0.82rem;
  font-weight: 750;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.primary-button {
  color: var(--paper);
  background: var(--ink);
}

.primary-button:hover,
.upload-button:hover {
  box-shadow: 4px 4px 0 var(--coral);
  transform: translate(-2px, -2px);
}

.primary-button--wide {
  width: 100%;
  min-height: 3.8rem;
  justify-content: space-between;
  padding-inline: 1.25rem;
}

.secondary-button {
  border-color: var(--line);
  background: transparent;
}

.secondary-button:hover {
  border-color: var(--ink);
  background: var(--card);
}

.privacy-note {
  margin: 1.2rem 0 0;
  color: var(--ink-soft);
  font-size: 0.72rem;
  text-align: center;
}

.privacy-note span {
  color: var(--green);
}

.app-view {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  z-index: 10;
  display: flex;
  width: 15.5rem;
  height: 100vh;
  padding: 1.7rem 1.25rem 1.35rem;
  border-right: 1px solid var(--line);
  flex-direction: column;
  background: rgb(244 240 232 / 94%);
  backdrop-filter: blur(18px);
}

.sidebar .brand {
  padding: 0 0.65rem;
}

.main-nav {
  display: grid;
  gap: 0.3rem;
  margin-top: 3.5rem;
}

.nav-item {
  display: flex;
  width: 100%;
  min-height: 2.85rem;
  border: 0;
  border-radius: 11px;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  color: var(--ink-soft);
  background: transparent;
  font-size: 0.83rem;
  font-weight: 650;
  text-align: left;
}

.nav-item:hover {
  color: var(--ink);
  background: rgb(28 32 29 / 5%);
}

.nav-item.is-active {
  color: var(--ink);
  background: var(--card);
  box-shadow: 0 5px 18px rgb(40 42 35 / 6%);
}

.nav-icon {
  display: grid;
  width: 1.5rem;
  height: 1.5rem;
  place-items: center;
  border: 1px solid currentcolor;
  border-radius: 7px;
  font-size: 0.75rem;
}

.nav-count {
  min-width: 1.25rem;
  margin-left: auto;
  border-radius: 99px;
  background: var(--coral);
  padding: 0.12rem 0.4rem;
  color: var(--ink);
  font-size: 0.62rem;
  text-align: center;
}

.sidebar-bottom {
  display: grid;
  gap: 0.6rem;
  margin-top: auto;
}

.system-pill {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.65rem 0.75rem;
  color: var(--ink-soft);
  font-size: 0.7rem;
}

.status-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 0 4px rgb(255 214 92 / 18%);
}

.system-pill.is-ready .status-dot {
  background: var(--green);
  box-shadow: 0 0 0 4px rgb(84 173 116 / 15%);
}

.system-pill.has-warning .status-dot {
  background: var(--coral);
  box-shadow: 0 0 0 4px rgb(255 121 95 / 15%);
}

.upload-button {
  width: 100%;
  color: var(--ink);
  background: var(--lime);
}

.nav-item--quiet {
  margin-top: 0.35rem;
}

.workspace {
  min-height: 100vh;
  margin-left: 15.5rem;
  padding: 2rem clamp(1.5rem, 4vw, 4.5rem) 5rem;
}

.topbar {
  display: flex;
  max-width: 96rem;
  margin: 0 auto 2.5rem;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
}

.topbar h1 {
  font-size: clamp(2.2rem, 4.5vw, 4.6rem);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.range-switch {
  display: flex;
  padding: 0.27rem;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgb(255 253 248 / 55%);
}

.range-switch button {
  min-width: 3.35rem;
  border: 0;
  border-radius: 9px;
  padding: 0.58rem 0.7rem;
  color: var(--ink-soft);
  background: transparent;
  font-size: 0.7rem;
  font-weight: 750;
}

.range-switch button.is-active {
  color: var(--ink);
  background: var(--lime);
  box-shadow: 0 3px 10px rgb(40 42 35 / 7%);
}

.icon-button {
  display: grid;
  width: 2.7rem;
  height: 2.7rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  place-items: center;
  background: var(--card);
  font-size: 1.15rem;
}

.icon-button:hover {
  border-color: var(--ink);
}

.mobile-only {
  display: none;
}

.setup-banner {
  max-width: 96rem;
  margin: -0.75rem auto 1.5rem;
  border: 1px solid rgb(207 80 60 / 25%);
  border-radius: var(--radius-md);
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.1rem 1rem 1.25rem;
  background: rgb(255 121 95 / 13%);
}

.setup-banner:not([hidden]) {
  display: flex;
}

.setup-banner p:last-child {
  margin: 0.25rem 0 0;
  color: var(--ink-soft);
  font-size: 0.8rem;
}

.page {
  display: none;
  max-width: 96rem;
  margin: 0 auto;
  animation: page-in 220ms ease both;
}

.page.is-active {
  display: block;
}

@keyframes page-in {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
  margin-bottom: 0.85rem;
}

.metric-card,
.panel {
  border: 1px solid var(--line);
  background: rgb(255 253 248 / 86%);
  box-shadow: 0 1px 0 rgb(255 255 255 / 60%) inset;
}

.metric-card {
  position: relative;
  min-height: 10.5rem;
  border-radius: var(--radius-md);
  overflow: hidden;
  padding: 1.2rem;
}

.metric-card::after {
  position: absolute;
  width: 5.5rem;
  height: 5.5rem;
  border-radius: 50%;
  content: "";
  right: -2.6rem;
  top: -2.6rem;
  background: var(--accent, var(--lime));
  opacity: 0.75;
}

.metric-card:nth-child(2) {
  --accent: var(--sky);
}

.metric-card:nth-child(3) {
  --accent: var(--lavender);
}

.metric-card:nth-child(4) {
  --accent: var(--coral);
}

.metric-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--ink-soft);
  font-size: 0.73rem;
  font-weight: 650;
}

.metric-value {
  margin: 1.4rem 0 0.45rem;
  font-size: clamp(2.4rem, 4vw, 4rem);
  font-weight: 630;
  letter-spacing: -0.07em;
  line-height: 0.8;
}

.metric-note {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.72rem;
}

.panel {
  border-radius: var(--radius-lg);
  padding: clamp(1.2rem, 2.2vw, 2rem);
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(17rem, 0.65fr);
  gap: 0.85rem;
  margin-bottom: 0.85rem;
}

.trend-panel,
.tone-panel {
  min-height: 25rem;
}

.legend {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--ink-soft);
  font-size: 0.65rem;
}

.legend span {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 3px;
  background: var(--ink);
}

.trend-chart {
  display: flex;
  height: 18rem;
  margin-top: 1.5rem;
  align-items: flex-end;
  gap: clamp(0.35rem, 1vw, 0.9rem);
}

.trend-column {
  display: flex;
  height: 100%;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.45rem;
  text-align: center;
}

.trend-value {
  color: var(--ink-soft);
  font-size: 0.62rem;
  font-variant-numeric: tabular-nums;
}

.trend-bar-track {
  display: flex;
  height: 14rem;
  border-radius: 8px;
  align-items: flex-end;
  justify-content: center;
  background: repeating-linear-gradient(
    to bottom,
    transparent,
    transparent 27%,
    rgb(28 32 29 / 5%) 27.5%,
    transparent 28%
  );
}

.trend-bar {
  width: min(72%, 2.7rem);
  min-height: 0.35rem;
  border-radius: 8px 8px 3px 3px;
  background: var(--ink);
  transform-origin: bottom;
  animation: bar-up 500ms cubic-bezier(0.2, 0.75, 0.25, 1) both;
}

@keyframes bar-up {
  from {
    transform: scaleY(0);
  }
}

.trend-label {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 0.62rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tone-chart {
  display: grid;
  gap: 0.9rem;
  margin-top: 2rem;
}

.tone-row {
  display: grid;
  grid-template-columns: 5.5rem minmax(3rem, 1fr) 1.8rem;
  align-items: center;
  gap: 0.6rem;
}

.tone-name,
.tone-count {
  font-size: 0.7rem;
}

.tone-count {
  color: var(--ink-soft);
  text-align: right;
}

.tone-track {
  height: 0.65rem;
  overflow: hidden;
  border-radius: 99px;
  background: var(--paper-deep);
}

.tone-fill {
  height: 100%;
  min-width: 0.25rem;
  border-radius: inherit;
  background: var(--tone-color, var(--lavender));
}

.tone-fill--calm,
.tone-fill--neutral,
.tone-fill--satisfied {
  background: var(--green);
}

.tone-fill--confused {
  background: var(--sky);
}

.tone-fill--frustrated,
.tone-fill--angry {
  background: var(--coral);
}

.tone-fill--anxious {
  background: var(--yellow);
}

.hsize-0 { height: 2%; }
.hsize-1 { height: 10%; }
.hsize-2 { height: 20%; }
.hsize-3 { height: 30%; }
.hsize-4 { height: 40%; }
.hsize-5 { height: 50%; }
.hsize-6 { height: 60%; }
.hsize-7 { height: 70%; }
.hsize-8 { height: 80%; }
.hsize-9 { height: 90%; }
.hsize-10 { height: 100%; }
.wsize-0 { width: 2%; }
.wsize-1 { width: 10%; }
.wsize-2 { width: 20%; }
.wsize-3 { width: 30%; }
.wsize-4 { width: 40%; }
.wsize-5 { width: 50%; }
.wsize-6 { width: 60%; }
.wsize-7 { width: 70%; }
.wsize-8 { width: 80%; }
.wsize-9 { width: 90%; }
.wsize-10 { width: 100%; }

.insight-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(18rem, 0.8fr);
  gap: 0.85rem;
  margin-bottom: 0.85rem;
}

.questions-panel,
.rare-panel {
  min-height: 27rem;
}

.text-link {
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 700;
}

.text-link:hover {
  color: var(--ink);
}

.question-list,
.rare-list {
  display: grid;
  gap: 0.95rem;
  margin-top: 1.75rem;
}

.question-row {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr) 3rem;
  align-items: center;
  gap: 0.8rem;
}

.question-rank {
  color: var(--ink-soft);
  font-size: 0.68rem;
  font-variant-numeric: tabular-nums;
}

.question-copy {
  min-width: 0;
}

.question-copy strong {
  display: block;
  overflow: hidden;
  margin-bottom: 0.4rem;
  font-size: 0.78rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.question-track {
  height: 0.32rem;
  overflow: hidden;
  border-radius: 99px;
  background: var(--paper-deep);
}

.question-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--coral);
}

.question-percent {
  font-size: 0.68rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.rare-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 0.75rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--line);
}

.rare-item:last-child {
  border-bottom: 0;
}

.rare-dot {
  width: 0.6rem;
  height: 0.6rem;
  margin-top: 0.25rem;
  border-radius: 50%;
  background: var(--sky);
}

.rare-item:nth-child(even) .rare-dot {
  background: var(--yellow);
}

.rare-item strong {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.78rem;
  line-height: 1.35;
}

.rare-item span:last-child {
  color: var(--ink-soft);
  font-size: 0.65rem;
}

.recent-panel {
  min-height: 20rem;
}

.call-list {
  display: grid;
  margin-top: 1.2rem;
}

.call-list-item {
  display: grid;
  width: 100%;
  min-height: 4.7rem;
  border: 0;
  border-top: 1px solid var(--line);
  grid-template-columns: minmax(10rem, 1.1fr) minmax(12rem, 1.5fr) 7rem 6rem 1.5rem;
  align-items: center;
  gap: 1rem;
  padding: 0.8rem 0;
  background: transparent;
  text-align: left;
}

.call-list-item:hover .call-arrow {
  transform: translateX(4px);
}

.call-person {
  min-width: 0;
}

.call-person strong,
.call-summary {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.call-person strong {
  margin-bottom: 0.25rem;
  font-size: 0.8rem;
}

.call-person span,
.call-summary,
.call-time {
  color: var(--ink-soft);
  font-size: 0.68rem;
}

.call-time {
  font-variant-numeric: tabular-nums;
}

.call-arrow {
  transition: transform 150ms ease;
}

.status-badge,
.tone-badge,
.language-badge {
  display: inline-flex;
  width: fit-content;
  border-radius: 99px;
  align-items: center;
  padding: 0.28rem 0.55rem;
  font-size: 0.61rem;
  font-weight: 720;
  line-height: 1;
}

.status-badge--complete {
  background: rgb(84 173 116 / 15%);
  color: #28683e;
}

.status-badge--processing {
  background: rgb(152 217 255 / 28%);
  color: #1b607f;
}

.status-badge--failed {
  background: rgb(255 121 95 / 18%);
  color: #943725;
}

.empty-state,
.loading-state {
  display: grid;
  min-height: 12rem;
  place-items: center;
  color: var(--ink-soft);
  font-size: 0.78rem;
  text-align: center;
}

.empty-state strong {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--ink);
  font-size: 1rem;
}

.section-intro {
  display: flex;
  margin-bottom: 2rem;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
}

.section-intro h2 {
  font-size: clamp(2.8rem, 5vw, 5rem);
}

.section-intro .muted {
  margin: 0.7rem 0 0;
}

.filter-row {
  display: flex;
  margin-bottom: 0.85rem;
  gap: 0.7rem;
}

.search-field {
  position: relative;
  display: flex;
  max-width: 28rem;
  flex: 1;
  align-items: center;
}

.search-field > span:first-child {
  position: absolute;
  left: 1rem;
}

.search-field input {
  padding-left: 2.5rem;
}

.select-field {
  width: 11rem;
}

.table-panel {
  padding-block: 0.6rem;
}

.call-table-row {
  display: grid;
  width: 100%;
  min-height: 5.2rem;
  border: 0;
  border-bottom: 1px solid var(--line);
  grid-template-columns: minmax(10rem, 1.2fr) 8rem minmax(12rem, 1.5fr) 7rem 2rem;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 0.3rem;
  background: transparent;
  text-align: left;
}

.call-table-row:last-child {
  border-bottom: 0;
}

.call-table-row:hover {
  background: rgb(215 255 100 / 8%);
}

.call-table-meta {
  color: var(--ink-soft);
  font-size: 0.68rem;
}

.call-table-summary {
  display: -webkit-box;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 0.7rem;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.questions-workbench {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.question-workbench-list {
  display: grid;
  margin-top: 1.4rem;
}

.section-actions,
.device-setup-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

.device-setup-panel {
  margin-bottom: 0.85rem;
  background:
    linear-gradient(105deg, rgb(215 255 100 / 36%), transparent 62%),
    rgb(255 253 248 / 86%);
}

.device-setup-panel .panel-heading {
  align-items: flex-start;
}

.device-setup-panel .panel-heading h2 {
  max-width: 38rem;
}

.device-enrollment-mark,
.device-icon {
  display: grid;
  width: 3rem;
  height: 3rem;
  border: 1px solid var(--ink);
  border-radius: 12px;
  place-items: center;
  color: var(--ink);
  background: var(--lime);
  font-size: 1.1rem;
}

.device-enrollment-mark {
  font-size: 0.62rem;
  font-weight: 850;
  letter-spacing: 0.08em;
}

.device-setup-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.device-setup-steps article {
  display: flex;
  min-height: 7.5rem;
  border: 1px solid rgb(31 36 31 / 10%);
  border-radius: var(--radius-md);
  gap: 0.75rem;
  padding: 1rem;
  background: rgb(255 253 248 / 72%);
}

.device-setup-steps article > span {
  display: grid;
  flex: 0 0 auto;
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 50%;
  place-items: center;
  color: var(--paper);
  background: var(--ink);
  font-size: 0.68rem;
  font-weight: 780;
}

.device-setup-steps strong {
  display: block;
  font-size: 0.8rem;
  line-height: 1.35;
}

.device-setup-steps small {
  display: block;
  margin-bottom: 0.24rem;
  color: var(--ink-soft);
  font-size: 0.55rem;
  font-weight: 780;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.device-setup-steps p,
.device-handoff-note {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.7rem;
  line-height: 1.5;
}

.device-setup-steps p {
  margin-top: 0.35rem;
}

.device-setup-actions {
  margin-top: 1rem;
}

.device-setup-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.68;
  transform: none;
  box-shadow: none;
}

.android-qr-dialog {
  width: min(92vw, 30rem);
}

.android-qr-card > .muted {
  margin-bottom: 1rem;
}

.android-qr-image {
  display: grid;
  width: min(100%, 20rem);
  margin-inline: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  place-items: center;
  overflow: hidden;
  background: #fff;
  padding: 1rem;
}

.android-qr-image img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
}

.android-download-url {
  margin: 0.9rem 0 0;
  overflow-wrap: anywhere;
  color: var(--ink-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.67rem;
  line-height: 1.5;
  text-align: center;
}

.device-handoff-note {
  max-width: 52rem;
  margin-top: 0.8rem;
  color: var(--ink);
  opacity: 0.72;
}

.android-setup-nudge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 1.2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.9rem;
  color: var(--ink-soft);
  background: rgb(255 253 248 / 62%);
  font-size: 0.72rem;
  line-height: 1.45;
}

.android-setup-nudge strong {
  color: var(--ink);
}

.device-list-panel {
  min-height: 19rem;
}

.device-summary {
  color: var(--ink-soft);
  font-size: 0.68rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.device-list {
  display: grid;
  margin-top: 1.35rem;
}

.device-row {
  display: grid;
  min-height: 5.4rem;
  border-top: 1px solid var(--line);
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 0;
}

.device-icon {
  width: 2.6rem;
  height: 2.6rem;
  border-color: var(--line);
  border-radius: 10px;
  background: var(--paper-deep);
  font-size: 0.9rem;
}

.device-details {
  min-width: 0;
}

.device-name-line {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 0.55rem;
}

.device-name-line strong {
  overflow: hidden;
  font-size: 0.82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.device-state {
  display: inline-flex;
  flex: 0 0 auto;
  border-radius: 99px;
  align-items: center;
  padding: 0.28rem 0.55rem;
  font-size: 0.61rem;
  font-weight: 720;
  line-height: 1;
}

.device-state--active {
  color: #28683e;
  background: rgb(84 173 116 / 15%);
}

.device-state--revoked {
  color: #943725;
  background: rgb(255 121 95 / 18%);
}

.device-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.75rem;
  margin-top: 0.35rem;
  color: var(--ink-soft);
  font-size: 0.66rem;
  line-height: 1.35;
}

.device-revoke-button {
  min-width: 5.2rem;
  min-height: 2.45rem;
  padding: 0.5rem 0.75rem;
  color: #943725;
}

.device-revoked-note {
  color: var(--ink-soft);
  font-size: 0.66rem;
  white-space: nowrap;
}

.workbench-row {
  display: grid;
  border-top: 1px solid var(--line);
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  padding: 1rem 0;
}

.workbench-row strong {
  display: block;
  margin-bottom: 0.45rem;
  font-size: 0.82rem;
  line-height: 1.35;
}

.workbench-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.8rem;
  color: var(--ink-soft);
  font-size: 0.65rem;
}

.edit-button {
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
}

.edit-button:hover {
  border-color: var(--ink);
  background: var(--card);
}

.dialog {
  max-width: none;
  max-height: none;
  border: 0;
  background: transparent;
  padding: 0;
}

.dialog::backdrop {
  background: rgb(28 32 29 / 58%);
  backdrop-filter: blur(8px);
}

.upload-dialog {
  width: min(94vw, 42rem);
}

.dialog-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--paper);
  box-shadow: var(--shadow);
  padding: clamp(1.3rem, 4vw, 2.2rem);
}

.dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.dialog-card > .muted {
  max-width: 34rem;
  margin: 0.8rem 0 1.4rem;
  font-size: 0.82rem;
  line-height: 1.5;
}

.upload-purpose {
  display: grid;
  max-width: 36rem;
  margin-top: 1rem;
  border-left: 4px solid var(--lime-deep);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  gap: 0.3rem;
  padding: 0.9rem 1rem;
  background: rgb(215 255 100 / 20%);
}

.upload-purpose strong {
  font-size: 0.82rem;
}

.upload-purpose span {
  color: var(--ink-soft);
  font-size: 0.74rem;
  line-height: 1.5;
}

.dialog-card > .upload-fallback-copy {
  margin-top: 0.7rem;
}

.drop-zone {
  display: grid;
  min-height: 10rem;
  border: 1px dashed #9c9e91;
  border-radius: var(--radius-md);
  place-items: center;
  align-content: center;
  gap: 0.25rem;
  background: rgb(255 253 248 / 55%);
  cursor: pointer;
  text-align: center;
}

.drop-zone:hover {
  border-color: var(--ink);
  background: var(--card);
}

.drop-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.drop-zone span:last-of-type {
  color: var(--ink-soft);
  font-size: 0.68rem;
}

.drop-icon {
  display: grid;
  width: 2.6rem;
  height: 2.6rem;
  margin-bottom: 0.35rem;
  border-radius: 50%;
  place-items: center;
  background: var(--lime);
  font-size: 1.2rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}

.dialog-actions {
  display: flex;
  margin-top: 0.6rem;
  justify-content: flex-end;
  gap: 0.7rem;
}

.call-dialog {
  width: min(100vw, 64rem);
  height: 100vh;
  margin: 0 0 0 auto;
}

.call-dialog::backdrop {
  background: rgb(28 32 29 / 38%);
}

.call-drawer {
  display: grid;
  width: 100%;
  min-height: 100%;
  grid-template-rows: auto 1fr;
  background: var(--paper);
  box-shadow: -20px 0 70px rgb(28 32 29 / 15%);
  animation: drawer-in 260ms cubic-bezier(0.2, 0.75, 0.25, 1) both;
}

@keyframes drawer-in {
  from {
    transform: translateX(2rem);
    opacity: 0;
  }
}

.drawer-header {
  display: grid;
  border-bottom: 1px solid var(--line);
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 1rem;
  padding: 1.5rem;
}

.drawer-header h2 {
  margin-top: 0.2rem;
  font-size: clamp(1.8rem, 4vw, 3rem);
}

.drawer-heading-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.8rem;
  margin-top: 0.65rem;
  color: var(--ink-soft);
  font-size: 0.68rem;
}

.drawer-actions {
  display: flex;
  gap: 0.5rem;
}

.drawer-body {
  overflow: auto;
  padding: clamp(1.2rem, 4vw, 2.5rem);
}

.summary-card {
  margin-bottom: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  background: var(--card);
}

.summary-card p:last-child {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.55;
}

.detail-section {
  margin-top: 2rem;
}

.detail-section-heading {
  display: flex;
  margin-bottom: 1rem;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.observation-list,
.transcript-list {
  display: grid;
  gap: 0.75rem;
}

.observation-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  background: var(--card);
}

.observation-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.observation-card h3 {
  margin: 0.75rem 0 0.9rem;
  font-size: 1.05rem;
}

.timestamp {
  color: var(--ink-soft);
  font-size: 0.64rem;
  font-variant-numeric: tabular-nums;
}

.transcript-switch {
  display: inline-flex;
  padding: 0.2rem;
  border: 1px solid var(--line);
  border-radius: 9px;
}

.transcript-switch button {
  border: 0;
  border-radius: 6px;
  padding: 0.4rem 0.6rem;
  color: var(--ink-soft);
  background: transparent;
  font-size: 0.62rem;
  font-weight: 700;
}

.transcript-switch button.is-active {
  color: var(--ink);
  background: var(--lime);
}

.utterance {
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr);
  gap: 1rem;
  padding: 0.85rem 0;
  border-top: 1px solid var(--line);
}

.speaker-label {
  color: var(--ink-soft);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: capitalize;
}

.utterance p {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.55;
}

.processing-card,
.failure-card {
  display: grid;
  min-height: 18rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  place-items: center;
  padding: 2rem;
  background: var(--card);
  text-align: center;
}

.processing-orbit {
  width: 3rem;
  height: 3rem;
  margin: 0 auto 1rem;
  border: 3px solid var(--paper-deep);
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: spin 900ms linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.toast {
  position: fixed;
  z-index: 100;
  max-width: min(90vw, 28rem);
  left: 50%;
  bottom: 1.5rem;
  border-radius: 12px;
  padding: 0.85rem 1rem;
  color: var(--paper);
  background: var(--ink);
  box-shadow: var(--shadow);
  font-size: 0.78rem;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 1rem);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 1100px) {
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .overview-grid,
  .insight-grid,
  .questions-workbench {
    grid-template-columns: 1fr;
  }

  .tone-panel {
    min-height: auto;
  }

  .call-list-item {
    grid-template-columns: minmax(9rem, 1fr) minmax(10rem, 1fr) 6rem 1.5rem;
  }

  .call-list-item .call-summary {
    display: none;
  }
}

@media (max-width: 800px) {
  .login-view {
    grid-template-columns: 1fr;
  }

  .login-intro {
    min-height: 45vh;
    padding: 1.5rem;
  }

  .login-copy {
    margin: 5rem 0 3rem;
  }

  .login-copy h1 {
    font-size: clamp(4rem, 18vw, 7rem);
  }

  .login-signal {
    display: none;
  }

  .login-panel {
    min-height: 55vh;
    padding: 3rem 1.5rem;
  }

  .sidebar {
    width: min(82vw, 18rem);
    transform: translateX(-105%);
    transition: transform 180ms ease;
  }

  .sidebar.is-open {
    transform: translateX(0);
    box-shadow: 20px 0 60px rgb(28 32 29 / 15%);
  }

  .workspace {
    margin-left: 0;
    padding: 1.25rem 1rem 4rem;
  }

  .mobile-only {
    display: grid;
  }

  .topbar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .topbar > div:nth-child(2) {
    grid-column: 2;
  }

  .topbar h1 {
    font-size: clamp(2.2rem, 11vw, 4rem);
  }

  .topbar-actions {
    display: contents;
  }

  .topbar-actions .range-switch {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  #refresh-button {
    grid-column: 3;
    grid-row: 1;
  }

  .range-switch {
    flex: 1;
  }

  .range-switch button {
    min-width: 0;
    flex: 1;
  }

  .metric-card {
    min-height: 9rem;
  }

  .panel {
    border-radius: 21px;
  }

  .trend-panel {
    min-height: 22rem;
  }

  .trend-chart {
    height: 15rem;
  }

  .trend-bar-track {
    height: 11rem;
  }

  .call-list-item {
    grid-template-columns: minmax(0, 1fr) auto 1.5rem;
  }

  .call-list-item .call-time,
  .call-list-item .call-summary {
    display: none;
  }

  .section-intro {
    align-items: flex-start;
    flex-direction: column;
  }

  .call-table-row {
    grid-template-columns: minmax(0, 1fr) auto 1.5rem;
  }

  .call-table-row .call-table-meta:nth-child(2),
  .call-table-row .call-table-summary {
    display: none;
  }

  .device-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .device-revoke-button,
  .device-revoked-note {
    grid-column: 2;
    justify-self: start;
  }

  .call-dialog {
    width: 100vw;
  }

  .drawer-header {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .drawer-actions {
    grid-column: 2;
  }
}

@media (max-width: 520px) {
  .metric-grid {
    grid-template-columns: 1fr 1fr;
  }

  .metric-card {
    min-height: 8.5rem;
    padding: 1rem;
  }

  .metric-value {
    font-size: 2.5rem;
  }

  .metric-note {
    max-width: 11rem;
  }

  .panel {
    padding: 1.1rem;
  }

  .trend-column:nth-child(even) .trend-label {
    visibility: hidden;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .device-setup-steps {
    grid-template-columns: 1fr;
  }

  .android-setup-nudge {
    align-items: flex-start;
    flex-direction: column;
  }

  .device-name-line {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.35rem;
  }

  .filter-row {
    flex-direction: column;
  }

  .select-field {
    width: 100%;
  }

  .drawer-header {
    padding: 1rem;
  }

  .drawer-body {
    padding: 1rem;
  }

  .utterance {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }
}

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