:root {
  color-scheme: light;
  --ink: #151515;
  --muted: #696966;
  --paper: #f5f4f0;
  --white: #ffffff;
  --line: #d9d8d2;
  --acid: #c8ff19;
  --danger: #b42318;
  --success: #087443;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
  font-family: Arial, Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--paper);
  font-size: 14px;
  line-height: 1.45;
}

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

button,
select,
input,
textarea {
  border-radius: 4px;
}

button {
  cursor: pointer;
}

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

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

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

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  border-top: 8px solid var(--acid);
}

.login-panel {
  width: min(100%, 430px);
  padding: 36px;
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.wordmark-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 25px;
  background: var(--acid);
  border: 1px solid var(--ink);
  font-size: 12px;
}

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

.login-panel h1 {
  margin: 46px 0 24px;
  font-size: 30px;
  line-height: 1.12;
}

.stack-form {
  display: grid;
  gap: 16px;
}

.stack-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  padding: 10px 11px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
}

textarea {
  min-height: 104px;
  resize: vertical;
}

.button {
  min-height: 40px;
  padding: 9px 13px;
  border: 1px solid var(--ink);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

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

.button-dark {
  color: var(--white);
  background: var(--ink);
}

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

.form-error {
  min-height: 18px;
  margin: 0;
  color: var(--danger);
  font-size: 12px;
}

.console-shell {
  min-height: 100vh;
  border-top: 7px solid var(--acid);
}

.topbar {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 20px;
  background: var(--white);
  border-bottom: 1px solid var(--line);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.signed-in-user {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(420px, 1.45fr) minmax(280px, 0.82fr);
  min-height: calc(100vh - 73px);
}

.lead-pane,
.activity-pane,
.detail-pane {
  min-width: 0;
  padding: 24px;
}

.lead-pane,
.activity-pane {
  background: var(--white);
}

.lead-pane {
  border-right: 1px solid var(--line);
}

.activity-pane {
  border-left: 1px solid var(--line);
}

.pane-heading,
.customer-header,
.approval-footer,
.dialog-heading,
.audit-item-top,
.customer-row-top,
.owner-actions,
.user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pane-heading {
  margin-bottom: 19px;
}

.pane-heading h2,
.section-heading h2,
.owner-tools h2 {
  margin: 0;
  font-size: 17px;
  line-height: 1.2;
}

.eyebrow {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.count-badge {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--ink);
  background: var(--acid);
  font-size: 12px;
  font-weight: 700;
}

.search-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.search-controls select {
  grid-column: 1 / -1;
}

.list-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 16px 0 12px;
}

.sync-status,
.audit-meta,
.customer-contact,
.customer-row-meta,
.tag-summary {
  color: var(--muted);
  font-size: 12px;
}

.customer-list,
.audit-list,
.user-list {
  display: grid;
  gap: 8px;
}

.customer-row {
  width: 100%;
  min-height: 72px;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 11px;
  text-align: left;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
}

.customer-row:hover,
.customer-row.is-selected {
  border-color: var(--ink);
  background: #fbfbf8;
}

.customer-row strong,
.customer-row-meta,
.user-row span:first-child,
.audit-item p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-dot,
.audit-outcome {
  flex: 0 0 auto;
  padding: 2px 5px;
  border: 1px solid currentColor;
  font-size: 10px;
  font-weight: 700;
}

.status-dot.is-approved,
.audit-outcome.is-success {
  color: var(--success);
}

.status-dot.is-pending,
.audit-outcome.is-failed {
  color: var(--danger);
}

.detail-pane {
  background: var(--paper);
}

.customer-detail,
.empty-state {
  height: 100%;
}

.empty-state {
  display: grid;
  align-content: center;
  min-height: 380px;
  border-top: 1px solid var(--line);
}

.empty-state h2 {
  margin: 0;
  font-size: 27px;
  line-height: 1.1;
}

.customer-header {
  align-items: flex-start;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.customer-header h1 {
  margin-bottom: 6px;
  font-size: 27px;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.customer-contact {
  margin: 0;
  overflow-wrap: anywhere;
}

.customer-id {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
}

.approval-form {
  display: grid;
}

.approval-section {
  padding: 23px 0;
  border-bottom: 1px solid var(--line);
}

.section-heading {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 16px;
}

.section-heading .eyebrow {
  min-width: 20px;
}

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

.brand-option,
.price-option {
  position: relative;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 9px;
  background: var(--white);
  border: 1px solid var(--line);
  cursor: pointer;
  overflow: hidden;
}

.brand-option:has(input:checked),
.price-option:has(input:checked) {
  border-color: var(--ink);
  box-shadow: inset 4px 0 0 var(--acid);
}

.brand-option span,
.price-option span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-option input,
.price-option input {
  width: 15px;
  min-height: 15px;
  padding: 0;
  accent-color: var(--ink);
}

.price-levels {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.approval-footer {
  align-items: flex-end;
  padding-top: 20px;
}

.tag-summary {
  max-width: 60%;
  margin: 0;
  overflow-wrap: anywhere;
}

.audit-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.audit-item p {
  margin: 5px 0 0;
  font-size: 12px;
}

.audit-item .audit-meta {
  margin-top: 7px;
  font-size: 11px;
}

.owner-tools {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 2px solid var(--ink);
}

.owner-tools-heading {
  margin-bottom: 13px;
}

.owner-actions {
  align-items: stretch;
  margin-bottom: 14px;
}

.owner-actions .button {
  min-width: 0;
  flex: 1 1 0;
}

.user-row {
  min-height: 36px;
  padding: 7px 0;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.list-empty {
  padding: 16px 0;
  color: var(--muted);
  font-size: 12px;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 5;
  max-width: min(420px, calc(100vw - 40px));
  padding: 12px 14px;
  color: var(--white);
  background: var(--success);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast[data-tone="error"] {
  background: var(--danger);
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.dialog {
  width: min(100% - 32px, 460px);
  padding: 0;
  background: var(--white);
  border: 1px solid var(--ink);
  box-shadow: var(--shadow);
}

.dialog::backdrop {
  background: rgba(0, 0, 0, 0.38);
}

.dialog-form {
  padding: 24px;
}

.dialog-heading {
  margin-bottom: 8px;
}

.dialog-heading h2 {
  margin: 0;
  font-size: 20px;
}

.dialog-close {
  border: 0;
  padding: 5px 0;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  text-decoration: underline;
}

@media (max-width: 1180px) {
  .workspace {
    grid-template-columns: minmax(280px, 0.9fr) minmax(400px, 1.4fr);
  }

  .activity-pane {
    grid-column: 1 / -1;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .audit-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
  }

  .owner-tools {
    max-width: 520px;
  }
}

@media (max-width: 760px) {
  .topbar,
  .topbar-actions,
  .approval-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar {
    gap: 12px;
  }

  .topbar-actions {
    width: 100%;
  }

  .topbar-actions .button {
    width: 100%;
  }

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

  .lead-pane,
  .activity-pane {
    border-right: 0;
    border-left: 0;
  }

  .lead-pane,
  .detail-pane,
  .activity-pane {
    padding: 20px;
  }

  .detail-pane {
    border-top: 1px solid var(--line);
  }

  .brand-grid,
  .price-levels,
  .audit-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .tag-summary {
    max-width: none;
  }

  .approval-footer .button {
    width: 100%;
  }
}
