.as-root,
.as-root *,
.as-root *::before,
.as-root *::after {
  box-sizing: border-box;
}

.as-root {
  width: 100%;
  height: 100%;
  font-family: Inter, system-ui, -apple-system, sans-serif;
  color: #1e293b;
  -webkit-font-smoothing: antialiased;
}

.as-app {
  position: relative;
  width: 100%;
  height: 100%;
  background: #f1f5f9;
}

.as-stage {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 32px 40px;
  pointer-events: none;
}

.as-stage.is-active {
  display: flex;
  pointer-events: auto;
}

.as-stage--composer {
  background: #f1f5f9;
}

.as-composer-wrap {
  width: min(720px, 100%);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.as-composer-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #0f172a;
}

.as-stage--loading {
  background: #f1f5f9;
}

.as-stage--results {
  align-items: stretch;
  justify-content: stretch;
  padding: 20px 24px;
}

.as-composer {
  position: relative;
  width: 100%;
  border: 1px solid #e2e8f0;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 2px 16px rgba(15, 23, 42, 0.08);
  padding: 16px 72px 16px 20px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.as-composer.is-focused {
  border-color: #0284c7;
  box-shadow: 0 2px 20px rgba(2, 132, 199, 0.18);
}

.as-composer textarea {
  width: 100%;
  min-height: 88px;
  border: none;
  outline: none;
  resize: none;
  font: inherit;
  font-size: 0.85rem;
  line-height: 1.55;
  background: transparent;
  color: #1e293b;
}

.as-composer textarea::placeholder {
  color: #94a3b8;
}

.as-send {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: #0284c7;
  color: #fff;
  cursor: default;
  transition: transform 0.15s ease, background 0.15s ease;
}

.as-send.is-pressed {
  transform: scale(0.92);
  background: #0369a1;
}

.as-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.as-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #e2e8f0;
  border-top-color: #0284c7;
  border-radius: 50%;
  animation: asSpin 0.85s linear infinite;
}

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

.as-loading p {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 500;
  color: #64748b;
}

.as-table-shell {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.as-table {
  flex: 1;
  display: flex;
  flex-direction: column;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
  overflow: hidden;
}

.as-table-header,
.as-row {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) 108px minmax(0, 1.2fr) minmax(0, 0.9fr);
  gap: 10px;
  align-items: center;
}

.as-table-header {
  padding: 10px 16px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
}

.as-table-header > span:nth-child(2) {
  justify-self: center;
  text-align: center;
  width: 100%;
}

.as-table-rows {
  flex: 1;
  overflow: hidden;
}

.as-row {
  padding: 12px 16px;
  border-bottom: 1px solid #e2e8f0;
  background: #fff;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.4s ease, transform 0.4s ease, background 0.2s ease;
  cursor: default;
}

.as-row[data-as-row-open] {
  cursor: pointer;
}

.as-row.is-in {
  opacity: 1;
  transform: translateY(0);
}

.as-row.is-highlight {
  background: rgba(2, 132, 199, 0.05);
}

.as-row.is-selected {
  background: rgba(2, 132, 199, 0.1);
  box-shadow: inset 0 0 0 1px rgba(2, 132, 199, 0.25);
}

.as-candidate-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.as-avatar {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
}

.as-avatar--violet {
  background: linear-gradient(135deg, #a78bfa, #6366f1);
}

.as-avatar--rose {
  background: linear-gradient(135deg, #fb7185, #e11d48);
}

.as-avatar--teal {
  background: linear-gradient(135deg, #2dd4bf, #0d9488);
}

.as-candidate strong {
  display: block;
  font-size: 0.8rem;
}

.as-candidate span {
  display: block;
  font-size: 0.68rem;
  color: #64748b;
  margin-top: 2px;
}

.as-match {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  text-align: center;
}

.as-row > .as-match {
  justify-self: center;
  width: 100%;
  min-width: 0;
  max-width: 108px;
}

.as-match--table .as-match-tier {
  font-size: 10px;
  line-height: 1.2;
}

.as-match--table .as-match-subtitle {
  font-size: 11px;
  line-height: 1.2;
}

.as-match--table .as-match-track {
  width: 100%;
  margin-top: 4px;
  height: 7px;
}

.as-match--modal {
  align-items: flex-start;
  max-width: 200px;
  margin-top: 8px;
}

.as-match--modal .as-match-tier {
  font-size: 15px;
  line-height: 1.25;
}

.as-match--modal .as-match-subtitle {
  font-size: 12px;
  line-height: 1.25;
}

.as-match--modal .as-match-track {
  width: 100%;
  margin-top: 6px;
  height: 8px;
}

.as-match-tier {
  margin: 0;
  font-family: 'Montserrat', 'Inter', system-ui, sans-serif;
  font-weight: 700;
  white-space: nowrap;
}

.as-match--best .as-match-tier {
  color: #16a34a;
}

.as-match--good .as-match-tier {
  color: #0284c7;
}

.as-match--modal.as-match--best,
.as-match--modal.as-match--good {
  align-items: flex-start;
  max-width: 200px;
  margin-top: 8px;
}

.as-match--modal .as-match-tier {
  font-size: 11px;
}

.as-match-subtitle {
  margin: 0;
  font-weight: 400;
  color: #64748b;
  text-transform: lowercase;
}

.as-match-track {
  border-radius: 999px;
  background: #f8fafc;
  border: 1px solid rgba(2, 132, 199, 0.2);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
  overflow: hidden;
}

.as-match-fill {
  height: 100%;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.as-match--best .as-match-track {
  border-color: rgba(34, 197, 94, 0.45);
}

.as-match--best .as-match-fill {
  background: linear-gradient(90deg, #4ade80 0%, #16a34a 100%);
  box-shadow: inset 0 0 0 1px rgba(22, 163, 74, 0.35);
}

.as-match--good .as-match-track {
  border-color: rgba(2, 132, 199, 0.45);
}

.as-match--good .as-match-fill {
  background: linear-gradient(90deg, #38bdf8 0%, #0284c7 100%);
  box-shadow: inset 0 0 0 1px rgba(2, 132, 199, 0.35);
}

.as-pros,
.as-cons {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-content: flex-start;
}

.as-tag-match,
.as-tag-gap {
  font-size: 0.6rem;
  font-weight: 600;
  padding: 3px 7px;
  border-radius: 6px;
  line-height: 1.3;
}

.as-tag-match {
  background: rgba(2, 132, 199, 0.1);
  color: #0369a1;
}

.as-tag-gap {
  background: rgba(245, 158, 11, 0.14);
  color: #b45309;
}

.as-tag-gap--empty {
  background: transparent;
  color: #94a3b8;
  font-weight: 500;
}

.as-cursor {
  position: absolute;
  width: 18px;
  height: 18px;
  margin: -2px 0 0 -2px;
  border-radius: 50%;
  border: 2px solid #0f172a;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.25);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 50;
}

.as-cursor.is-on {
  opacity: 1;
}

.as-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 40;
}

.as-modal-backdrop.is-in {
  opacity: 1;
}

.as-modal {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(480px, calc(100% - 48px));
  max-height: calc(100% - 40px);
  padding: 20px 22px 22px;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  background: #fff;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.2);
  transform: translate(-50%, -48%) scale(0.96);
  opacity: 0;
  transition: opacity 0.32s ease, transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 45;
  overflow: auto;
}

.as-modal.is-in {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.as-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 1.25rem;
  line-height: 1;
  cursor: default;
}

.as-modal-head {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
  padding-right: 28px;
}

.as-avatar--lg {
  width: 52px;
  height: 52px;
  font-size: 0.85rem;
}

.as-modal-head strong {
  display: block;
  font-size: 0.95rem;
}

.as-modal-head > div > span {
  display: block;
  margin-top: 4px;
  font-size: 0.72rem;
  color: #64748b;
}

.as-modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.as-profile-panel {
  padding: 12px 14px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.as-profile-label {
  margin: 0 0 10px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #64748b;
}

.as-profile-list {
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.as-profile-list li {
  font-size: 0.72rem;
  line-height: 1.45;
  color: #475569;
}

.as-profile-list strong {
  color: #1e293b;
}

.as-open-email {
  width: 100%;
  border: none;
  border-radius: 10px;
  padding: 11px 16px;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  color: #fff;
  background: #0284c7;
  cursor: default;
  transition: background 0.15s ease, transform 0.15s ease;
}

.as-open-email.is-pressed {
  transform: scale(0.98);
  background: #0369a1;
}

.as-email-panel {
  padding: 14px 16px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.as-email-label {
  margin: 0 0 12px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #64748b;
}

.as-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.as-field > span {
  font-size: 0.68rem;
  font-weight: 600;
  color: #475569;
}

.as-field input {
  text-overflow: ellipsis;
}

.as-field input,
.as-field textarea {
  width: 100%;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  font-size: 0.78rem;
  line-height: 1.5;
  outline: none;
  background: #fff;
  color: #1e293b;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.as-field textarea {
  min-height: 4.6em;
  max-height: 4.6em;
  resize: none;
  overflow: hidden;
  line-height: 1.45;
}

.as-field input:focus,
.as-field textarea:focus {
  border-color: #0284c7;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.12);
}

.as-email-send {
  margin-top: 4px;
  width: 100%;
  border: none;
  border-radius: 10px;
  padding: 11px 16px;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  color: #fff;
  background: #0284c7;
  cursor: default;
  transition: background 0.15s ease, transform 0.15s ease;
}

.as-email-send.is-pressed {
  transform: scale(0.98);
  background: #0369a1;
}

.as-email-send.is-sent {
  background: #047857;
}

.as-toast {
  position: absolute;
  top: 14px;
  right: 14px;
  left: auto;
  z-index: 60;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100% - 28px);
  padding: 10px 14px 10px 10px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #0f172a;
  font-size: 0.76rem;
  font-weight: 600;
  box-shadow:
    0 4px 6px rgba(15, 23, 42, 0.04),
    0 12px 28px rgba(15, 23, 42, 0.1);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px) scale(0.98);
  transition:
    opacity 0.3s ease,
    transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.as-toast__icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  position: relative;
}

.as-toast__icon::after {
  content: '';
  position: absolute;
  left: 9px;
  top: 7px;
  width: 6px;
  height: 10px;
  border: solid #047857;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.as-toast__text {
  line-height: 1.3;
  white-space: nowrap;
}

.as-toast.is-in {
  opacity: 1;
  transform: translateY(0) scale(1);
}
