@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/JetBrainsMono-Regular.woff2") format("woff2");
}

:root {
  --havi-bg: #ffffff;
  --havi-fg: #121212;
  --havi-muted: #737373;
  --havi-muted-2: #8f8f8f;
  --havi-border: #e5e5e5;
  --havi-panel: #f6f6f6;
  --havi-amber: #f59e0b;
  --havi-amber-strong: #d97706;
  --havi-amber-deep: #b45309;
  --havi-red: #dc2626;
  --havi-green: #047857;
  --havi-blue: #2563eb;
  --havi-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --havi-sans: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  color: var(--havi-fg);
  background: var(--havi-panel);
  font-family: var(--havi-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--havi-amber);
  outline-offset: 2px;
}

.havi-shell {
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
  max-width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: var(--havi-bg);
}

.havi-sidebar {
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  z-index: 30;
  height: 100vh;
  background: var(--havi-panel);
  border-right: 1px solid var(--havi-border);
}

.havi-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 16px 12px;
  font-size: 18px;
  font-weight: 700;
}

.havi-mark {
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 6px;
  color: #fff;
  background: var(--havi-amber);
  font-family: var(--havi-mono);
  font-weight: 700;
}

.workspace-list,
.havi-nav,
.account-panel {
  padding: 10px 12px;
}

.workspace-list {
  border-bottom: 1px solid var(--havi-border);
}

.workspace-button,
.nav-button,
.account-card {
  display: flex;
  width: 100%;
  min-width: 0;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 4px;
  color: var(--havi-muted);
  background: transparent;
  text-align: left;
  text-decoration: none;
}

.workspace-button {
  padding: 9px 10px;
  cursor: pointer;
}

.workspace-switcher,
.account-menu {
  position: relative;
}

.workspace-trigger,
.account-card {
  cursor: pointer;
  list-style: none;
}

.workspace-trigger::-webkit-details-marker,
.account-card::-webkit-details-marker {
  display: none;
}

.workspace-menu,
.account-menu-popover {
  position: absolute;
  z-index: 50;
  top: calc(100% + 8px);
  left: 0;
  width: min(360px, calc(100vw - 32px));
  border: 1px solid var(--havi-border);
  border-radius: 4px;
  padding: 8px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(17, 24, 39, 0.12);
}

.account-menu-popover {
  top: auto;
  bottom: calc(100% + 8px);
}

.workspace-trigger {
  display: flex;
  width: 100%;
  min-width: 0;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--havi-border);
  border-radius: 4px;
  padding: 9px 10px;
  background: #fff;
}

.workspace-button.create {
  border-top: 1px solid var(--havi-border);
  margin-top: 6px;
  padding-top: 12px;
}

.workspace-dot.plus {
  color: var(--havi-muted);
  background: #e9e9e9;
}

.havi-icon {
  display: block;
  flex: none;
}

.chevron,
.check-mark {
  margin-left: auto;
  color: var(--havi-muted-2);
}

.check-mark {
  color: var(--havi-amber);
}

.chevron {
  transition: transform 0.18s ease;
}

/* Chevrons inside a <details> summary flip when the disclosure is open. */
details[open] > summary .chevron {
  transform: rotate(180deg);
}

@media (prefers-reduced-motion: reduce) {
  .chevron {
    transition: none;
  }
}

.menu-row {
  display: flex;
  width: 100%;
  border: 0;
  border-radius: 4px;
  padding: 9px 10px;
  background: transparent;
  color: var(--havi-fg);
  font-size: 13px;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.menu-row:hover {
  background: rgba(0, 0, 0, 0.04);
}

.menu-row.danger {
  color: var(--havi-red);
}

.workspace-button:hover,
.nav-button:hover,
.account-card:hover {
  color: var(--havi-fg);
  background: rgba(0, 0, 0, 0.04);
}

.workspace-button.active,
.nav-button.active {
  color: var(--havi-fg);
  background: #fff;
  border: 1px solid var(--havi-border);
}

.workspace-dot {
  display: grid;
  width: 30px;
  height: 30px;
  flex: none;
  place-items: center;
  border-radius: 6px;
  color: #fff;
  background: var(--havi-fg);
  font-family: var(--havi-mono);
  font-size: 12px;
}

.workspace-dot.team {
  background: var(--havi-amber);
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-name {
  display: block;
  min-width: 0;
  color: var(--havi-fg);
  font-size: 14px;
  font-weight: 700;
}

.workspace-meta,
.section-label,
.mono,
.eyebrow {
  font-family: var(--havi-mono);
}

.workspace-meta {
  display: block;
  min-width: 0;
  color: var(--havi-muted-2);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.havi-nav {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.section-label {
  padding: 14px 10px 6px;
  color: var(--havi-muted-2);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.section-label.compact {
  padding: 4px 8px 8px;
}

.nav-button {
  height: 34px;
  padding: 0 10px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.nav-count {
  margin-left: auto;
  border-radius: 999px;
  padding: 1px 7px;
  color: var(--havi-muted-2);
  background: rgba(0, 0, 0, 0.05);
  font-family: var(--havi-mono);
  font-size: 11px;
}

.account-panel {
  border-top: 1px solid var(--havi-border);
}

.account-card {
  padding: 8px;
}

.avatar.large {
  width: 44px;
  height: 44px;
}

.avatar.sm {
  width: 22px;
  height: 22px;
  font-size: 9px;
  font-weight: 700;
}

.creator-identity {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  min-width: 0;
  transition: opacity 0.15s ease;
}

.creator-identity > span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-identity strong,
.member-identity > div {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.owner-identity {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.workspace-glyph {
  display: grid;
  width: 22px;
  height: 22px;
  flex: none;
  place-items: center;
  border-radius: 4px;
  border: 1px solid var(--havi-border);
  background: var(--havi-panel);
  color: var(--havi-muted);
  font-size: 9px;
  font-family: var(--havi-mono);
  font-weight: 700;
  text-transform: uppercase;
}

.identity-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
}

.identity-row + .identity-row {
  border-top: 1px solid var(--havi-border);
}

.identity-meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.identity-meta .identity-label {
  color: var(--havi-muted-2);
  font-family: var(--havi-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.identity-meta .identity-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--havi-fg);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.grow {
  flex: 1;
  min-width: 0;
}

.ch-action {
  margin-left: auto;
}

.agent-pill {
  color: var(--havi-muted);
  font-family: var(--havi-mono);
  font-size: 12px;
}

.avatar {
  display: grid;
  width: 34px;
  height: 34px;
  flex: none;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: #1f2937;
  font-family: var(--havi-mono);
  font-weight: 700;
}

.havi-main {
  display: flex;
  min-width: 0;
  max-width: 100vw;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  min-height: 60px;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--havi-border);
  background: rgba(255, 255, 255, 0.92);
  padding: 0 28px;
}

.crumbs {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  color: var(--havi-muted);
  font-size: 14px;
}

.crumbs strong {
  color: var(--havi-fg);
  font-weight: 600;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  background: #fff;
}

.page {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 28px;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--havi-amber);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.eyebrow::before {
  display: block;
  width: 34px;
  height: 3px;
  border-radius: 4px;
  background: var(--havi-amber);
  content: "";
}

.page-title {
  margin: 8px 0 0;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.12;
}

.page-sub {
  margin: 6px 0 0;
  color: var(--havi-muted);
  font-size: 15px;
}

.row,
.actions-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.actions-row {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.grid-4,
.grid-2,
.dashboard-grid {
  display: grid;
  gap: 16px;
}

.grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dashboard-grid {
  grid-template-columns: minmax(0, 1fr) 340px;
  align-items: start;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.card,
.tile,
.banner {
  min-width: 0;
  border: 1px solid var(--havi-border);
  border-radius: 4px;
  background: #fff;
}

.card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--havi-border);
  padding: 15px 18px;
}

.card-title {
  margin: 0;
  margin-right: auto;
  font-size: 15px;
  font-weight: 700;
}

.card-body {
  min-width: 0;
  padding: 18px;
  overflow-wrap: anywhere;
}

.tile {
  padding: 18px;
}

.tile-label {
  color: var(--havi-muted-2);
  font-family: var(--havi-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.tile-value {
  margin-top: 10px;
  font-size: 31px;
  font-weight: 700;
  line-height: 1;
}

.tile-foot {
  margin-top: 8px;
  color: var(--havi-muted);
  font-size: 13px;
}

.banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px 16px;
  background: #fffaf0;
  border-color: rgba(245, 158, 11, 0.38);
}

.banner.danger {
  background: #fff5f5;
  border-color: rgba(220, 38, 38, 0.3);
}

.banner.neutral {
  background: #f8fafc;
  border-color: #dbe3eb;
}

.banner-title {
  font-weight: 700;
}

.banner-text,
.muted {
  color: var(--havi-muted);
}

.banner-text {
  margin-top: 4px;
  line-height: 1.5;
}

.btn {
  display: inline-flex;
  height: 36px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 3px;
  padding: 0 13px;
  background: transparent;
  color: var(--havi-fg);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition:
    color 0.15s ease,
    border-color 0.15s ease,
    background-color 0.15s ease;
}

.btn-primary {
  color: #fff;
  background: var(--havi-amber);
}

.btn-primary:not(:disabled):hover {
  background: var(--havi-amber-strong);
}

.btn-primary:not(:disabled):active {
  background: var(--havi-amber-deep);
}

.btn-outline {
  border-color: var(--havi-border);
  background: #fff;
}

.btn-outline:not(:disabled):hover {
  border-color: var(--havi-amber);
}

.btn-danger {
  color: var(--havi-red);
  border-color: var(--havi-border);
  background: #fff;
}

.btn-danger:not(:disabled):hover {
  border-color: rgba(220, 38, 38, 0.35);
  background: rgba(220, 38, 38, 0.06);
}

.btn-ghost {
  color: var(--havi-muted);
}

.btn-ghost:not(:disabled):hover {
  color: var(--havi-fg);
  background: rgba(0, 0, 0, 0.04);
}

@media (prefers-reduced-motion: reduce) {
  .btn {
    transition: none;
  }
}

.btn-sm {
  height: 30px;
  padding: 0 10px;
  font-size: 13px;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 22px;
  border: 1px solid var(--havi-border);
  border-radius: 3px;
  padding: 2px 8px;
  color: var(--havi-muted);
  background: #fff;
  font-family: var(--havi-mono);
  font-size: 11px;
  line-height: 1.3;
}

.badge.open,
.badge.admin {
  color: #b45309;
  border-color: rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.08);
}

.badge.resolved,
.badge.healthy {
  color: var(--havi-green);
  border-color: rgba(4, 120, 87, 0.28);
  background: rgba(4, 120, 87, 0.08);
}

.badge.danger {
  color: var(--havi-red);
  border-color: rgba(220, 38, 38, 0.25);
  background: rgba(220, 38, 38, 0.07);
}

.badge.pending {
  color: #92400e;
  border-color: rgba(245, 158, 11, 0.3);
  background: rgba(245, 158, 11, 0.08);
}

.badge.setup {
  color: var(--havi-muted);
  border-color: rgba(99, 102, 241, 0.22);
  background: rgba(99, 102, 241, 0.06);
}

.badge.cap {
  color: var(--havi-red);
  border-color: rgba(220, 38, 38, 0.25);
  background: rgba(220, 38, 38, 0.07);
}

.badge.neutral {
  color: var(--havi-muted);
  border-color: var(--havi-border);
  background: var(--havi-panel);
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border: 1px solid var(--havi-border);
  border-radius: 3px;
  padding: 2px 7px;
  color: var(--havi-muted);
  background: #fbfbfb;
  font-family: var(--havi-mono);
  font-size: 11px;
  line-height: 1.2;
}

.subtle {
  color: var(--havi-muted-2);
  font-size: 12px;
}

.filter-card {
  margin-bottom: 14px;
  padding: 12px;
}

.filter-grid {
  display: grid;
  grid-template-columns: minmax(220px, 2fr) repeat(4, minmax(130px, 1fr));
  gap: 10px;
}

.filter-grid .field {
  min-width: 0;
}

.filter-grid .field label {
  color: var(--havi-muted-2);
  font-family: var(--havi-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.filter-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--havi-border);
  margin-top: 12px;
  padding-top: 12px;
  color: var(--havi-muted);
  font-size: 12px;
}

.table-wrap {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.table th {
  border-bottom: 1px solid var(--havi-border);
  padding: 10px 12px;
  color: var(--havi-muted-2);
  font-family: var(--havi-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-align: left;
  text-transform: uppercase;
}

.table td {
  border-bottom: 1px solid var(--havi-border);
  padding: 12px;
  font-size: 14px;
  vertical-align: top;
}

.annotation-button {
  display: block;
  width: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.annotation-button strong,
.annotation-button .mono {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shot {
  display: grid;
  width: 76px;
  height: 52px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--havi-border);
  border-radius: 4px;
  color: var(--havi-muted-2);
  background: var(--havi-panel);
}

.shot.compact {
  width: 68px;
  height: 44px;
}

.shot-thumb {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--havi-panel);
}

.shot-empty-icon {
  color: var(--havi-muted-2);
  opacity: 0.55;
}

.shot-button:hover .shot {
  border-color: var(--havi-amber);
}

.shot-button {
  width: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

/* ─── Sentry-style annotation row ─────────────────────────────────────────── */

/* Left-edge accent bar keyed to motivation/status */
.anno-row {
  position: relative;
  padding-left: 10px;
}

.anno-row::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  border-radius: 2px;
  background: var(--havi-border);
  pointer-events: none;
}

.anno-row.accent-open::before {
  background: var(--havi-amber);
}

.anno-row.accent-resolved::before {
  background: var(--havi-green);
}

.anno-row.accent-highlighting::before {
  background: var(--havi-blue);
}

.anno-row.accent-describing::before {
  background: var(--havi-red);
}

/* Hover lift */
.anno-row:hover {
  background: rgba(0, 0, 0, 0.018);
  transition: background 0.12s ease;
}

@media (prefers-reduced-motion: reduce) {
  .anno-row:hover {
    transition: none;
  }
}

/* Smooth open transition for annotation-button */
.anno-row .annotation-button {
  transition: color 0.1s ease;
}

@media (prefers-reduced-motion: reduce) {
  .anno-row .annotation-button {
    transition: none;
  }
}

/* Target subline: host/path + selector hint */
.anno-subline {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 2px;
  min-width: 0;
  overflow: hidden;
}

.anno-subline .anno-path {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--havi-mono);
  font-size: 11px;
  color: var(--havi-muted);
}

.anno-subline .anno-selector {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--havi-mono);
  font-size: 11px;
  color: var(--havi-muted-2);
  flex-shrink: 0;
  max-width: 160px;
}

/* "⚠ N errors" describing badge */
.badge.describing {
  color: var(--havi-red);
  border-color: rgba(220, 38, 38, 0.25);
  background: rgba(220, 38, 38, 0.07);
  gap: 4px;
}

/* Describing bodies breadcrumb section in detail view */
.describing-context {
  border: 1px solid var(--havi-border);
  border-radius: 4px;
  overflow: hidden;
}

.describing-context-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--havi-panel);
  border-bottom: 1px solid var(--havi-border);
  font-family: var(--havi-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--havi-muted);
}

.describing-context-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.describing-context-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--havi-border);
  font-size: 13px;
}

.describing-context-item:last-child {
  border-bottom: none;
}

.describing-context-item .dc-label {
  font-family: var(--havi-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--havi-muted-2);
}

.describing-context-item .dc-value {
  font-family: var(--havi-mono);
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-all;
  color: var(--havi-fg);
}

.detail-shot {
  min-height: 320px;
}

.detail-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
  align-items: start;
}

.design-detail {
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
}

.evidence-card {
  grid-row: span 4;
}

.detail-comment {
  margin: 8px 0 0;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.55;
}

.kv-list {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 10px 14px;
  margin: 0;
}

.kv-list dt {
  color: var(--havi-muted-2);
  font-family: var(--havi-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.kv-list dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.kv-list-compact {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 12px;
  padding: 4px 0;
}

.kv-list-compact .mono {
  flex: none;
}

.workspace-meta.inline {
  display: inline;
  margin-left: 8px;
}

.terminal-card {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  border: 1px solid #1f2937;
  border-radius: 4px;
  padding: 14px;
  color: #d1d5db;
  background: #111827;
}

.terminal-card .copy-line {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
}

.terminal-card .copy-line .tile-label {
  width: 84px;
  flex: none;
  overflow-wrap: normal;
  word-break: normal;
}

.terminal-card .mono {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.terminal-card .copy-line .mono {
  flex: 1 1 auto;
}

.terminal-card > .mono {
  display: block;
}

.extension-copy,
.wrap-anywhere {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.guide-link {
  color: var(--havi-blue);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.guide-link:hover {
  text-decoration: none;
}

.guide-steps {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 14px;
}

.guide-steps li {
  padding-left: 4px;
}

.guide-steps li strong {
  display: block;
  margin-bottom: 2px;
}

.guide-steps li p {
  margin: 0;
  color: var(--havi-muted, #6b7280);
}

.guide-code-card {
  position: relative;
}

.guide-code-card .guide-code-copy {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
}

.guide-code {
  margin: 0;
  padding: 14px 16px;
  border: 1px solid #1f2937;
  border-radius: 4px;
  color: #d1d5db;
  background: #111827;
  font-family: var(--havi-mono);
  font-size: 12.5px;
  line-height: 1.6;
  overflow-x: auto;
  white-space: pre;
  tab-size: 2;
}

.form-grid {
  display: grid;
  gap: 10px;
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  font-size: 13px;
  font-weight: 700;
}

.field-error {
  color: var(--havi-red);
  font-size: 12px;
  font-weight: 600;
}

.confirm-name {
  align-self: start;
  border: 1px solid var(--havi-border);
  border-radius: 4px;
  padding: 4px 8px;
  background: var(--havi-panel);
  color: var(--havi-fg);
  font-family: var(--havi-mono);
  font-size: 13px;
  font-weight: 600;
  user-select: all;
  overflow-wrap: anywhere;
}

.input,
.textarea,
.select {
  width: 100%;
  border: 1px solid var(--havi-border);
  border-radius: 3px;
  background: #fff;
  color: var(--havi-fg);
  font-size: 14px;
  transition: border-color 0.15s ease;
}

.input:hover,
.textarea:hover,
.select:hover {
  border-color: var(--havi-muted-2);
}

@media (prefers-reduced-motion: reduce) {
  .input,
  .textarea,
  .select {
    transition: none;
  }
}

.input,
.select {
  height: 38px;
  padding: 0 10px;
}

.textarea {
  min-height: 110px;
  padding: 10px;
  line-height: 1.45;
  resize: vertical;
}

.copy-line {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--havi-border);
  border-radius: 3px;
  padding: 9px 10px;
  background: #fbfbfb;
  font-family: var(--havi-mono);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.copy-line .mono {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.signin-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(420px, 0.95fr);
  min-height: 100vh;
  background: #fff;
}

.signin-brand-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 42px;
  padding: 32px;
  background:
    linear-gradient(180deg, rgba(245, 158, 11, 0.12), rgba(245, 158, 11, 0)),
    var(--havi-panel);
  border-right: 1px solid var(--havi-border);
}

.signin-brand {
  padding: 0;
}

.signin-story-panel {
  gap: 30px;
  padding: 36px 36px 30px;
  background:
    radial-gradient(90% 60% at 0% 0%, rgba(245, 158, 11, 0.26), rgba(245, 158, 11, 0) 62%),
    radial-gradient(70% 50% at 100% 100%, rgba(245, 158, 11, 0.12), rgba(245, 158, 11, 0) 60%),
    linear-gradient(180deg, #fffaf1 0%, var(--havi-panel) 100%);
}

.signin-panel-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.signin-chip-example {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  border: 1px solid rgba(245, 158, 11, 0.45);
  border-radius: 999px;
  padding: 4px 10px;
  color: var(--havi-amber-deep);
  background: rgba(245, 158, 11, 0.16);
  font-family: var(--havi-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}

.signin-chip-example::before {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--havi-amber);
  content: "";
}

.signin-story {
  display: grid;
  width: min(600px, 100%);
  gap: 26px;
  margin: auto 0;
}

.signin-story-head {
  display: grid;
  gap: 12px;
}

.signin-story h1 {
  margin: 0;
  max-width: 17ch;
  font-size: 38px;
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.signin-story h1 em {
  color: var(--havi-amber-deep);
  font-style: normal;
}

.signin-story-sub {
  margin: 0;
  max-width: 44ch;
  color: var(--havi-muted);
  font-size: 16px;
  line-height: 1.55;
}

.signin-steps {
  display: grid;
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.signin-step {
  display: grid;
  position: relative;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 16px;
}

.signin-step::after {
  position: absolute;
  top: 40px;
  bottom: -20px;
  left: 16px;
  border-left: 2px dotted rgba(245, 158, 11, 0.5);
  content: "";
}

.signin-step:last-child::after {
  display: none;
}

.signin-step-dot {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1.5px solid rgba(245, 158, 11, 0.55);
  border-radius: 999px;
  color: var(--havi-amber-deep);
  background: #fff;
  font-family: var(--havi-mono);
  font-size: 13px;
  font-weight: 700;
}

.signin-step-body {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
  padding-top: 2px;
}

.signin-step-text {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.signin-step-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.signin-step-copy {
  margin: 0;
  color: var(--havi-muted);
  font-size: 14px;
  line-height: 1.5;
}

.signin-thumb {
  display: grid;
  flex: none;
  width: 156px;
  gap: 7px;
  border: 1px solid var(--havi-border);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(17, 24, 39, 0.1);
}

.signin-thumb-bar {
  display: flex;
  align-items: center;
  gap: 5px;
}

.signin-thumb-bar i {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: #e0e0e0;
}

.signin-thumb-bar i:first-child {
  background: rgba(245, 158, 11, 0.5);
}

.signin-thumb-bar span {
  flex: 1 1 auto;
  height: 9px;
  margin-left: 4px;
  border-radius: 999px;
  background: #f2f2f2;
}

.signin-thumb-line {
  display: block;
  height: 7px;
  border-radius: 999px;
  background: #e8e8e8;
}

.signin-thumb-line-lead {
  width: 72%;
  height: 11px;
  background: #dcdcdc;
}

.signin-thumb-line-mid {
  width: 56%;
}

.signin-thumb-line-short {
  width: 40%;
}

.signin-thumb-cta-wrap {
  display: inline-flex;
  position: relative;
  width: max-content;
  margin-top: 4px;
  border: 1.5px dashed var(--havi-amber);
  border-radius: 8px;
  padding: 5px;
  background: rgba(245, 158, 11, 0.1);
}

.signin-thumb-cta {
  display: inline-flex;
  height: 22px;
  align-items: center;
  border-radius: 4px;
  padding: 0 12px;
  color: #fff;
  background: var(--havi-amber);
  font-size: 11px;
  font-weight: 700;
}

.signin-thumb-pin {
  display: grid;
  position: absolute;
  top: -11px;
  left: -11px;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 999px;
  color: #fff;
  background: var(--havi-amber);
  box-shadow: 0 4px 10px rgba(180, 83, 9, 0.35);
}

.signin-thumb-pin svg {
  display: block;
}

.signin-note {
  display: grid;
  width: 100%;
  gap: 10px;
  border: 1px solid var(--havi-border);
  border-radius: 10px;
  padding: 16px 18px;
  background: #fff;
  box-shadow: 0 14px 32px rgba(17, 24, 39, 0.1);
}

.signin-note-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.signin-note-avatar {
  display: grid;
  flex: none;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 999px;
  color: var(--havi-amber-deep);
  background: rgba(245, 158, 11, 0.22);
  font-size: 13px;
  font-weight: 700;
}

.signin-note-who {
  font-size: 13px;
  font-weight: 700;
}

.signin-note-when {
  margin-left: auto;
  color: var(--havi-muted-2);
  font-size: 12px;
}

.signin-note-text {
  margin: 0;
  font-size: 20px;
  line-height: 1.3;
}

.signin-note-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--havi-muted);
  font-size: 13px;
}

.signin-note-dot {
  width: 3px;
  height: 3px;
  border-radius: 999px;
  background: #d4d4d4;
}

.signin-note-meta .mono {
  color: var(--havi-fg);
  font-size: 12px;
}

.signin-handoff {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 10px;
  padding: 14px 16px;
  background: rgba(245, 158, 11, 0.08);
}

.signin-handoff-icon {
  display: grid;
  flex: none;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: var(--havi-amber);
}

.signin-form-panel {
  display: grid;
  min-width: 0;
  place-items: center;
  padding: 32px;
}

.signin-card {
  display: grid;
  width: min(420px, 100%);
  gap: 18px;
}

.signin-card h2 {
  margin: 8px 0 0;
  font-size: 34px;
  line-height: 1.08;
}

.signin-copy,
.signin-footnote {
  color: var(--havi-muted);
  line-height: 1.55;
}

.signin-copy {
  margin: 12px 0 0;
}

.signin-footnote {
  margin: 0;
  font-size: 13px;
}

.signin-form {
  display: grid;
  gap: 10px;
}

.signin-form label {
  font-size: 13px;
  font-weight: 700;
}

.signin-form input {
  width: 100%;
  height: 42px;
  border: 1px solid var(--havi-border);
  border-radius: 3px;
  padding: 0 12px;
  background: #fff;
  color: var(--havi-fg);
}

.signin-card .full {
  width: 100%;
  height: 42px;
}

.notice {
  border: 1px solid rgba(37, 99, 235, 0.28);
  border-radius: 4px;
  padding: 10px 12px;
  color: #1d4ed8;
  background: rgba(37, 99, 235, 0.06);
  font-size: 14px;
}

.notice.success {
  color: var(--havi-green);
  border-color: rgba(4, 120, 87, 0.28);
  background: rgba(4, 120, 87, 0.06);
}

.notice.error {
  color: var(--havi-red);
  border-color: rgba(220, 38, 38, 0.28);
  background: rgba(220, 38, 38, 0.06);
}

.divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 10px;
  align-items: center;
  color: var(--havi-muted-2);
  font-family: var(--havi-mono);
  font-size: 11px;
  text-transform: uppercase;
}

.divider::before,
.divider::after {
  height: 1px;
  background: var(--havi-border);
  content: "";
}

.usage-bar {
  height: 8px;
  border-radius: 999px;
  background: #ededed;
  overflow: hidden;
}

.usage-fill {
  height: 100%;
  background: var(--havi-amber);
}

.usage-fill.danger {
  background: var(--havi-red);
}

.flash {
  margin-bottom: 16px;
  border: 1px solid rgba(37, 99, 235, 0.28);
  border-radius: 4px;
  padding: 10px 12px;
  color: #1d4ed8;
  background: #eef4ff;
  font-size: 14px;
}

.flash.error {
  color: var(--havi-red);
  border-color: rgba(220, 38, 38, 0.3);
  background: #fff5f5;
}

.modal-backdrop {
  position: fixed;
  z-index: 80;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(17, 24, 39, 0.36);
}

.modal-card {
  width: min(520px, 100%);
  max-height: min(720px, calc(100vh - 48px));
  overflow: auto;
  border: 1px solid var(--havi-border);
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(17, 24, 39, 0.22);
}

.modal-card.narrow {
  width: min(440px, 100%);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--havi-border);
  padding: 16px 18px;
}

.modal-head h2 {
  margin: 0;
  font-size: 18px;
}

.modal-body {
  padding: 18px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.icon-button {
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid var(--havi-border);
  border-radius: 4px;
  background: #fff;
  color: var(--havi-muted);
  cursor: pointer;
  transition:
    color 0.15s ease,
    border-color 0.15s ease,
    background-color 0.15s ease;
}

.icon-button:hover {
  color: var(--havi-fg);
  border-color: var(--havi-muted-2);
  background: rgba(0, 0, 0, 0.04);
}

@media (prefers-reduced-motion: reduce) {
  .icon-button {
    transition: none;
  }
}

.invite-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--havi-border);
  padding: 12px 0 0;
}

.danger-card {
  border-color: rgba(220, 38, 38, 0.28);
}

.billing-summary {
  margin-bottom: 20px;
}

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

.plan-card {
  position: relative;
  display: grid;
  gap: 16px;
  border: 1px solid var(--havi-border);
  border-radius: 4px;
  padding: 18px;
  background: #fff;
}

.plan-card.current {
  border-color: var(--havi-amber);
}

.plan-card.recommended:not(.current) {
  border-color: #9ca3af;
}

.plan-card h3 {
  margin: 0;
  font-size: 18px;
}

.plan-badge {
  position: absolute;
  top: -12px;
  right: 16px;
  color: #fff;
  border-color: var(--havi-amber);
  background: var(--havi-amber);
}

.plan-price {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-family: var(--havi-mono);
  font-weight: 700;
}

.plan-price span {
  font-size: 30px;
}

.plan-price small {
  color: var(--havi-muted);
  font-size: 13px;
}

.feature-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.feature-list li {
  font-size: 14px;
}

.feature-list li::before {
  margin-right: 8px;
  color: var(--havi-green);
  content: "+";
}

.billing-note,
.plan-note {
  margin-top: 16px;
}

.settings-workspace-row {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 12px;
  border: 0;
  border-top: 1px solid var(--havi-border);
  padding: 14px 18px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.settings-workspace-row:first-child {
  border-top: 0;
}

.settings-workspace-row:hover {
  background: #fafafa;
}

.empty-state {
  display: grid;
  min-height: 180px;
  place-items: center;
  padding: 28px;
  color: var(--havi-muted);
  text-align: center;
}

.empty-state strong {
  display: block;
  margin-bottom: 6px;
  color: var(--havi-fg);
  font-size: 16px;
}

.empty-state p {
  margin: 0 auto;
  max-width: 44ch;
  line-height: 1.5;
}

.empty-state .btn {
  margin-top: 16px;
}

/* ---------- havi-6mr: dashboard polish ---------- */

/* Compact inline copy button (reused from the public site pattern, scoped for
   the app stylesheet). Toggled by the delegated [data-copy] handler in app.js. */
.codeline__copy {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--havi-muted);
  background: transparent;
  cursor: pointer;
  transition:
    color 0.16s ease,
    border-color 0.16s ease,
    background-color 0.16s ease;
}

.codeline__copy:hover {
  color: var(--havi-fg);
  border-color: var(--havi-border);
  background: rgba(0, 0, 0, 0.04);
}

.codeline__copy svg {
  display: block;
}

.codeline__copy .icon-check {
  display: none;
}

.codeline__copy.is-copied {
  color: var(--havi-green);
  border-color: rgba(4, 120, 87, 0.4);
}

.codeline__copy.is-copied .icon-copy {
  display: none;
}

.codeline__copy.is-copied .icon-check {
  display: block;
}

/* The terminal cards invert the copy button to read on a dark surface. */
.terminal-card .codeline__copy {
  color: rgba(255, 255, 255, 0.6);
}

.terminal-card .codeline__copy:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
}

.terminal-card .codeline__copy.is-copied {
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.5);
}

/* Truncated UUID + copy affordance (B). */
.copy-id {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  vertical-align: middle;
}

.copy-id-text {
  font-family: var(--havi-mono);
  font-size: 12px;
  color: var(--havi-muted);
  letter-spacing: 0.02em;
}

.copy-line .copy-line-btn {
  margin-left: auto;
}

/* Infinity glyph as a styled icon, not a bare character (A). */
.infinity-glyph {
  width: 38px;
  height: 38px;
  color: var(--havi-amber);
}

/* Status dots for connected / not-connected tool tiles (G). */
.tool-status-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 999px;
  background: var(--havi-muted-2);
}

.status-dot.on {
  background: var(--havi-green);
  box-shadow: 0 0 0 3px rgba(4, 120, 87, 0.16);
}

.status-dot.off {
  background: #cbd5e1;
}

.status-dot.setup {
  background: rgba(99, 102, 241, 0.3);
}

/* Responsive tool-status grid — collapses cleanly inside the narrow dashboard
   rail instead of squishing into vertical letter columns (D). */
.tool-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 12px;
}

.tool-status .tool-status-state {
  margin-top: 8px;
}

/* Collapsible setup disclosures (D, E). */
.setup-disclosure {
  border: 1px solid var(--havi-border);
  border-radius: 4px;
  background: var(--havi-bg);
}

.setup-disclosure[open] {
  border-color: var(--havi-border);
}

.setup-disclosure-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  list-style: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--havi-fg);
}

.setup-disclosure-summary::-webkit-details-marker {
  display: none;
}

.setup-disclosure-summary:hover {
  background: rgba(0, 0, 0, 0.02);
}

.setup-disclosure-body {
  padding: 0 14px 14px;
}

/* Screenshot rendering (C): real image, click-to-zoom, clean letterbox. */
.screenshot-frame {
  display: grid;
  place-items: center;
  padding: 14px;
  border: 1px solid var(--havi-border);
  border-radius: 6px;
  background:
    linear-gradient(45deg, #f3f3f3 25%, transparent 25%) -8px 0/16px 16px,
    linear-gradient(-45deg, #f3f3f3 25%, transparent 25%) -8px 0/16px 16px,
    linear-gradient(45deg, transparent 75%, #f3f3f3 75%) -8px 0/16px 16px,
    linear-gradient(-45deg, transparent 75%, #f3f3f3 75%) -8px 0/16px 16px,
    #fbfbfb;
}

.screenshot-zoom {
  position: relative;
  display: block;
  width: 100%;
  max-width: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: zoom-in;
}

.screenshot-img {
  display: block;
  width: 100%;
  max-height: 460px;
  margin: 0 auto;
  object-fit: contain;
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(17, 24, 39, 0.12);
}

/* Mobile captures are tall and narrow — keep them at device width so they
   letterbox cleanly instead of stretching across a wide frame (C). */
.screenshot-frame[data-viewport="mobile"] .screenshot-img {
  width: auto;
  max-width: min(300px, 100%);
}

.screenshot-zoom-hint {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border-radius: 999px;
  color: #fff;
  background: rgba(17, 24, 39, 0.78);
  font-family: var(--havi-mono);
  font-size: 11px;
  opacity: 0;
  transition: opacity 0.16s ease;
}

.screenshot-zoom:hover .screenshot-zoom-hint,
.screenshot-zoom:focus-visible .screenshot-zoom-hint {
  opacity: 1;
}

.screenshot-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  margin-top: 12px;
}

.screenshot-frame.empty {
  gap: 8px;
  min-height: 200px;
  border-style: dashed;
  color: var(--havi-muted-2);
  background: var(--havi-panel);
  font-size: 13px;
}

.screenshot-empty-icon {
  width: 28px;
  height: 28px;
  opacity: 0.6;
}

/* Full-viewport image lightbox (C), created by app.js. */
.havi-lightbox {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 32px;
  background: rgba(10, 12, 18, 0.86);
  cursor: zoom-out;
  animation: havi-lightbox-in 0.14s ease;
}

.havi-lightbox__img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 6px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
}

.havi-lightbox__close {
  position: fixed;
  top: 18px;
  right: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  cursor: pointer;
}

.havi-lightbox__close:hover {
  background: rgba(255, 255, 255, 0.26);
}

@keyframes havi-lightbox-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* Workspace switcher polish (F): tighter width, stronger elevation, so the
   menu reads as a floating layer instead of colliding with the page heading. */
.workspace-menu {
  width: min(284px, calc(100vw - 28px));
  border-radius: 6px;
  box-shadow:
    0 1px 2px rgba(17, 24, 39, 0.08),
    0 24px 48px rgba(17, 24, 39, 0.18);
}

.workspace-trigger:hover {
  border-color: var(--havi-amber);
}

/* Resolve / reopen and other LiveView feedback as floating toasts (H),
   stacked so a simultaneous info + error never land on the same spot. */
.flash-group {
  position: fixed;
  top: 72px;
  right: 16px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(360px, calc(100vw - 32px));
}

.flash-group .flash {
  margin: 0;
  box-shadow: 0 14px 36px rgba(17, 24, 39, 0.18);
  animation: havi-toast-in 0.22s ease;
}

@keyframes havi-toast-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .flash-group .flash,
  .havi-lightbox {
    animation: none;
  }
}

@media (max-width: 960px) {
  .signin-shell {
    grid-template-columns: 1fr;
  }

  .signin-brand-panel {
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--havi-border);
    padding: 24px 16px;
  }

  .signin-form-panel {
    padding: 28px 16px;
  }

  .signin-story h1 {
    font-size: 30px;
  }

  .havi-shell {
    grid-template-columns: 1fr;
    height: auto;
    overflow: visible;
  }

  .havi-sidebar {
    position: static;
    height: auto;
    overflow-y: visible;
    border-right: 0;
    border-bottom: 1px solid var(--havi-border);
  }

  .workspace-list,
  .havi-nav {
    display: flex;
    max-width: 100vw;
    gap: 8px;
    overflow-x: auto;
  }

  .workspace-button,
  .nav-button {
    width: auto;
    max-width: calc(100vw - 32px);
    flex: none;
  }

  .workspace-button {
    width: 230px;
  }

  .nav-button {
    max-width: 150px;
  }

  .section-label,
  .account-panel {
    display: none;
  }

  .topbar {
    padding: 0 16px;
  }

  .page {
    padding: 20px 16px;
  }

  .page-head,
  .dashboard-grid,
  .detail-panel,
  .design-detail,
  .plans-grid,
  .filter-grid {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .grid-4,
  .grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workspace-menu,
  .account-menu-popover {
    position: fixed;
    top: 76px;
    right: 16px;
    left: 16px;
    width: auto;
  }

  .account-menu-popover {
    top: auto;
    bottom: 16px;
  }

  .filter-foot,
  .invite-row,
  .modal-actions {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 620px) {
  .signin-brand-panel {
    gap: 24px;
  }

  .signin-step-body {
    flex-direction: column;
    align-items: flex-start;
  }

  .signin-thumb {
    width: 100%;
  }

  .signin-note-text {
    font-size: 17px;
  }

  .signin-card h2 {
    font-size: 28px;
  }

  .grid-4,
  .grid-2 {
    grid-template-columns: 1fr;
  }

  .topbar-actions {
    display: none;
  }

  .table th:nth-child(3),
  .table td:nth-child(3),
  .table th:nth-child(4),
  .table td:nth-child(4) {
    display: none;
  }
}

/* Setup checklist + first-resolve celebration (personal-workspace dashboard). */
.setup-checklist {
  margin-bottom: 16px;
}

.setup-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.setup-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.setup-step-marker {
  flex: none;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--havi-border);
  border-radius: 50%;
  background: #fff;
  color: #fff;
}

.setup-step.active .setup-step-marker {
  border-color: var(--havi-amber);
}

.setup-step.done .setup-step-marker {
  border-color: var(--havi-green);
  background: var(--havi-green);
}

.setup-step-title {
  font-weight: 700;
}

.setup-step.done .setup-step-title {
  color: var(--havi-muted);
  text-decoration: line-through;
}

.setup-step-hint {
  margin-top: 2px;
  line-height: 1.45;
}

.setup-step-next {
  display: inline-block;
  margin-top: 8px;
}

.setup-celebration {
  align-items: center;
  gap: 14px;
  background: #ecfdf5;
  border-color: rgba(4, 120, 87, 0.35);
}

.setup-celebration-glyph {
  flex: none;
  font-size: 26px;
  line-height: 1;
}

/* Workspace label vocabulary — sharp 3px manifest tags, never rounded pills. */
.labels-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.labels-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.labels-title {
  margin: 6px 0 4px;
  font-size: 20px;
  font-weight: 700;
}

.labels-sub {
  margin: 0;
  color: var(--havi-muted);
  font-size: 13px;
}

.labels-card .card-head .subtle {
  margin-left: auto;
}

.labels-rows {
  min-width: 0;
}

.lbl-row {
  margin: 0;
  border-top: 1px solid var(--havi-border);
}

.lbl-row.dragging {
  opacity: 0.4;
}

.lbl-row.archived {
  opacity: 0.55;
}

.lbl-grid {
  display: grid;
  grid-template-columns: 28px 22px minmax(140px, 1.4fr) minmax(120px, 1.6fr) minmax(150px, 2fr) 88px 68px;
  gap: 12px;
  align-items: center;
  padding: 11px 18px;
}

.grip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--havi-muted-2);
  cursor: grab;
}

.grip.locked,
.grip.empty {
  cursor: default;
  opacity: 0.5;
}

.grip.empty {
  visibility: hidden;
}

.lbl-lock {
  display: inline-flex;
  align-items: center;
  color: var(--havi-muted-2);
}

.lbl-def-head {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.lbl-key {
  margin-top: 2px;
  color: var(--havi-muted-2);
  font-size: 11px;
}

.lbl-values {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.lbl-desc {
  color: var(--havi-muted);
  font-size: 12px;
  line-height: 1.4;
}

.lbl-active {
  text-align: center;
}

.lbl-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.lbl-locked {
  color: var(--havi-muted-2);
  font-size: 11px;
}

.lbl-edit,
.lbl-new {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 18px;
  border-top: 1px solid var(--havi-border);
  background: var(--havi-panel);
}

.lbl-new {
  border-top: 2px dashed var(--havi-border);
}

.lbl-new-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lbl-new-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.lbl-new-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 140px;
  gap: 12px;
}

.lbl-edit-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.lbl-new .field label,
.lbl-edit .field label {
  color: var(--havi-muted-2);
  font-family: var(--havi-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hint {
  margin-top: 3px;
  color: var(--havi-muted-2);
  font-size: 10.5px;
}

.labels-empty {
  padding: 16px 18px;
  border-top: 1px solid var(--havi-border);
  color: var(--havi-muted);
  font-size: 12px;
}

.labels-archived {
  padding: 6px 0 8px;
}

.labels-archived .section-label {
  padding: 12px 18px 6px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 20px;
  padding: 0 7px;
  border: 1px solid var(--havi-border);
  border-radius: 3px;
  background: #fff;
  color: var(--havi-muted);
  font-family: var(--havi-mono);
  font-size: 10.5px;
  line-height: 1;
  white-space: nowrap;
}

.tag-dot {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: currentColor;
}

.tag.outline {
  background: #fff;
  color: var(--havi-muted);
  border-color: var(--havi-border);
}

.tag.c-amber {
  color: #b45309;
  border-color: rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.08);
}

.tag.c-red {
  color: #b91c1c;
  border-color: rgba(220, 38, 38, 0.32);
  background: rgba(220, 38, 38, 0.07);
}

.tag.c-violet {
  color: #6d28d9;
  border-color: rgba(124, 58, 237, 0.32);
  background: rgba(124, 58, 237, 0.07);
}

.tag.c-teal {
  color: #0f766e;
  border-color: rgba(13, 148, 136, 0.32);
  background: rgba(13, 148, 136, 0.07);
}

.tag.c-rose {
  color: #be185d;
  border-color: rgba(219, 39, 119, 0.32);
  background: rgba(219, 39, 119, 0.07);
}

.tag.c-slate {
  color: #475569;
  border-color: rgba(100, 116, 139, 0.32);
  background: rgba(100, 116, 139, 0.08);
}

.swatch-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 50%;
}

.sw-amber {
  background: #f59e0b;
}

.sw-red {
  background: #dc2626;
}

.sw-violet {
  background: #7c3aed;
}

.sw-teal {
  background: #0d9488;
}

.sw-rose {
  background: #db2777;
}

.sw-slate {
  background: #64748b;
}

.sw-none {
  background: #c8c8c8;
}

.k-badge {
  padding: 2px 6px;
  border: 1px solid var(--havi-border);
  border-radius: 2px;
  color: var(--havi-muted);
  font-family: var(--havi-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.sys-badge {
  padding: 1px 5px;
  border: 1px solid var(--havi-border);
  border-radius: 2px;
  color: var(--havi-muted-2);
  font-family: var(--havi-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.toggle {
  position: relative;
  display: inline-flex;
  width: 32px;
  height: 18px;
  flex: 0 0 auto;
  border-radius: 9px;
}

.toggle.on {
  background: var(--havi-amber);
}

.toggle.off {
  background: #e5e5e5;
  opacity: 0.6;
}

.toggle.locked {
  cursor: not-allowed;
}

.toggle i {
  position: absolute;
  top: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
}

.toggle.on i {
  right: 2px;
}

.toggle.off i {
  left: 2px;
}

.archived-badge {
  padding: 2px 6px;
  border: 1px solid rgba(220, 38, 38, 0.3);
  border-radius: 2px;
  color: #b91c1c;
  background: rgba(220, 38, 38, 0.06);
  font-family: var(--havi-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.restore-link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--havi-amber-strong);
  font-size: 11px;
  text-decoration: underline;
  cursor: pointer;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--havi-muted);
  cursor: pointer;
}

.icon-btn:hover {
  color: var(--havi-fg);
  background: rgba(0, 0, 0, 0.05);
}

.swatch-row {
  display: flex;
  gap: 8px;
  margin-top: 2px;
}

.swatch-btn {
  position: relative;
  display: inline-flex;
  cursor: pointer;
}

.swatch-input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
}

.swatch-dot-lg {
  display: inline-block;
  width: 22px;
  height: 22px;
  border: 2px solid transparent;
  border-radius: 50%;
}

.swatch-input:checked + .swatch-dot-lg {
  box-shadow:
    0 0 0 2px #fff,
    0 0 0 4px var(--havi-fg);
}

.swatch-input:focus-visible + .swatch-dot-lg {
  box-shadow:
    0 0 0 2px #fff,
    0 0 0 4px var(--havi-amber);
}

/* ─── Shared super-admin sidebar chrome (HaviWeb.AdminComponents.admin_shell) ─ */

.admin-content {
  height: 100vh;
  min-width: 0;
  overflow-y: auto;
}

.admin-account-email {
  margin: 0 0 8px;
  padding: 0 10px;
  overflow: hidden;
  color: var(--havi-muted-2);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ─── Super-admin console pages (users + email preview + cadence simulation) ── */

.admin-page {
  max-width: 1024px;
  margin: 32px auto;
  padding: 28px 32px 40px;
  border: 1px solid var(--havi-border);
  border-radius: 6px;
  background: var(--havi-bg);
}

.admin-page.is-wide {
  max-width: none;
  margin: 24px;
}

.admin-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.admin-title {
  margin: 6px 0 0;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.15;
}

.admin-link {
  flex: none;
  margin-top: 4px;
  color: var(--havi-muted);
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.admin-link:hover {
  color: var(--havi-fg);
}

.admin-intro {
  margin: 12px 0 26px;
  max-width: 72ch;
  color: var(--havi-muted);
  font-size: 14px;
  line-height: 1.55;
}

.admin-layout {
  display: flex;
  align-items: flex-start;
  gap: 32px;
}

.admin-nav {
  flex: 0 0 220px;
  min-width: 0;
  padding-right: 24px;
  border-right: 1px solid var(--havi-border);
}

.admin-nav-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.admin-nav-btn {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 8px 12px;
  color: var(--havi-muted);
  background: transparent;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  transition:
    color 0.15s ease,
    background-color 0.15s ease,
    border-color 0.15s ease;
}

.admin-nav-btn:hover {
  color: var(--havi-fg);
  background: rgba(0, 0, 0, 0.04);
}

.admin-nav-btn.is-active {
  color: var(--havi-amber-deep);
  border-color: rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.08);
  font-weight: 600;
}

@media (prefers-reduced-motion: reduce) {
  .admin-nav-btn {
    transition: none;
  }
}

.admin-main {
  flex: 1;
  min-width: 0;
}

.admin-main-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.admin-main-sub {
  margin: 4px 0 26px;
  color: var(--havi-muted);
  font-size: 14px;
}

@media (max-width: 760px) {
  .admin-page {
    margin: 0;
    border: 0;
    border-radius: 0;
    padding: 24px 20px 36px;
  }

  .admin-layout {
    flex-direction: column;
    gap: 24px;
  }

  .admin-nav {
    flex: none;
    width: 100%;
    padding-right: 0;
    padding-bottom: 20px;
    border-right: 0;
    border-bottom: 1px solid var(--havi-border);
  }
}

/* Cadence timeline: one row per simulated email, dotted onto a vertical rail. */
.cadence-timeline {
  margin: 0;
  padding: 0;
  list-style: none;
}

.cadence-event {
  position: relative;
  padding-left: 28px;
  padding-bottom: 26px;
}

.cadence-event::before {
  position: absolute;
  left: 5px;
  top: 4px;
  bottom: 0;
  width: 2px;
  background: var(--havi-border);
  content: "";
}

.cadence-event:last-child {
  padding-bottom: 0;
}

.cadence-event:last-child::before {
  display: none;
}

.cadence-dot {
  position: absolute;
  left: 0;
  top: 2px;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  border: 2px solid var(--havi-bg);
  background: var(--havi-muted-2);
}

.cadence-dot.sent {
  background: var(--havi-green);
  box-shadow: 0 0 0 3px rgba(4, 120, 87, 0.16);
}

.cadence-dot.suppressed {
  background: var(--havi-amber);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.18);
}

.cadence-dot.not-scheduled {
  background: #cbd5e1;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

.cadence-event-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cadence-event-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.cadence-offset {
  margin: 3px 0 8px;
  color: var(--havi-muted-2);
  font-family: var(--havi-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
}

.cadence-detail {
  margin: 2px 0;
  color: var(--havi-fg);
  font-size: 14px;
}

.cadence-strong {
  font-weight: 600;
}

.cadence-preview-link {
  margin-left: 8px;
  color: var(--havi-muted);
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cadence-preview-link:hover {
  color: var(--havi-fg);
}

/* Email preview: locale switch, header meta, rendered bodies. */
.email-locale-form {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  font-size: 14px;
}

.email-locale-form label {
  color: var(--havi-muted);
  font-weight: 600;
}

.select-inline {
  width: auto;
  min-width: 170px;
  height: 34px;
}

.email-meta {
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid var(--havi-border);
  border-radius: 4px;
  background: var(--havi-panel);
}

.email-subject {
  font-weight: 600;
}

.email-notice {
  margin: 14px 0 0;
}

.email-body {
  margin-top: 26px;
}

.email-body-label {
  margin: 0 0 8px;
  color: var(--havi-muted-2);
  font-family: var(--havi-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.email-preview-frame {
  width: 100%;
  height: 420px;
  border: 1px solid var(--havi-border);
  border-radius: 4px;
  background: #fff;
}

.email-preview-text {
  margin: 0;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--havi-border);
  border-radius: 4px;
  background: var(--havi-panel);
  font-family: var(--havi-mono);
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* ─── Admin console: funnel counters + link builder + feedback list ───────── */

.admin-section {
  margin-top: 40px;
}

.admin-section-title {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 700;
}

.admin-section-sub {
  margin: 0 0 18px;
  max-width: 72ch;
  color: var(--havi-muted);
  font-size: 14px;
  line-height: 1.55;
}

.admin-empty {
  margin: 0;
  padding: 12px 0;
  color: var(--havi-muted);
  font-size: 14px;
}

/* Funnel + signup-source tables: content-sized columns, numeric alignment. */
.funnel-table {
  table-layout: auto;
}

.table td.funnel-num,
.table th.funnel-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.funnel-nowrap {
  white-space: nowrap;
}

.funnel-day {
  display: inline-block;
  margin-right: 16px;
  white-space: nowrap;
}

.funnel-day strong {
  font-weight: 700;
}

/* Campaign tracking-link builder. */
.funnel-builder {
  margin-bottom: 14px;
}

.funnel-builder-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 16px;
}

.funnel-builder-row .field {
  flex: 1 1 180px;
  min-width: 0;
}

.funnel-link {
  background: var(--havi-panel);
  font-family: var(--havi-mono);
  font-size: 13px;
}

/* Embedded ash_panel surfaces (feedback list + detail modal). The library ships
   Tailwind class names this app has no backing for, so scope the app's real
   look onto the elements it renders. */
.ash-panel-content {
  min-width: 0;
}

.ash-panel-list-view table {
  width: 100%;
  border-collapse: collapse;
}

.ash-panel-list-view thead th {
  border-bottom: 1px solid var(--havi-border);
  padding: 0 12px 10px;
  color: var(--havi-muted-2);
  font-family: var(--havi-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.ash-panel-list-view thead th button {
  min-height: 0;
  border: 0;
  padding: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
}

.ash-panel-list-view thead th button:hover {
  color: var(--havi-fg);
}

.ash-panel-list-view tbody td {
  border-bottom: 1px solid var(--havi-border);
  padding: 12px;
  font-size: 14px;
  vertical-align: top;
}

.ash-panel-list-view tbody tr {
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.ash-panel-list-view tbody tr:hover {
  background: rgba(0, 0, 0, 0.03);
}

@media (prefers-reduced-motion: reduce) {
  .ash-panel-list-view tbody tr {
    transition: none;
  }
}

/* Inline filter controls the list view renders above the table. */
.ash-panel-list-view label {
  display: block;
  margin-bottom: 6px;
  color: var(--havi-muted-2);
  font-family: var(--havi-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ash-panel-list-view input[type="text"],
.ash-panel-list-view input[type="search"],
.ash-panel-list-view input[type="number"],
.ash-panel-list-view select {
  width: 100%;
  height: 38px;
  border: 1px solid var(--havi-border);
  border-radius: 3px;
  padding: 0 10px;
  background: #fff;
  color: var(--havi-fg);
  font-size: 14px;
  transition: border-color 0.15s ease;
}

.ash-panel-list-view input:hover,
.ash-panel-list-view select:hover {
  border-color: var(--havi-muted-2);
}

/* Pagination + clear-filter buttons (table sort buttons are reset above). */
.ash-panel-list-view button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 30px;
  border: 1px solid var(--havi-border);
  border-radius: 3px;
  padding: 0 10px;
  background: #fff;
  color: var(--havi-fg);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.ash-panel-list-view button:hover {
  border-color: var(--havi-amber);
}

/* Detail view rendered inside the feedback modal. */
.ash-panel-detail-view dl {
  margin: 0;
}

.ash-panel-detail-view dl > div {
  border-top: 1px solid var(--havi-border);
  padding: 10px 0;
}

.ash-panel-detail-view dl > div:first-child {
  border-top: 0;
}

.ash-panel-detail-view dt {
  color: var(--havi-muted-2);
  font-family: var(--havi-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ash-panel-detail-view dd {
  margin: 4px 0 0;
  color: var(--havi-fg);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.ash-panel-detail-view h3 {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 700;
}

.ash-panel-detail-view h4 {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 600;
}
