:root {
  --background: #050812;
  --surface: #0c1322;
  --surface-strong: #121d30;
  --border: #263750;
  --text: #f7fbff;
  --muted: #93a7bf;
  --accent: #46e58b;
  --accent-hover: #6bf0a3;
  --accent-text: #03140c;
  --focus: #7dd3fc;
  --party-purple: #a855f7;
  --party-pink: #f472b6;
  --party-gold: #fbbf24;
}

html {
  scroll-behavior: smooth;
  background: #050812;
}

body {
  overflow-x: hidden;
  background:
    radial-gradient(circle at 8% 2%, rgb(20 184 166 / 14%), transparent 26rem),
    radial-gradient(circle at 92% 8%, rgb(139 92 246 / 15%), transparent 30rem),
    radial-gradient(circle at 48% 52%, rgb(30 64 175 / 8%), transparent 42rem),
    linear-gradient(180deg, #070b16, #050812 46%, #03050b);
  background-attachment: fixed;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.2;
  background-image:
    linear-gradient(rgb(255 255 255 / 2.5%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(255 255 255 / 2.5%) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: linear-gradient(to bottom, black, transparent 80%);
}

.shell {
  width: min(1380px, calc(100% - 36px));
  padding: 28px 0 88px;
}

.site-account-bar {
  position: sticky;
  top: 12px;
  z-index: 45;
  margin-bottom: 20px;
  border-color: rgb(125 211 252 / 25%);
  border-radius: 16px;
  background: rgb(7 12 24 / 78%);
  box-shadow: 0 14px 50px rgb(0 0 0 / 35%);
  backdrop-filter: blur(18px) saturate(140%);
}

.site-account-bar > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.hero {
  max-width: none;
  margin: 42px 0 30px;
  padding: 0 8px;
}

.hero h1 {
  width: fit-content;
  margin-bottom: 8px;
  background: linear-gradient(95deg, #ffffff 4%, #bfffe0 42%, #d8b4fe 78%, #fcd34d);
  background-clip: text;
  color: transparent;
  font-size: clamp(42px, 7vw, 78px);
  letter-spacing: -0.055em;
}

.hero p {
  margin: 0;
  color: #a9bad0;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.eyebrow,
.step {
  color: #7ff2b5;
  letter-spacing: 0.16em;
}

.card,
.auth-card {
  position: relative;
  border-color: rgb(90 116 151 / 42%);
  border-radius: 22px;
  background:
    linear-gradient(145deg, rgb(18 29 48 / 94%), rgb(8 15 28 / 96%));
  box-shadow:
    0 22px 70px rgb(0 0 0 / 25%),
    inset 0 1px 0 rgb(255 255 255 / 3.5%);
}

.card::before,
.auth-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(120deg, rgb(255 255 255 / 2.6%), transparent 26%, transparent 70%, rgb(125 211 252 / 2.5%));
}

.card > *,
.auth-card > * {
  position: relative;
  z-index: 1;
}

.account-card {
  border-color: rgb(70 229 139 / 30%);
}

.button,
button,
input,
select {
  transition: border-color 150ms ease, background-color 150ms ease, color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.button {
  border-radius: 12px;
  font-weight: 750;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button.primary {
  background: linear-gradient(135deg, #3ee38a, #22c55e 58%, #14b87a);
  box-shadow: 0 10px 28px rgb(34 197 94 / 18%);
}

.button.secondary {
  border-color: #355274;
  background: linear-gradient(145deg, #16263d, #101b2d);
}

input,
select {
  border-color: #31465f;
  border-radius: 12px;
  background: rgb(5 11 22 / 72%);
}

input:focus,
select:focus,
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  box-shadow: 0 0 0 5px rgb(125 211 252 / 12%);
}

.workspace-layout {
  grid-template-columns: minmax(0, 1.65fr) minmax(340px, 0.82fr);
  align-items: start;
  gap: 18px;
}

.workspace-main,
.workspace-side {
  min-width: 0;
  max-width: 100%;
}

.workspace-side {
  position: static;
  max-height: none;
  overflow: visible;
}

.workspace-side .card {
  margin-top: 16px;
}

.results-heading {
  align-items: flex-start;
}

.results-heading h2,
.side-card h2 {
  font-size: clamp(23px, 2.2vw, 31px);
}

.results-heading .muted {
  max-width: 760px;
}

.status-help,
.action-help,
.filter-help {
  color: #7187a3;
  font-size: 12px;
}

.list-tabs {
  padding: 5px;
  border: 1px solid #263a52;
  border-radius: 14px;
  background: rgb(4 10 20 / 50%);
}

.list-tab {
  border-radius: 10px;
}

.result-list {
  gap: 10px;
}

.result-section-heading {
  margin: 20px 0 10px;
  padding: 11px 13px;
  border: 1px solid #2b405b;
  border-radius: 13px;
  background: rgb(8 16 30 / 64%);
}

.own-results-heading {
  border-color: rgb(96 165 250 / 40%);
  background: linear-gradient(90deg, rgb(37 99 235 / 15%), rgb(8 16 30 / 62%));
}

.free-results-heading {
  border-color: rgb(70 229 139 / 38%);
  background: linear-gradient(90deg, rgb(34 197 94 / 13%), rgb(8 16 30 / 62%));
}

.result-section-toggle {
  width: 100%;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.result-section-toggle span {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.result-section-content {
  display: grid;
  gap: 10px;
}

.results-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 8px;
}

.results-stats span {
  padding: 5px 9px;
  border: 1px solid #2b405b;
  border-radius: 999px;
  color: #9fb2c8;
  background: rgb(8 16 30 / 66%);
  font-size: 12px;
  font-weight: 700;
}

.results-stats strong {
  color: #f5fbff;
}

.results-stats .scan-live-dot {
  border-color: rgb(70 229 139 / 40%);
  color: #8df5bb;
}

.team-results-section.collapsed .result-section-content {
  display: none;
}

.team-results-section.collapsed .result-section-heading {
  opacity: 0.76;
}

.result-group {
  border-color: #2a4059;
  border-radius: 17px;
  background: linear-gradient(145deg, rgb(14 25 43 / 94%), rgb(8 16 29 / 96%));
  box-shadow: 0 12px 32px rgb(0 0 0 / 18%);
  transition: border-color 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}

.result-group-heading {
  align-items: center;
}

.result-heading-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.phone-result {
  border-radius: 14px;
  transition: border-color 180ms ease, background-color 180ms ease, box-shadow 220ms ease;
}

.phone-result.motion-pending {
  border-color: rgb(56 189 248 / 72%);
  box-shadow: inset 4px 0 0 var(--owner-color, transparent), 0 0 0 3px rgb(56 189 248 / 10%);
}

.status-button.motion-pressed {
  transform: translateY(1px) scale(.97);
  filter: brightness(1.14);
}

.phone-result.motion-confirmed {
  animation: status-confirmed 460ms cubic-bezier(.2,.8,.2,1);
}

.company-password-button {
  appearance: none;
  cursor: pointer;
}

.company-password-button:hover {
  border-color: #fda4af;
  color: #fff1f2;
  transform: translateY(-1px);
  box-shadow: 0 0 14px rgb(244 63 94 / 24%);
}

.marked-buyout .company-password-button {
  border-color: rgb(244 114 182 / 64%);
  color: #fff0f9;
  background: rgb(131 24 67 / 72%);
}

.global-search {
  margin: 16px 0 12px;
  padding: 14px;
  border: 1px solid #30445d;
  border-radius: 16px;
  background: linear-gradient(130deg, rgb(8 16 31 / 86%), rgb(15 25 43 / 78%));
}

.global-search label {
  display: block;
  margin-bottom: 7px;
  color: #d7e5f5;
  font-size: 13px;
  font-weight: 800;
}

.global-search-row {
  display: flex;
  gap: 8px;
}

.global-search-row input {
  width: 100%;
}

.global-search small {
  display: block;
  margin-top: 7px;
  color: #7187a3;
}

.global-search-scopes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.global-search .search-scope-option {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  margin: 0;
  padding: 0 12px;
  border: 1px solid #30445d;
  border-radius: 999px;
  background: #0b1728;
  color: #9db2ca;
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, color 180ms ease;
}

.global-search .search-scope-option:has(input:checked) {
  border-color: #38bdf8;
  background: rgb(14 116 144 / 24%);
  color: #e0f2fe;
}

.search-scope-option input {
  accent-color: #38bdf8;
}

.archived-phone-badge {
  display: inline-flex;
  width: fit-content;
  padding: 3px 8px;
  border: 1px solid rgb(248 113 113 / 45%);
  border-radius: 999px;
  color: #fecaca;
  background: rgb(127 29 29 / 24%);
  font-size: 11px;
  font-weight: 800;
}

.search-results {
  margin-top: 14px;
}

.search-result-count {
  color: #8ba0ba;
  font-size: 13px;
  font-weight: 750;
}

.search-result-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px;
  border: 1px solid #2d445f;
  border-radius: 15px;
  background: #0c1728;
}

.search-phone-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.search-phone-row span {
  color: #8da3bd;
  font-size: 13px;
}

.search-result-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 7px;
}

.search-focus {
  animation: search-focus 1.8s ease-out;
}

.manual-card {
  border-color: rgb(70 229 139 / 30%);
}

#live-card {
  border-color: rgb(125 211 252 / 33%);
  background:
    radial-gradient(circle at 100% 0, rgb(14 165 233 / 12%), transparent 18rem),
    linear-gradient(145deg, rgb(13 28 47 / 97%), rgb(7 16 29 / 98%));
}

#notification-button.active {
  border-color: rgb(70 229 139 / 48%);
  color: #bfffdc;
  background: rgb(22 101 52 / 24%);
}

.live-list,
.activity-list {
  gap: 10px;
}

.live-message {
  padding: 14px;
  border-color: #2d4a67;
  border-radius: 14px;
  background: linear-gradient(145deg, #0b1b30, #0a1424);
  box-shadow: inset 3px 0 0 #38bdf8;
}

.live-message-enter {
  animation: live-message-enter 240ms cubic-bezier(.2,.8,.2,1);
}

.live-message p {
  max-height: none;
  margin-top: 9px;
  overflow: visible;
  color: #e6f3ff;
  font-size: 14px;
  line-height: 1.62;
  white-space: pre-wrap;
}

.activity-item {
  border-color: #293d56;
  background: rgb(8 16 29 / 78%);
}

.sms-history-dialog {
  width: min(720px, calc(100% - 28px));
  max-height: min(82vh, 840px);
  overflow: hidden;
  border-color: #365777;
  background: #091321;
}

.sms-history-dialog form {
  display: flex;
  max-height: min(82vh, 840px);
  flex-direction: column;
}

.dialog-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.sms-history-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  padding-right: 5px;
  overflow-y: auto;
}

.sms-history-item {
  padding: 14px;
  border: 1px solid #30465f;
  border-radius: 14px;
  background: #0d1a2c;
}

.sms-history-item.revealed {
  border-color: rgb(70 229 139 / 38%);
  box-shadow: inset 3px 0 0 #46e58b;
}

.sms-history-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #8ba0b9;
  font-size: 12px;
  font-weight: 750;
}

.sms-history-item p {
  margin: 9px 0 12px;
  overflow-wrap: anywhere;
  color: #edf7ff;
  white-space: pre-wrap;
}

.credential-card {
  display: grid;
  gap: 8px;
  padding: 18px;
  border: 1px solid rgb(70 229 139 / 45%);
  border-radius: 16px;
  background: linear-gradient(135deg, rgb(14 58 42 / 74%), rgb(10 24 42 / 95%));
  box-shadow: inset 3px 0 0 #46e58b;
}

.credential-card span,
.history-caption {
  color: #91a8c0;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.credential-card strong {
  color: #f3fff8;
  font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  font-size: clamp(25px, 5vw, 38px);
  letter-spacing: 0.04em;
  overflow-wrap: anywhere;
}

.credential-card small {
  color: #c0d4e8;
  font-size: 14px;
}

.history-caption {
  margin-top: 8px;
}

.copy-sms-button {
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid #3c5876;
  border-radius: 9px;
  color: #cce9ff;
  background: #12243a;
  cursor: pointer;
}

.history-loading {
  padding: 24px;
  color: #9eb2c9;
  text-align: center;
}

@keyframes search-focus {
  0%, 100% { box-shadow: 0 12px 32px rgb(0 0 0 / 18%); }
  20%, 65% { box-shadow: 0 0 0 3px rgb(125 211 252 / 55%), 0 0 32px rgb(56 189 248 / 24%); }
}

@keyframes live-message-enter {
  from {
    opacity: 0;
    transform: translate3d(0, -8px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes status-confirmed {
  0% { box-shadow: inset 4px 0 0 var(--owner-color, transparent); }
  45% { box-shadow: inset 4px 0 0 var(--owner-color, transparent), 0 0 0 4px rgb(74 222 128 / 18%), 0 10px 28px rgb(34 197 94 / 16%); }
  100% { box-shadow: inset 4px 0 0 var(--owner-color, transparent); }
}

@media (max-width: 980px) {
  .workspace-layout {
    grid-template-columns: 1fr;
  }

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

  .workspace-side #live-card {
    grid-column: 1 / -1;
  }

  .workspace-side .card {
    margin-top: 0;
  }
}

@media (max-width: 680px) {
  .shell {
    width: calc(100% - 20px);
    padding-top: 10px;
  }

  .site-account-bar,
  .search-result-card,
  .dialog-title-row {
    align-items: stretch;
    flex-direction: column;
  }

  .search-result-actions {
    width: 100%;
  }

  .site-account-actions {
    width: auto;
    align-self: stretch;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .site-account-actions .button,
  .search-result-actions .button {
    min-width: 0;
    flex: 1;
  }

  .hero {
    margin: 30px 0 20px;
  }

  .hero h1 {
    font-size: clamp(40px, 15vw, 64px);
  }

  .workspace-side {
    grid-template-columns: 1fr;
  }

  .workspace-side #live-card {
    grid-column: auto;
  }

  .card {
    padding: 18px;
    border-radius: 18px;
  }

  .result-list,
  .result-section,
  .result-group,
  .result-phone-list,
  .phone-result,
  .phone-meta,
  .status-controls {
    min-width: 0;
    max-width: 100%;
  }

  .result-group {
    overflow: hidden;
  }

  .result-group-heading,
  .result-section-heading {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .result-section-heading span {
    max-width: 100%;
  }

  .result-heading-actions {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

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

  .status-button {
    min-width: 0;
    padding: 0 7px;
  }

  .list-tab {
    min-width: 0;
  }

  .global-search-row {
    align-items: stretch;
    flex-direction: column;
  }

}

@media (prefers-reduced-motion: reduce) {
  .search-focus,
  .live-message-enter,
  .phone-result.motion-confirmed {
    animation: none !important;
  }
}
