.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.page-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.button svg { width: 17px; height: 17px; flex: none; }
.button:disabled { opacity: 0.45; cursor: default; transform: none; }
.button-primary:disabled { background: var(--hover); color: var(--text-2); box-shadow: none; filter: none; opacity: 1; }
a.button { color: inherit; }
a.button-primary { color: var(--on-sun); }

.card {
  border-radius: var(--radius-l);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--pill) 13%, transparent);
  color: var(--pill);
  font-size: var(--text-s);
  font-weight: 600;
  white-space: nowrap;
}

[data-stage="new"] { --pill: var(--stage-new); }
[data-stage="contacted"] { --pill: var(--stage-contacted); }
[data-stage="replied"] { --pill: var(--stage-replied); }
[data-stage="meeting"] { --pill: var(--stage-meeting); }
[data-stage="proposal"] { --pill: var(--stage-proposal); }
[data-stage="won"] { --pill: var(--stage-won); }
[data-stage="lost"] { --pill: var(--stage-lost); }

.empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-2); margin-top: var(--space-2); }
.empty-error svg { color: var(--danger); }

.loading { display: grid; place-items: center; min-height: 160px; }
.spinner {
  width: 22px;
  height: 22px;
  border: 2.5px solid var(--line);
  border-top-color: var(--text-2);
  border-radius: 999px;
  animation: spin 800ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.back {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin: 0 0 var(--space-3) calc(-1 * var(--space-2));
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-s);
  font-weight: 500;
}
.back svg { width: 18px; height: 18px; }
.back:hover { background: var(--hover); }

.section-title { font-size: var(--text-l); font-weight: 600; letter-spacing: -0.01em; }

.form-fields { display: grid; gap: var(--space-4); }
.form-row { display: grid; gap: 6px; }
.form-error { color: var(--danger); font-size: var(--text-s); font-weight: 500; }
textarea.field { min-height: 0; padding: var(--space-3); line-height: 1.45; resize: vertical; }

.dialog {
  width: min(440px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 0;
  border-radius: var(--radius-l);
  background: var(--raised);
  color: var(--text);
  box-shadow: var(--shadow-pop);
}
.dialog::backdrop { background: rgb(5 14 24 / 0.55); }
.dialog-form { display: grid; gap: var(--space-5); padding: var(--space-5); }
.dialog-title { font-size: 20px; font-weight: 600; letter-spacing: -0.015em; }
.dialog-actions { display: flex; justify-content: flex-end; gap: var(--space-2); }
.dialog .field { background: var(--bg); }
.dialog-text { color: var(--text-2); overflow-wrap: anywhere; }

.button-danger { background: var(--danger); color: var(--surface); }
.button-danger:hover { background: color-mix(in srgb, var(--danger) 88%, var(--text)); }

.toast {
  position: fixed;
  left: 50%;
  bottom: var(--space-5);
  z-index: 30;
  max-width: calc(100vw - 32px);
  padding: var(--space-2) var(--space-4);
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition: opacity 200ms var(--ease), transform 200ms var(--ease);
}
.toast-visible { opacity: 1; transform: translate(-50%, 0); }

.toolbar { display: grid; gap: var(--space-3); margin-bottom: var(--space-3); }
.toolbar[hidden] { display: none; }

.search {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  max-width: 360px;
  min-height: 38px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-s);
  background: var(--hover);
  color: var(--text-2);
}
.search:focus-within { box-shadow: 0 0 0 3px var(--focus); }
.search svg { width: 17px; height: 17px; flex: none; }
.search-input {
  flex: 1;
  min-width: 0;
  height: 36px;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  outline: none;
}
.search-input::-webkit-search-cancel-button { cursor: pointer; }

.chips {
  display: flex;
  gap: var(--space-1);
  margin: 0 calc(-1 * var(--space-1));
  padding: 2px var(--space-1);
  overflow-x: auto;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 var(--space-3);
  border-radius: 999px;
  color: var(--text);
  font-size: var(--text-s);
  font-weight: 500;
}
.chip:hover { background: var(--hover); }
.chip-count { color: var(--text-2); font-variant-numeric: tabular-nums; }
.chip[aria-current="true"] { background: var(--selected); color: var(--accent); }
.chip[aria-current="true"] .chip-count { color: inherit; }


.more { display: flex; justify-content: center; margin-top: var(--space-4); }

@media (max-width: 760px) {
  .page-header { flex-wrap: wrap; }
  .search { max-width: none; }
  .search-input { font-size: 16px; }
  .dialog-form { padding: var(--space-4); }
}
