/* Design tokens adapted from enterprise-ui 4d79a2791526f06516270128dcf78f1160d4fb86. See docs/UI-PROVENANCE.md. */
.hv-root {
  font-family:
    Inter,
    Geist,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: oklch(0.24 0.026 258);
  background: oklch(0.975 0.006 255);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --app: oklch(0.975 0.006 255);
  --surface: oklch(1 0 0);
  --surface-raised: oklch(1 0 0);
  --surface-subtle: oklch(0.985 0.004 255);
  --surface-muted: oklch(0.958 0.008 255);
  --surface-inset: oklch(0.952 0.009 255);
  --foreground: oklch(0.24 0.026 258);
  --foreground-soft: oklch(0.37 0.028 258);
  --muted: oklch(0.53 0.027 258);
  --muted-strong: oklch(0.45 0.029 258);
  --border: oklch(0.91 0.012 255);
  --border-strong: oklch(0.84 0.018 255);
  --accent: #4f46e5;
  --accent-strong: #3730a3;
  --accent-soft: #eef2ff;
  --accent-border: #d9ddff;
  --success: #13795b;
  --success-soft: #eaf8f1;
  --warning: #a15c08;
  --warning-soft: #fff7e5;
  --danger: #b4233b;
  --danger-soft: #fff0f2;
  --info: #2463a8;
  --info-soft: #eef6ff;
  --sidebar-bg: #111827;
  --sidebar-raised: #182234;
  --sidebar-text: #dbe4f2;
  --sidebar-muted: #8e9bb0;
  --sidebar-border: rgba(255, 255, 255, 0.085);
  --chart-primary: var(--accent);
  --chart-secondary: #91a0b7;
  --chart-success: var(--success);
  --chart-warning: var(--warning);
  --chart-danger: var(--danger);
  --chart-grid: color-mix(in srgb, var(--border) 72%, transparent);
  --chart-axis: var(--muted);
  --focus: color-mix(in srgb, var(--accent) 58%, white);
  --radius-sm: 8px;
  --radius-md: 11px;
  --radius-lg: 15px;
  --radius-xl: 18px;
  --shadow-card:
    0 1px 2px rgba(15, 23, 42, 0.03), 0 12px 30px rgba(15, 23, 42, 0.035);
  --shadow-overlay: 0 28px 90px rgba(15, 23, 42, 0.22);
  --sidebar-width: 256px;
  --sidebar-collapsed: 72px;
  --header-height: 64px;
  --page-padding: clamp(18px, 2.1vw, 36px);
  --section-gap: 14px;
  --motion-fast: 140ms;
  --motion-default: 190ms;
  --motion-slow: 240ms;
  --ease-standard: cubic-bezier(0.2, 0, 0, 1);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select {
  font: inherit;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
.hv-root {
  min-height: 100vh;
  background: var(--app);
  color: var(--foreground);
  font-size: 14px;
  line-height: 1.5;
}
h1,
h2,
h3,
h4,
p {
  margin: 0;
}
button {
  transition:
    background 0.15s,
    color 0.15s;
}
.sr-only,
.skip:not(:focus) {
  position: absolute;
  clip: rect(0, 0, 0, 0);
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.skip:focus {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  background: white;
  padding: 12px;
}
.topbar {
  height: 78px;
  padding: 0 36px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: flex;
  align-items: center;
  gap: 13px;
}
.brand-icon {
  width: 43px;
  height: 43px;
  background: var(--accent);
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: white;
  box-shadow: 0 4px 10px #4f46e51a;
}
.brand strong {
  display: block;
  font-size: 19px;
  letter-spacing: -0.5px;
}
.brand span:not(.brand-icon) {
  display: block;
  font-size: 12px;
  color: var(--muted);
}
.topright {
  display: flex;
  gap: 20px;
  align-items: center;
}
.mode {
  font-size: 12px;
  border: 1px solid #eadfc7;
  background: #fffaf0;
  padding: 5px 10px;
  border-radius: 20px;
  color: #795518;
  display: flex;
  align-items: center;
  gap: 6px;
}
.mode i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #c88a27;
}
.avatar,
.mini-avatar {
  display: grid;
  place-items: center;
  background: #e9e8fc;
  color: #5145a4;
  font-size: 12px;
  font-weight: 700;
  border-radius: 50%;
  width: 34px;
  height: 34px;
}
.nav {
  height: 53px;
  background: white;
  padding: 0 36px;
  display: flex;
  gap: 26px;
  align-items: stretch;
  border-bottom: 1px solid var(--border);
}
.nav button {
  border: 0;
  background: transparent;
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  padding: 0 2px;
  border-bottom: 2px solid transparent;
}
.nav button.selected {
  color: var(--accent);
  border-color: var(--accent);
  font-weight: 650;
}
.nav-note {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}
.main {
  width: 100%;
  min-width: 0;
  margin: auto;
  padding: 34px 36px 36px;
}
.pagehead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 22px;
}
.eyebrow {
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 1.4px;
  color: var(--muted);
  display: block;
  margin-bottom: 8px;
}
h1 {
  font-size: 29px;
  letter-spacing: -1px;
  line-height: 1.3;
}
.pagehead p {
  color: var(--muted);
  margin-top: 7px;
  font-size: 13px;
}
.sync-status {
  display: flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  margin: -10px 0 18px;
  color: var(--muted);
  font-size: 12px;
}
.sync-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2f9e6f;
}
.sync-dot.failed {
  background: #c23b3b;
}
.sync-notice {
  margin: 0 0 14px;
  padding: 9px 12px;
  border: 1px solid #e8d9ad;
  border-radius: 8px;
  background: #fffaf0;
  color: #795518;
  font-size: 12px;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 15px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.secondary {
  background: white;
  color: var(--foreground-soft);
}
.secondary:hover {
  background: var(--surface-subtle);
}
.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.primary:hover {
  background: var(--accent-strong);
}
.icon-button {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 7px;
  flex-shrink: 0;
}
.icon-button:hover {
  background: var(--surface-muted);
  color: var(--accent);
}
.demo-notice {
  border: 1px solid #e4dfcf;
  background: #fffdf7;
  border-radius: 8px;
  padding: 10px 13px;
  display: flex;
  gap: 10px;
  font-size: 12px;
  color: #7d6a40;
  margin-bottom: 22px;
  align-items: center;
}
.demo-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #b38d40;
  flex-shrink: 0;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
  margin-bottom: 27px;
}
.metric {
  text-align: left;
  padding: 19px 21px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--muted);
  box-shadow: 0 2px 3px #17233b03;
}
.metric:hover {
  border-color: var(--accent-border);
  background: #fdfdff;
}
.metric-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
}
.metric-top svg {
  color: #8b90a5;
}
.metric > strong {
  display: block;
  font-size: 33px;
  letter-spacing: -1px;
  color: var(--foreground);
  line-height: 1.3;
  margin: 12px 0 4px;
}
.metric > span:last-child {
  font-size: 11px;
}
.metric.attention > strong,
.metric.attention svg {
  color: var(--danger);
}
.list-panel {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.list-title {
  padding: 21px 22px 17px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.list-title h2 {
  font-size: 16px;
  font-weight: 650;
  display: flex;
  gap: 9px;
  align-items: center;
}
.list-title p {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
}
.count {
  font-weight: 600;
  color: #647089;
  font-size: 11px;
  border-radius: 5px;
  background: #f0f2f6;
  padding: 2px 7px;
}
.small-note {
  font-size: 11px;
  color: var(--muted);
  display: flex;
  gap: 6px;
  align-items: center;
}
.filters {
  display: flex;
  gap: 12px;
  padding: 0 22px 15px;
}
.search {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 7px;
  gap: 9px;
  padding: 0 11px;
  flex: 1;
  max-width: 530px;
  color: var(--muted);
  background: #fcfcfd;
}
.search input {
  border: 0;
  outline: none;
  background: transparent;
  flex: 1;
  min-width: 0;
  height: 39px;
  font-size: 12px;
}
.owner-filter {
  display: flex;
  align-items: center;
  padding: 0 11px;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--muted);
}
.owner-filter select {
  background: transparent;
  border: 0;
  color: var(--foreground-soft);
  height: 39px;
  font-size: 12px;
  max-width: 200px;
}
.pills {
  display: flex;
  gap: 5px;
  padding: 0 22px 17px;
  flex-wrap: wrap;
}
.pills button {
  background: white;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 11px;
  color: var(--muted);
}
.pills button:hover {
  background: var(--surface-subtle);
}
.pills button.active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent-border);
  font-weight: 650;
}
.table-wrap {
  overflow-x: auto;
  transition: opacity 0.15s;
}
.is-loading {
  opacity: 0.45;
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 12px;
}
th {
  font-size: 10px;
  letter-spacing: 0.35px;
  font-weight: 600;
  color: var(--muted);
  background: #f8fafb;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
td {
  padding: 18px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
td:first-child,
th:first-child {
  padding-left: 22px;
}
td:first-child {
  min-width: 260px;
}
td:nth-child(2) {
  min-width: 150px;
}
td:nth-child(3) {
  min-width: 135px;
}
td:nth-child(5) {
  min-width: 175px;
}
td:last-child {
  padding-right: 13px;
}
tbody tr:hover {
  background: #fcfcff;
}
tbody tr:last-child td {
  border-bottom: 0;
}
td small {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-top: 5px;
}
td strong {
  font-weight: 600;
}
.name-button {
  display: flex;
  align-items: center;
  gap: 11px;
  text-align: left;
  border: 0;
  background: none;
  padding: 0;
  color: inherit;
}
.name-button strong {
  font-size: 12px;
  line-height: 1.45;
  display: block;
}
.name-button:hover strong {
  color: var(--accent);
}
.org-icon {
  border: 1px solid var(--border);
  border-radius: 9px;
  width: 38px;
  height: 40px;
  background: #f7f8fc;
  color: #818ba4;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.person {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
}
.mini-avatar {
  height: 24px;
  width: 24px;
  font-size: 10px;
}
.note-cell {
  width: 29%;
  min-width: 200px;
}
.note-text {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 11px;
  line-height: 1.65;
  color: #626e83;
  max-width: 320px;
}
.badge {
  display: inline-flex;
  align-items: center;
  font-size: 9px;
  font-weight: 650;
  padding: 3px 7px;
  border-radius: 5px;
  background: var(--surface-muted);
  color: var(--muted);
  white-space: nowrap;
}
.wait {
  background: var(--warning-soft);
  color: var(--warning);
}
.danger {
  background: var(--danger-soft);
  color: var(--danger);
}
.ok {
  background: var(--success-soft);
  color: var(--success);
}
.neutral {
  background: #f0f2f7;
  color: #636f87;
}
td .wait {
  margin-top: 7px;
}
.next-action {
  display: block;
  margin-top: 6px;
  font-size: 11px;
}
.red {
  color: var(--danger) !important;
}
.list-footer {
  padding: 13px 22px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 11px;
  align-items: center;
}
.list-footer div {
  display: flex;
  align-items: center;
  gap: 8px;
}
.footnote {
  display: flex;
  gap: 7px;
  align-items: center;
  color: var(--muted);
  font-size: 11px;
  margin: 19px 2px;
}
.empty {
  padding: 52px 22px;
  text-align: center;
  color: var(--muted);
}
.empty > svg {
  color: #9aa4b5;
}
.empty h2,
.empty h3 {
  margin-top: 12px;
  color: var(--foreground);
  font-size: 18px;
}
.empty p {
  max-width: 600px;
  margin: 9px auto 18px;
}
.error,
.success {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 12px 14px;
  border-radius: 8px;
  margin-bottom: 17px;
  font-size: 13px;
}
.error {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid #f8dce2;
}
.success {
  background: var(--success-soft);
  color: var(--success);
  align-items: center;
}
.error svg {
  flex-shrink: 0;
}
.success button {
  margin-left: auto;
}
.history article {
  display: flex;
  gap: 16px;
  padding: 24px;
  border-bottom: 1px solid var(--border);
}
.history article p {
  font-size: 12px;
  color: var(--muted);
  margin: 5px 0;
}
.history small {
  font-size: 11px;
  color: var(--muted);
}
.history-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--success-soft);
  color: var(--success);
  display: grid;
  place-items: center;
}
.detail {
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 16px;
  width: min(860px, calc(100vw - 32px));
  max-height: calc(100dvh - 40px);
  color: var(--foreground);
  background: white;
  box-shadow: var(--shadow-overlay);
}
.detail::backdrop {
  background: #111d3859;
  backdrop-filter: blur(3px);
}
.dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 25px 28px 20px;
  border-bottom: 1px solid var(--border);
}
.dialog-header h2 {
  font-size: 22px;
  letter-spacing: -0.5px;
}
.dialog-header p {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}
.dialog-body {
  padding: 24px 28px;
  max-height: calc(100dvh - 255px);
  min-height: 180px;
  overflow: auto;
}
.dialog-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 17px 24px;
  border-top: 1px solid var(--border);
  background: #fafbfd;
}
.dialog-footer > div {
  display: flex;
  gap: 9px;
}
.detail-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  margin-bottom: 20px;
}
.detail-meta span {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 5px;
}
.detail-meta strong {
  font-size: 13px;
}
.last-note {
  padding: 15px 17px;
  background: #f8f9fc;
  border: 1px solid var(--border);
  border-radius: 9px;
  margin-bottom: 25px;
}
.last-note > div {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 11px;
  color: var(--muted);
}
.last-note small {
  margin-left: auto;
  font-size: 10px;
}
.last-note p {
  font-size: 12px;
  line-height: 1.75;
  margin-top: 9px;
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 7px;
}
.section-head h3 {
  font-size: 15px;
}
.section-head > span {
  font-size: 11px;
  color: var(--muted);
}
.help {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.7;
}
.deal-list {
  display: grid;
  gap: 8px;
  margin: 15px 0;
}
.deal {
  display: flex;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--border);
  padding: 13px;
  border-radius: 9px;
  cursor: pointer;
}
.deal.chosen {
  border-color: var(--accent-border);
  background: #fafaff;
}
input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.deal-main {
  flex: 1;
}
.deal-main strong {
  display: block;
  font-size: 13px;
}
.deal small {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-top: 5px;
}
.deal-right {
  text-align: right;
}
.group-line {
  display: flex;
  gap: 5px;
  align-items: center;
  margin-top: 6px;
  color: var(--accent);
  font-size: 10px;
}
.override {
  color: var(--warning) !important;
}
.scope-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 11px;
  color: var(--muted);
  margin-top: 18px;
}
.scope-note svg {
  flex-shrink: 0;
}
.selection-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 18px;
}
.selection-summary strong {
  font-size: 12px;
}
.selection-summary span {
  width: 100%;
  font-size: 11px;
  color: var(--muted);
}
.mode-choice {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}
.mode-choice label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
}
.mode-choice label.checked {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.mode-choice strong {
  font-size: 12px;
  display: block;
}
.mode-choice small {
  font-size: 10px;
  color: var(--muted);
}
.group-fields {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}
.group-fields label {
  font-size: 11px;
  color: var(--muted);
}
.group-fields input,
.group-fields select {
  display: block;
  width: 100%;
  margin-top: 5px;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: white;
  color: var(--foreground);
  font-size: 12px;
}
.dialog-body h3 {
  font-size: 16px;
  margin-bottom: 7px;
}
.edit-fields {
  border: 1px solid var(--border);
  border-radius: 9px;
  overflow: hidden;
  margin-top: 14px;
}
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: center;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  background: #fafbfc;
}
.field-row:last-child {
  border: 0;
}
.field-row.enabled {
  background: white;
}
.field-check {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
}
.field-row > select,
.field-row > input {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: white;
  color: var(--foreground);
  font-size: 12px;
  min-width: 0;
}
.field-row > select:disabled,
.field-row > input:disabled {
  opacity: 0.4;
}
.preview-intro {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 20px;
  color: var(--accent);
}
.preview-intro p {
  color: var(--muted);
  font-size: 12px;
}
.change {
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: 9px;
  margin-bottom: 12px;
}
.change h4 {
  font-size: 13px;
  margin-bottom: 12px;
}
.change h4 span {
  float: right;
  color: var(--muted);
  font-weight: 400;
  font-size: 11px;
}
.diff {
  display: grid;
  grid-template-columns: 1fr 1fr 16px 1fr;
  gap: 10px;
  font-size: 11px;
  padding: 7px 0;
  align-items: center;
}
.diff > span {
  color: var(--muted);
}
.diff del {
  color: #9aa2af;
  text-decoration: none;
}
.diff strong {
  color: var(--accent);
  font-weight: 600;
}
.protected {
  display: flex;
  gap: 5px;
  align-items: center;
  color: var(--warning);
  font-size: 11px;
  margin-top: 10px;
}
.receipt {
  text-align: center;
  padding: 22px 10px;
}
.receipt-icon {
  display: inline-grid;
  place-items: center;
  width: 60px;
  height: 60px;
  background: var(--success-soft);
  color: var(--success);
  border-radius: 50%;
  margin-bottom: 18px;
}
.receipt p {
  max-width: 470px;
  margin: 10px auto 20px;
  color: var(--muted);
  font-size: 13px;
}
.receipt small {
  font-size: 10px;
  color: var(--muted);
}
.spin {
  animation: spin 1s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
@media (max-width: 1000px) {
  .topbar {
    padding: 0 22px;
  }
  .nav {
    padding: 0 22px;
  }
  .main {
    padding: 25px 22px;
  }
  .metrics {
    gap: 10px;
  }
  .metric {
    padding: 16px;
  }
  .nav-note {
    display: none;
  }
  .pagehead h1 {
    font-size: 25px;
  }
  .topright {
    gap: 10px;
  }
}
@media (max-width: 650px) {
  .topbar {
    height: 67px;
    padding: 0 15px;
  }
  .brand strong {
    font-size: 17px;
  }
  .brand span:not(.brand-icon) {
    font-size: 10px;
  }
  .avatar {
    display: none;
  }
  .mode {
    font-size: 9px;
    padding: 4px 7px;
  }
  .nav {
    padding: 0 15px;
    height: 46px;
  }
  .main {
    padding: 23px 14px;
  }
  .pagehead {
    align-items: flex-start;
  }
  .pagehead h1 {
    font-size: 23px;
  }
  .pagehead p {
    font-size: 12px;
  }
  .pagehead > .button {
    font-size: 0;
    padding: 9px;
  }
  .pagehead > .button svg {
    width: 17px;
  }
  .metrics {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
  }
  .metric > strong {
    font-size: 28px;
  }
  .metric > span:last-child {
    font-size: 10px;
  }
  .filters {
    padding: 0 14px 12px;
    flex-wrap: wrap;
    gap: 8px;
  }
  .search {
    min-width: 100%;
  }
  .owner-filter {
    height: 35px;
  }
  .pills {
    padding: 0 14px 12px;
    gap: 2px;
  }
  .pills button {
    font-size: 10px;
    padding: 6px 7px;
  }
  .list-title {
    padding: 17px 14px;
  }
  .small-note {
    display: none;
  }
  .list-footer {
    padding: 10px 12px;
  }
  .footnote {
    align-items: flex-start;
    font-size: 10px;
  }
  .footnote svg {
    flex-shrink: 0;
  }
  .demo-notice {
    font-size: 10px;
  }
  .detail {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
    border-radius: 10px;
  }
  .dialog-header {
    padding: 18px;
  }
  .dialog-header h2 {
    font-size: 19px;
  }
  .dialog-body {
    padding: 18px;
    max-height: calc(100dvh - 230px);
  }
  .dialog-footer {
    padding: 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .dialog-footer > .help {
    display: none;
  }
  .detail-meta {
    gap: 9px;
  }
  .detail-meta strong {
    font-size: 11px;
  }
  .detail-meta span {
    font-size: 10px;
  }
  .last-note small {
    display: none;
  }
  .deal {
    gap: 8px;
    padding: 10px;
  }
  .deal-right small {
    font-size: 9px;
  }
  .deal-main strong {
    font-size: 12px;
  }
  .mode-choice {
    grid-template-columns: 1fr;
  }
  .group-fields {
    grid-template-columns: 1fr;
  }
  .field-row {
    grid-template-columns: 1fr;
    padding: 10px;
  }
  .diff {
    grid-template-columns: 1fr 1fr 14px 1fr;
    gap: 5px;
    font-size: 10px;
  }
  .history article {
    padding: 18px;
  }
}

.personal-switch {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.personal-switch button {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  background: white;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 20px;
  color: var(--muted);
}
.personal-switch button.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}
.personal-switch strong {
  display: block;
  font-size: 14px;
}
.personal-switch small {
  display: block;
  margin-top: 4px;
  font-size: 11px;
}
.scope-description {
  margin: 12px 0 20px;
  color: var(--muted);
  font-size: 12px;
}
.column-sort {
  display: flex;
  align-items: center;
  gap: 7px;
  background: none;
  border: 0;
  padding: 0;
  color: var(--foreground);
  font-weight: 600;
  margin-bottom: 10px;
}
.column-search {
  display: flex;
  align-items: center;
  gap: 5px;
}
.column-search input,
th select {
  width: 100%;
  min-width: 110px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px;
  background: white;
  color: var(--foreground-soft);
  font-size: 11px;
}
.object-filters {
  display: grid;
  gap: 4px;
}
th {
  vertical-align: top;
}
th small {
  display: block;
  margin-top: 8px;
  font-weight: 400;
}
.organization-row {
  cursor: pointer;
}
.organization-row:hover,
.organization-row.expanded {
  background: var(--accent-soft);
}
.expanded-row[hidden] {
  display: none;
}
.expanded-row > td {
  padding: 0;
}
.expanded-content {
  padding: 18px 22px 22px;
  background: #f8f9fc;
  border-bottom: 1px solid var(--border);
}
.expanded-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.inline-objects {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 7px;
}
.inline-objects li {
  display: grid;
  grid-template-columns: 2fr 1fr 1.3fr auto;
  align-items: center;
  gap: 15px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 13px;
  font-size: 12px;
}
.inline-objects small {
  display: block;
  font-size: 10px;
  margin-top: 5px;
  color: var(--muted);
}
.crm-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--accent);
  padding: 6px;
  border-radius: 5px;
  white-space: nowrap;
  font-size: 11px;
  text-decoration: none;
}
.crm-link:hover {
  background: var(--accent-soft);
  text-decoration: underline;
}
.organization-row .crm-link span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.crm-unavailable {
  font-size: 10px;
  color: var(--muted);
}
.assignment-notice {
  margin-top: 18px;
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: 9px;
  font-size: 12px;
  background: white;
}
.assignment-notice summary {
  cursor: pointer;
  color: var(--warning);
}
.assignment-notice p {
  margin: 12px 0;
  color: var(--muted);
}
@media (max-width: 650px) {
  .personal-switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .personal-switch button {
    padding: 12px;
  }
  .personal-switch svg {
    display: none;
  }
  .personal-switch strong {
    font-size: 12px;
  }
  .personal-switch small {
    font-size: 10px;
  }
  .inline-objects li {
    grid-template-columns: 1fr 1fr;
  }
}

.deal-value {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--foreground);
  font-variant-numeric: tabular-nums;
}

.table-wrap th.note-header,
.table-wrap td.note-cell {
  display: table-cell;
}

.activity-list {
  min-width: 220px;
  max-width: 320px;
}
.table-wrap td.next-step-cell.needs-attention {
  background: #fee2e2;
  box-shadow: inset 3px 0 #dc2626;
}
.next-step-cell.needs-attention > .help {
  color: #991b1b;
  font-weight: 600;
}
.activity-list ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.activity-list li {
  border-bottom: 1px solid var(--border);
  padding: 9px 0;
}
.activity-list li:last-child {
  border-bottom: 0;
}
.activity-list li strong {
  display: block;
  font-size: 11px;
  line-height: 1.5;
}
.activity-count {
  margin-bottom: 4px;
}
.activity-due {
  display: block;
  margin-top: 3px;
  font-size: 10px;
  color: var(--muted);
}
.activity-source {
  font-size: 10px;
  line-height: 1.5;
  color: var(--muted);
}
.activity-source a {
  color: var(--muted);
  text-decoration: none;
}
.activity-source a:hover {
  color: var(--accent);
  text-decoration: underline;
}
.activity-more {
  padding: 5px 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 11px;
  text-align: left;
}

.metrics {
  grid-template-columns: minmax(0, 1.5fr) repeat(4, minmax(0, 1fr));
}
.metric-total {
  background: var(--accent-soft);
  border-color: var(--accent-border);
}
.metric.metric-good {
  background: #f0fdf4;
  border-color: #86efac;
}
.metric.metric-good > strong {
  color: #15803d;
}
.metric.metric-warning {
  background: #fff7ed;
  border-color: #fdba74;
}
.metric.metric-warning > strong {
  color: #c2410c;
}
.metric.metric-danger {
  background: #fef2f2;
  border-color: #fca5a5;
}
.metric.metric-danger > strong {
  color: #b91c1c;
}
.metric-total > strong {
  font-size: clamp(20px, 2vw, 28px);
  overflow-wrap: anywhere;
  color: var(--accent);
}
.note-cell {
  width: auto;
  min-width: 135px;
}
.value-cell {
  min-width: 155px;
  font-variant-numeric: tabular-nums;
}
.note-date-button {
  border: 1px solid var(--accent-border);
  border-radius: 7px;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.note-date-button:hover {
  text-decoration: underline;
}
.note-date-large {
  display: block;
  color: var(--accent);
  font-size: 16px;
  font-weight: 600;
  margin-top: 10px;
}
.note-full {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 14px;
  line-height: 1.8;
}
.assignment-since {
  font-variant-numeric: tabular-nums;
}
@media (max-width: 1000px) {
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .metric-total {
    grid-column: span 2;
  }
}
/* Pipedrive embedding: the custom modal uses the full available width. */
.pd-modal .main {
  max-width: none;
  padding: 16px 20px 20px;
}
.launcher {
  padding: 16px;
  display: grid;
  gap: 12px;
  font-size: 14px;
}
.launcher h1 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  margin: 0;
}
.launcher p {
  margin: 0;
}
.launcher .button {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.launcher-hint {
  font-size: 12px;
  color: var(--muted);
}
/* Use the available viewport, including narrow Pipedrive modal frames. */
.hv-root {
  overflow-wrap: anywhere;
}
.topbar,
.topright,
.pagehead,
.list-title,
.list-footer,
.expanded-heading {
  flex-wrap: wrap;
  gap: 12px;
}
.topbar {
  height: auto;
  min-height: 78px;
  padding-block: 12px;
}
.brand,
.brand > div,
.metric,
.metric-top,
.personal-switch button,
.personal-switch button > span,
.name-button,
.name-button > span,
.inline-objects li > * {
  min-width: 0;
}
.brand-icon,
.metric-top svg,
.name-button > svg,
.column-sort svg,
.column-search svg,
.crm-link svg {
  flex-shrink: 0;
}
.personal-switch button {
  max-width: 100%;
}
.overview-table {
  table-layout: fixed;
}
.overview-table th,
.overview-table td,
.overview-table .activity-list {
  min-width: 0;
  white-space: normal;
}
.overview-table th:nth-child(1) {
  width: 21%;
}
.overview-table th:nth-child(2) {
  width: 12%;
}
.overview-table th:nth-child(3) {
  width: 14%;
}
.overview-table th:nth-child(4) {
  width: 13%;
}
.overview-table th:nth-child(5) {
  width: 12%;
}
.overview-table th:nth-child(6) {
  width: 24%;
}
.overview-table th:nth-child(7) {
  width: 4%;
}
.overview-table th:last-child,
.overview-table .organization-row > td:last-child {
  padding-inline: 8px;
}
.overview-table .column-search input,
.overview-table select {
  min-width: 0;
  max-width: 100%;
}
.overview-table .column-sort,
.overview-table .note-date-button,
.overview-table .badge,
.expanded-heading .button {
  white-space: normal;
  overflow-wrap: anywhere;
}
.inline-objects li {
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1.3fr) minmax(
      0,
      1fr
    );
}
.inline-objects .crm-link {
  white-space: normal;
}

/* Keep every field and filter visible instead of scrolling the whole table. */
@media (max-width: 1200px) {
  .overview-table,
  .overview-table thead,
  .overview-table tbody {
    display: block;
    width: 100%;
  }
  .overview-table thead > tr,
  .overview-table .organization-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .overview-table thead > tr {
    padding: 12px;
    gap: 12px;
    background: var(--surface-subtle);
    border-block: 1px solid var(--border);
  }
  .overview-table th,
  .overview-table td {
    display: block;
    width: auto;
    padding: 12px;
    border: 0;
  }
  .overview-table th:nth-child(n) {
    width: auto;
    padding: 0;
    background: none;
  }
  .overview-table th:nth-child(4),
  .overview-table th:nth-child(6),
  .overview-table th:nth-child(7) {
    display: none;
  }
  .overview-table .organization-row {
    padding: 12px;
    border-bottom: 1px solid var(--border);
  }
  .overview-table .organization-row > td::before {
    content: attr(data-label);
    display: block;
    color: var(--muted);
    font-size: 10px;
    font-weight: 600;
    margin-bottom: 6px;
  }
  .overview-table .organization-row > td:first-child,
  .overview-table .next-step-cell,
  .overview-table .organization-row > td:last-child {
    grid-column: 1 / -1;
  }
  .overview-table .activity-list {
    max-width: none;
  }
  .overview-table .note-cell {
    display: block;
  }
  .overview-table .expanded-row:not([hidden]) {
    display: block;
  }
  .overview-table .expanded-row > td {
    padding: 0;
  }
  .organization-row .crm-link span {
    position: static;
    width: auto;
    height: auto;
    clip-path: none;
  }
}
@media (max-width: 650px) {
  .pd-modal .main {
    padding: 23px 14px;
  }
  .personal-switch {
    grid-template-columns: minmax(0, 1fr);
  }
  .inline-objects li {
    grid-template-columns: minmax(0, 1fr);
  }
  .overview-table .organization-row,
  .overview-table thead > tr {
    grid-template-columns: minmax(0, 1fr);
  }
  .metrics {
    grid-template-columns: minmax(0, 1fr);
  }
  .metric-total {
    grid-column: auto;
  }
}
