:root {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #111827;
  background: #f3f4f6;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: #f3f4f6;
}

button,
input,
select {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #111827;
  color: white;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.14);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 18px 18px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.eyebrow {
  margin: 0 0 5px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  opacity: 0.72;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(25px, 7vw, 38px);
  line-height: 1.05;
}

h2 {
  margin-bottom: 0;
  font-size: 24px;
}

h3 {
  font-size: 18px;
}

.install-button,
.back-button {
  border: 1px solid currentColor;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  padding: 9px 17px;
  cursor: pointer;
  white-space: nowrap;
}

.app-shell {
  width: min(1100px, 100%);
  margin: 0 auto;
  padding: 18px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.summary-card {
  border: 1px solid #d1d5db;
  border-radius: 16px;
  background: white;
  padding: 16px;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 2px 7px rgba(0, 0, 0, 0.04);
}

.summary-card.active {
  border-color: #111827;
  box-shadow: 0 0 0 2px #111827;
}

.summary-card strong {
  display: block;
  font-size: 27px;
  line-height: 1;
  margin-bottom: 7px;
}

.summary-card span {
  color: #4b5563;
  font-size: 13px;
}

.controls-card,
.opportunity-card,
.detail-card,
.empty-card {
  background: white;
  border: 1px solid #d1d5db;
  border-radius: 18px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.controls-card {
  padding: 16px;
  margin-bottom: 22px;
}

.search-label,
.filter-grid label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #374151;
}

.search-label input,
.filter-grid select {
  width: 100%;
  margin-top: 7px;
  border: 1px solid #cbd5e1;
  border-radius: 11px;
  background: white;
  color: #111827;
  padding: 11px 12px;
  outline: none;
}

.search-label input:focus,
.filter-grid select:focus {
  border-color: #111827;
  box-shadow: 0 0 0 2px rgba(17, 24, 39, 0.12);
}

.filter-grid {
  display: grid;
  gap: 12px;
  margin-top: 13px;
}

.results-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.result-note,
.muted {
  color: #6b7280;
  font-size: 12px;
}

.opportunity-list {
  display: grid;
  gap: 12px;
}

.opportunity-card {
  width: 100%;
  padding: 17px;
  text-align: left;
  cursor: pointer;
  color: #111827;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.opportunity-card:active {
  transform: scale(0.99);
}

.opportunity-card:hover {
  box-shadow: 0 5px 16px rgba(0, 0, 0, 0.08);
}

.card-topline,
.card-footer,
.card-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.card-topline {
  color: #4b5563;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.opportunity-card h3 {
  margin: 8px 0;
  font-size: 20px;
}

.card-description {
  color: #4b5563;
  line-height: 1.45;
  margin-bottom: 15px;
}

.card-meta {
  border-top: 1px solid #e5e7eb;
  padding-top: 13px;
}

.card-meta > div {
  min-width: 0;
}

.meta-label {
  display: block;
  color: #6b7280;
  font-size: 11px;
  margin-bottom: 4px;
}

.card-footer {
  border-top: 1px solid #e5e7eb;
  margin-top: 13px;
  padding-top: 11px;
  color: #4b5563;
  font-size: 12px;
  font-weight: 700;
}

.signal-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.signal-badge {
  display: inline-block;
  border-radius: 999px;
  background: #111827;
  color: white;
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 800;
}

.empty-card {
  padding: 28px 18px;
  text-align: center;
}

.back-button {
  color: #111827;
  border-color: #cbd5e1;
  background: white;
  margin-bottom: 12px;
}

.detail-card {
  padding: 18px;
}

.detail-card h2 {
  font-size: clamp(25px, 7vw, 38px);
  line-height: 1.1;
  margin-bottom: 20px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  border-top: 1px solid #e5e7eb;
  border-bottom: 1px solid #e5e7eb;
  padding: 16px 0;
}

.detail-section {
  margin-top: 24px;
}

.detail-section > h3 {
  margin-bottom: 10px;
}

.detail-section > p {
  line-height: 1.6;
  color: #374151;
}

.company-list {
  display: grid;
  gap: 8px;
}

.company-row {
  display: grid;
  gap: 2px;
  padding: 11px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 11px;
}

.company-row span {
  color: #6b7280;
  font-size: 13px;
}

.signal-detail-list {
  display: grid;
  gap: 8px;
}

.signal-detail {
  padding: 11px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 11px;
  display: grid;
  gap: 4px;
}

.signal-detail span {
  color: #4b5563;
  font-size: 13px;
  line-height: 1.4;
}

.provenance-card {
  margin-top: 24px;
  padding: 14px;
  border-radius: 13px;
  background: #f3f4f6;
}

.provenance-card h3 {
  margin-bottom: 8px;
}

.provenance-card p {
  margin-bottom: 4px;
  color: #4b5563;
  font-size: 13px;
}

.data-disclaimer {
  margin-top: 18px;
  color: #6b7280;
  font-size: 12px;
  line-height: 1.5;
}

@media (min-width: 700px) {
  .filter-grid {
    grid-template-columns: 2fr 1fr 1fr;
  }

  .opportunity-list {
    grid-template-columns: repeat(2, 1fr);
  }

  .detail-card {
    padding: 28px;
  }
}

@media (max-width: 480px) {
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .results-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .card-meta {
    flex-direction: column;
  }

  .header-inner {
    padding-left: 14px;
    padding-right: 14px;
  }

  .app-shell {
    padding: 12px;
  }
}


.auth-card {
  max-width: 520px;
  margin: 48px auto;
  padding: 28px;
  background: #fff;
  border: 1px solid #dbe1ea;
  border-radius: 16px;
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.08);
}

.auth-card h2 {
  margin: 8px 0 10px;
}

.auth-intro {
  color: #4b5563;
  line-height: 1.6;
}

.auth-form {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.auth-form label {
  display: grid;
  gap: 7px;
  font-weight: 600;
}

.auth-form input {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 13px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  font: inherit;
  background: #fff;
}

.auth-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.auth-actions button,
.auth-card > button {
  min-height: 44px;
  padding: 10px 16px;
  border: 0;
  border-radius: 10px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.auth-actions button:first-child,
.auth-card > button {
  background: #111827;
  color: #fff;
}

.secondary-button {
  background: #e5e7eb;
  color: #111827;
}

.auth-message {
  min-height: 24px;
  margin: 0;
  color: #4b5563;
  line-height: 1.5;
}

@media (max-width: 560px) {
  .auth-card {
    margin: 24px 0;
    padding: 22px;
  }

  .auth-actions {
    grid-template-columns: 1fr;
  }
}


/* Payment */
.payment-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
  padding: 24px;
  border: 1px solid #d1d5db;
  border-radius: 16px;
  background: #ffffff;
}

.payment-card h2 {
  margin: 4px 0 8px;
}

.payment-card p {
  margin: 6px 0;
}

.payment-price {
  display: inline-block;
  margin-top: 10px;
  font-size: 1.25rem;
}

.payment-card button {
  flex: 0 0 auto;
  min-width: 190px;
}

.payment-active {
  border-color: #86efac;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: #dcfce7;
  color: #166534;
}

@media (max-width: 640px) {
  .payment-card {
    align-items: stretch;
    flex-direction: column;
  }

  .payment-card button {
    width: 100%;
  }
}
