/* Relocator — styles.css */

:root {
  --bg: #0f0f13;
  --bg-card: #1a1a24;
  --bg-hover: #22223a;
  --text: #e0e0e8;
  --text-dim: #8888a0;
  --accent: #6c5ce7;
  --accent-hover: #7c6cf7;
  --green: #00b894;
  --yellow: #fdcb6e;
  --red: #e17055;
  --border: #2d2d44;
  --radius: 8px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --mono: 'SF Mono', 'Fira Code', 'JetBrains Mono', monospace;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* Astro chart background — rings & lines */
body::before {
  content: '';
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 800px;
  height: 800px;
  pointer-events: none;
  z-index: 0;
  opacity: 0.07;
  background:
    radial-gradient(circle, transparent 59px, var(--text-dim) 60px, transparent 61px),
    radial-gradient(circle, transparent 109px, var(--text-dim) 110px, transparent 111px),
    radial-gradient(circle, transparent 169px, var(--text-dim) 170px, transparent 171px),
    radial-gradient(circle, transparent 219px, var(--text-dim) 220px, transparent 221px),
    radial-gradient(circle, transparent 289px, var(--text-dim) 290px, transparent 291px),
    radial-gradient(circle, transparent 349px, var(--text-dim) 350px, transparent 351px),
    linear-gradient(0deg, transparent calc(50% - 0.5px), var(--text-dim) 50%, transparent calc(50% + 0.5px)),
    linear-gradient(90deg, transparent calc(50% - 0.5px), var(--text-dim) 50%, transparent calc(50% + 0.5px)),
    linear-gradient(30deg, transparent calc(50% - 0.5px), var(--text-dim) 50%, transparent calc(50% + 0.5px)),
    linear-gradient(60deg, transparent calc(50% - 0.5px), var(--text-dim) 50%, transparent calc(50% + 0.5px)),
    linear-gradient(120deg, transparent calc(50% - 0.5px), var(--text-dim) 50%, transparent calc(50% + 0.5px)),
    linear-gradient(150deg, transparent calc(50% - 0.5px), var(--text-dim) 50%, transparent calc(50% + 0.5px));
}

/* Astro chart background — planet dots (separate layer, higher opacity) */
body::after {
  content: '';
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 800px;
  height: 800px;
  pointer-events: none;
  z-index: 0;
  opacity: 0.18;
  background:
    /* Dots pushed to edges — avoid center text zone */
    radial-gradient(circle at 8% 35%, #a78bfa 5px, transparent 5.5px),
    radial-gradient(circle at 92% 45%, #fdcb6e 5px, transparent 5.5px),
    radial-gradient(circle at 50% 92%, #e17055 5px, transparent 5.5px),
    radial-gradient(circle at 12% 65%, #00b894 4.5px, transparent 5px),
    radial-gradient(circle at 88% 25%, #dda0dd 4px, transparent 4.5px),
    radial-gradient(circle at 20% 85%, #87ceeb 4px, transparent 4.5px),
    radial-gradient(circle at 82% 78%, #fdcb6e 3.5px, transparent 4px),
    radial-gradient(circle at 5% 15%, #e17055 3.5px, transparent 4px),
    radial-gradient(circle at 95% 70%, #a78bfa 3px, transparent 3.5px),
    radial-gradient(circle at 50% 8%, #00b894 3px, transparent 3.5px),
    /* Glows */
    radial-gradient(circle at 8% 35%, rgba(167,139,250,0.5) 8px, transparent 20px),
    radial-gradient(circle at 92% 45%, rgba(253,203,110,0.45) 8px, transparent 20px),
    radial-gradient(circle at 50% 92%, rgba(225,112,85,0.45) 8px, transparent 20px),
    radial-gradient(circle at 12% 65%, rgba(0,184,148,0.4) 7px, transparent 18px),
    radial-gradient(circle at 88% 25%, rgba(221,160,221,0.3) 6px, transparent 16px),
    radial-gradient(circle at 20% 85%, rgba(135,206,235,0.3) 6px, transparent 16px);
}

body > * {
  position: relative;
  z-index: 1;
}

/* Header */
header {
  text-align: center;
  padding: 2rem 1.5rem 1.25rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  position: relative;
}

header h1 {
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: linear-gradient(135deg, #a78bfa 0%, #6c5ce7 40%, #74b9ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 20px rgba(108, 92, 231, 0.3));
}

.logo-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #a78bfa;
  box-shadow: 0 0 10px rgba(167, 139, 250, 0.6), 0 0 30px rgba(167, 139, 250, 0.2);
  margin-bottom: 0.8rem;
  animation: pulse-dot 3s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; box-shadow: 0 0 10px rgba(167, 139, 250, 0.6), 0 0 30px rgba(167, 139, 250, 0.2); }
  50% { opacity: 0.6; box-shadow: 0 0 6px rgba(167, 139, 250, 0.3), 0 0 15px rgba(167, 139, 250, 0.1); }
}

.logo-alpha {
  font-size: 0.55rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #a78bfa;
  opacity: 0.5;
  vertical-align: super;
  margin-left: 0.3rem;
}

.subtitle {
  color: var(--text-dim);
  font-size: 0.78rem;
  margin-top: 0.1rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 500;
}

.app-tagline {
  max-width: 520px;
  margin: 0.75rem auto 0;
  color: var(--text-dim);
  font-size: 0.82rem;
  line-height: 1.55;
  opacity: 0.7;
}

.app-privacy {
  margin-top: 0.4rem;
  font-size: 0.72rem;
  color: var(--text-dim);
  opacity: 0.4;
  letter-spacing: 0.03em;
}

/* Footer */
.site-footer {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem 1.5rem;
  border-top: 1px solid var(--border);
}

.footer-disclaimer {
  max-width: 560px;
  margin: 0 auto;
  text-align: center;
  font-size: 0.72rem;
  line-height: 1.6;
  color: var(--text-dim);
  opacity: 0.4;
}

/* Main layout */
main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem;
}

/* Sections */
.section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1rem;
  overflow: hidden;
}

.section-header {
  padding: 0.75rem 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.1rem;
  font-weight: 600;
  user-select: none;
  background: rgba(108, 92, 231, 0.05);
  border-bottom: 1px solid var(--border);
}

.section-header:hover {
  background: rgba(108, 92, 231, 0.1);
}

.toggle-icon {
  font-size: 0.7rem;
  color: var(--text-dim);
  width: 1rem;
  text-align: center;
}

.section-content {
  padding: 1rem;
}

.section-content.collapsed {
  display: none;
}

/* Forms */
.form-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.form-group {
  flex: 1;
  min-width: 200px;
}

.form-group.half {
  flex: 0 1 auto;
  min-width: 140px;
}

label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 0.25rem;
}

input[type="text"],
input[type="date"],
input[type="time"],
input[type="number"],
select {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font-size: 0.95rem;
  font-family: var(--font);
  outline: none;
  transition: border-color 0.2s;
}

input:focus,
select:focus {
  border-color: var(--accent);
}

input[readonly] {
  opacity: 0.7;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--text);
  cursor: pointer;
  margin-top: 0.25rem;
}

.checkbox-label input[type="checkbox"] {
  accent-color: var(--accent);
}

/* Buttons */
.btn-primary {
  background: var(--accent);
  color: white;
  border: none;
  padding: 0.6rem 2rem;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 0.5rem;
  transition: background 0.2s;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-secondary {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 0.5rem 1.5rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary:hover {
  background: rgba(108, 92, 231, 0.1);
}

/* Dropdown */
.dropdown {
  position: absolute;
  z-index: 100;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-height: 300px;
  overflow-y: auto;
  width: 100%;
}

.form-group {
  position: relative;
}

.dropdown-item {
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.dropdown-item:last-child {
  border-bottom: none;
}

.dropdown-item:hover {
  background: var(--bg-hover);
}

.dropdown-item .coords {
  float: right;
  color: var(--text-dim);
  font-size: 0.8rem;
}

.selected-city {
  font-size: 0.85rem;
  color: var(--green);
  margin-top: 0.25rem;
}

/* Warning */
.warning {
  background: rgba(253, 203, 110, 0.1);
  border: 1px solid var(--yellow);
  border-radius: var(--radius);
  padding: 0.5rem 0.75rem;
  color: var(--yellow);
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

/* Tables */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.data-table th {
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-bottom: 2px solid var(--border);
  color: var(--text-dim);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.data-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

.data-table tbody tr:hover {
  background: var(--bg-hover);
}

.sortable {
  cursor: pointer;
  user-select: none;
}

.sortable:hover {
  color: var(--accent);
}

.sortable.sort-asc::after {
  content: ' ▲';
  font-size: 0.7rem;
}

.sortable.sort-desc::after {
  content: ' ▼';
  font-size: 0.7rem;
}

/* Planet glyph */
.planet-glyph {
  font-size: 1.1rem;
}

.retrograde {
  color: var(--red);
  font-size: 0.75rem;
  font-weight: 600;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}

.badge-beneficial {
  background: rgba(0, 184, 148, 0.15);
  color: var(--green);
}

.badge-neutral {
  background: rgba(253, 203, 110, 0.15);
  color: var(--yellow);
}

.badge-harmful {
  background: rgba(225, 112, 85, 0.15);
  color: var(--red);
}

/* Summary */
.summary {
  font-size: 0.95rem;
  color: var(--text-dim);
  margin-bottom: 1rem;
  padding: 0.5rem 0;
}

/* Progress bar */
.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--bg);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.3s;
  width: 0%;
}

.progress-text {
  font-size: 0.85rem;
  color: var(--text-dim);
}

/* Scoring Mode Selector */
.mode-selector-wrap {
  margin-bottom: 0.5rem;
}

.mode-selector {
  display: flex;
  flex-wrap: nowrap;
  gap: 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  width: fit-content;
  max-width: 100%;
}

.mode-btn {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.95rem;
  border: none;
  background: var(--bg);
  color: var(--text-dim);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: inherit;
  white-space: nowrap;
}

.mode-btn:not(:last-child) {
  border-right: 1px solid var(--border);
}

.mode-btn:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.mode-btn.active {
  background: rgba(108, 92, 231, 0.15);
  color: var(--accent);
}

.mode-btn.active[data-mode="overall"] {
  background: rgba(255, 234, 167, 0.12);
  color: #ffeaa7;
}

.mode-btn.active[data-mode="money"] {
  background: rgba(240, 165, 0, 0.12);
  color: #f0a500;
}

.mode-btn.active[data-mode="sexy"] {
  background: rgba(232, 67, 147, 0.12);
  color: #e84393;
}

.mode-btn.active[data-mode="health"] {
  background: rgba(0, 184, 148, 0.12);
  color: #00b894;
}

.mode-btn.active[data-mode="spiritual"] {
  background: rgba(162, 130, 246, 0.12);
  color: #a282f6;
}

.mode-btn.active[data-mode="relax"] {
  background: rgba(116, 185, 255, 0.12);
  color: #74b9ff;
}

.mode-btn.active[data-mode="relationship"] {
  background: rgba(253, 121, 168, 0.12);
  color: #fd79a8;
}

.mode-btn.active[data-mode="friendship"] {
  background: rgba(253, 203, 110, 0.12);
  color: #fdcb6e;
}

.mode-description {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 0.75rem;
  line-height: 1.55;
  max-width: 720px;
}

.mode-description[data-mode="overall"] {
  color: #ffeaa7;
}

.mode-description[data-mode="money"] {
  color: #f0a500;
}

.mode-description[data-mode="sexy"] {
  color: #e84393;
}

.mode-description[data-mode="health"] {
  color: #00b894;
}

.mode-description[data-mode="spiritual"] {
  color: #a282f6;
}

.mode-description[data-mode="relax"] {
  color: #74b9ff;
}

.mode-description[data-mode="relationship"] {
  color: #fd79a8;
}

.mode-description[data-mode="friendship"] {
  color: #fdcb6e;
}

/* Financial Factors (Money mode detail view) */
.financial-factors {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.financial-factors li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  font-size: 0.85rem;
}

.factor-positive {
  background: rgba(0, 184, 148, 0.08);
}

.factor-negative {
  background: rgba(225, 112, 85, 0.08);
}

.factor-points {
  font-weight: 700;
  min-width: 3.5rem;
  font-variant-numeric: tabular-nums;
}

.factor-positive .factor-points {
  color: var(--green);
}

.factor-negative .factor-points {
  color: var(--red);
}

.factor-label {
  flex: 1;
  color: var(--text);
}

.factor-orb {
  color: var(--text-dim);
  font-size: 0.8rem;
}

/* Sexual Factors (Sexy mode detail view) */
.sexual-factors {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.sexual-factors li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  font-size: 0.85rem;
}

/* Health Factors (Health mode detail view) */
.health-factors {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.health-factors li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  font-size: 0.85rem;
}

/* Spiritual Factors (Spiritual mode detail view) */
.spiritual-factors {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.spiritual-factors li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  font-size: 0.85rem;
}

/* Relaxation Factors (Relax mode detail view) */
.relax-factors {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.relax-factors li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  font-size: 0.85rem;
}

/* Relationship Factors (Relationship mode detail view) */
.relationship-factors {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.relationship-factors li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  font-size: 0.85rem;
}

/* Friendship Factors (Friendship mode detail view) */
.friendship-factors {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.friendship-factors li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  font-size: 0.85rem;
}

/* Overall Factors (Overall mode detail view) */
.overall-factors {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.overall-factors li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  font-size: 0.85rem;
}

/* Filter controls */
.filter-controls {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: var(--bg);
  border-radius: var(--radius);
}

.filter-controls .form-group {
  min-width: 150px;
  flex: 1;
}

.results-count {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 0.5rem;
}

/* Score */
.score {
  font-weight: 700;
  font-family: var(--mono);
  color: var(--accent);
}

/* Influence tags */
.influence-tag {
  display: inline-block;
  font-size: 0.8rem;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  background: rgba(108, 92, 231, 0.12);
  color: var(--accent);
  margin: 0.1rem;
  white-space: nowrap;
}

.beneficial-tag {
  background: rgba(0, 184, 148, 0.12);
  color: var(--green);
}

.paran-tag {
  background: rgba(0, 184, 148, 0.12);
  color: var(--green);
}

.harmful-tag {
  background: rgba(225, 112, 85, 0.15);
  color: var(--red);
}

.influences-cell {
  max-width: 300px;
}

/* Safety margin */
.safety-good { color: var(--green); }
.safety-ok { color: var(--yellow); }
.safety-close { color: var(--red); }

/* Result rows */
.result-row {
  cursor: pointer;
  transition: background 0.15s;
}

.result-row.expanded {
  background: var(--bg-hover);
}

.detail-row td {
  padding: 0 !important;
  border-bottom: 2px solid var(--accent);
}

/* Detail view */
.detail-content {
  padding: 1rem 1.5rem;
  background: rgba(108, 92, 231, 0.03);
}

.detail-header {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.detail-score {
  font-family: var(--mono);
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.detail-content h4 {
  color: var(--text-dim);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 1rem 0 0.5rem;
}

.influence-detail {
  margin-bottom: 0.75rem;
  padding-left: 1rem;
  border-left: 2px solid var(--accent);
}

.influence-title {
  font-weight: 600;
  font-size: 0.95rem;
}

.influence-house {
  font-size: 0.85rem;
  color: var(--text-dim);
}

.influence-text {
  font-style: italic;
  font-size: 0.9rem;
  color: var(--text);
  margin-top: 0.25rem;
  line-height: 1.5;
}

.location-summary {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text);
  margin: 0.75rem 0;
  padding: 0.75rem 1rem;
  background: rgba(108, 92, 231, 0.06);
  border-radius: var(--radius);
  border-left: 3px solid var(--accent);
}

.detail-lines {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.detail-lines .influence-tag {
  font-size: 0.8rem;
  margin: 0.15rem;
}

/* Influence list (Planets on Angles / Parans) */
.influence-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.influence-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  font-size: 0.9rem;
  background: rgba(108, 92, 231, 0.04);
  border-left: 3px solid var(--accent);
}

.influence-row.sentiment-positive {
  border-left-color: var(--green);
  background: rgba(0, 184, 148, 0.06);
}

.influence-row.sentiment-negative {
  border-left-color: var(--red);
  background: rgba(225, 112, 85, 0.06);
}

.influence-row.sentiment-neutral {
  border-left-color: var(--yellow);
  background: rgba(253, 203, 110, 0.06);
}

.inf-planet {
  font-weight: 600;
  min-width: 0;
}

.inf-separator {
  color: var(--text-dim);
  font-weight: 300;
}

.inf-angle {
  color: var(--text-dim);
  font-size: 0.85rem;
}

.inf-strength {
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  margin-left: auto;
  white-space: nowrap;
}

.strength-strong {
  background: rgba(108, 92, 231, 0.15);
  color: var(--accent);
}

.strength-medium {
  background: rgba(108, 92, 231, 0.10);
  color: var(--accent);
}

.strength-weak {
  background: rgba(108, 92, 231, 0.06);
  color: var(--text-dim);
}

.strength-faint {
  background: transparent;
  color: var(--text-dim);
  opacity: 0.6;
}

.inf-sentiment {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  min-width: 4.5rem;
  text-align: center;
}

.inf-sentiment.sentiment-positive { color: var(--green); }
.inf-sentiment.sentiment-negative { color: var(--red); }
.inf-sentiment.sentiment-neutral { color: var(--yellow); }

.inf-distance {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-dim);
  min-width: 2.5rem;
  text-align: right;
}

.detail-clear {
  font-style: italic;
  color: var(--text-dim);
  margin: 0.75rem 0;
}

.detail-safety {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.safety-detail {
  margin-top: 1rem;
  padding: 0.5rem 0.75rem;
  background: rgba(0, 184, 148, 0.05);
  border-radius: var(--radius);
}

.safety-detail p {
  font-size: 0.9rem;
}

/* House ratings grid */
.house-ratings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.house-rating-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.4rem 0;
}

.house-rating-item label {
  margin-bottom: 0;
  color: var(--text);
  font-size: 0.9rem;
}

.house-desc {
  color: var(--text-dim);
  font-size: 0.75rem;
  display: block;
}

.house-rating-select {
  width: 120px;
  min-width: 120px;
  flex-shrink: 0;
}

/* Planet toggles */
.planet-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-bottom: 1rem;
}

.planet-toggle {
  min-width: 130px;
}

.city-not-listed {
  font-size: 0.78rem;
  color: var(--text-dim);
  opacity: 0.6;
  margin-bottom: 0.75rem;
}

.city-not-listed a {
  color: var(--accent);
  text-decoration: none;
  opacity: 0.8;
}

.city-not-listed a:hover {
  opacity: 1;
  text-decoration: underline;
}

.city-not-listed-hint {
  font-size: 0.75rem;
  color: var(--text-dim);
  opacity: 0.5;
  margin-top: 0.4rem;
}

.manual-check-note {
  font-size: 0.82rem;
  color: var(--text-dim);
  margin-bottom: 0.75rem;
  opacity: 0.7;
}

/* Manual check */
.manual-check {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.manual-check h3 {
  font-size: 1rem;
  margin-bottom: 0.75rem;
}

.check-safe {
  background: rgba(0, 184, 148, 0.08);
  border: 1px solid var(--green);
  border-radius: var(--radius);
  padding: 1rem;
  margin-top: 0.5rem;
}

.check-unsafe {
  background: rgba(225, 112, 85, 0.08);
  border: 1px solid var(--red);
  border-radius: var(--radius);
  padding: 1rem;
  margin-top: 0.5rem;
}

.check-unsafe ul {
  margin-left: 1.5rem;
  margin-top: 0.5rem;
}

.check-unsafe li {
  margin-bottom: 0.25rem;
}

/* Loading overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.loading-overlay.hidden {
  display: none;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 1rem;
}

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

/* Hidden class */
.hidden {
  display: none !important;
}

/* Settings section h3 */
.section-content h3 {
  font-size: 0.95rem;
  color: var(--text);
  margin: 1rem 0 0.5rem;
}

.section-content h3:first-child {
  margin-top: 0;
}

/* Responsive */
@media (max-width: 768px) {
  .form-row {
    flex-direction: column;
  }

  .form-group.half {
    min-width: 100%;
  }

  .filter-controls {
    flex-direction: column;
  }

  /* Mode selector: wrap into grid on mobile */
  .mode-selector {
    flex-wrap: wrap;
    width: 100%;
    border: none;
    gap: 0.35rem;
    border-radius: 0;
  }

  .mode-btn {
    flex-shrink: 0;
    padding: 0.4rem 0.7rem;
    font-size: 0.72rem;
    border-radius: 6px;
    border: 1px solid var(--border);
  }

  .mode-btn:not(:last-child) {
    border-right: 1px solid var(--border);
  }

  /* Results table → card layout on mobile */
  #results-table thead {
    display: none;
  }

  #results-table,
  #results-table tbody {
    display: block;
  }

  .result-row {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: 0.15rem 0.5rem;
    padding: 0.75rem 0.85rem;
    border-bottom: 1px solid var(--border);
    position: relative;
  }

  .result-row td {
    border-bottom: none;
    padding: 0;
  }

  /* City name — top left, prominent */
  .result-row td:nth-child(1) {
    grid-column: 1;
    grid-row: 1;
    font-weight: 600;
    font-size: 0.95rem;
  }

  /* Score — top right */
  .result-row td:nth-child(3) {
    grid-column: 2;
    grid-row: 1;
    text-align: right;
  }

  .result-row td:nth-child(3) .score {
    font-size: 1.1rem;
  }

  /* Country — second row left */
  .result-row td:nth-child(2) {
    grid-column: 1;
    grid-row: 2;
    font-size: 0.78rem;
    color: var(--text-dim);
  }

  /* Influences — second row, below country */
  .result-row td:nth-child(4) {
    grid-column: 1 / -1;
    grid-row: 3;
    margin-top: 0.3rem;
  }

  .result-row td:nth-child(4) .badge {
    font-size: 0.7rem;
    padding: 0.1rem 0.45rem;
  }

  /* Safety margin — top right below score */
  .result-row td:nth-child(5) {
    grid-column: 2;
    grid-row: 2;
    text-align: right;
    font-size: 0.75rem;
  }

  /* Tap hint chevron */
  .result-row::after {
    content: '›';
    position: absolute;
    right: 0.3rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.3rem;
    color: var(--text-dim);
    opacity: 0.35;
    transition: opacity 0.2s;
  }

  .result-row.expanded::after {
    content: '‹';
    opacity: 0.6;
  }

  .result-row:active {
    background: var(--bg-hover);
  }

  /* Detail row full width */
  .detail-row {
    display: block;
  }

  .detail-row td {
    display: block;
  }

  .detail-content {
    padding: 0.75rem;
  }

  /* House ratings grid */
  .house-ratings-grid {
    grid-template-columns: 1fr;
  }

  .profile-item {
    flex-direction: column;
    gap: 0.25rem;
  }

  .profile-item-label {
    min-width: unset;
  }
}

/* Tap hint for city rows — all screen sizes */
.result-row .tap-hint {
  font-size: 0.7rem;
  color: var(--text-dim);
  opacity: 0.4;
  display: none;
}

@media (max-width: 768px) {
  .result-row .tap-hint {
    display: none; /* chevron handles this on mobile */
  }
}

@media (min-width: 769px) {
  .result-row .tap-hint {
    display: inline;
  }
}

/* Personality Profile */
.profile-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.profile-item {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.85rem 1rem;
  border-radius: 8px;
  background: rgba(108, 92, 231, 0.03);
  border: 1px solid rgba(108, 92, 231, 0.08);
  transition: border-color 0.2s;
}

.profile-item:hover {
  border-color: rgba(108, 92, 231, 0.2);
}

.profile-item-label {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--accent);
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.profile-item-label .planet-glyph {
  font-size: 1.05rem;
}

.profile-item-label .placement-house {
  color: var(--text-dim, #888);
  font-weight: 400;
  margin-left: 0.15rem;
}

.profile-item-text {
  font-size: 0.88rem;
  line-height: 1.65;
  color: var(--text);
  opacity: 0.9;
}

/* Location detail bullet list */
.location-bullets {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.location-bullet {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  border-left: 3px solid var(--border);
}

.location-bullet.sentiment-positive {
  border-left-color: var(--green);
  background: rgba(39, 174, 96, 0.04);
}

.location-bullet.sentiment-negative {
  border-left-color: var(--red);
  background: rgba(231, 76, 60, 0.04);
}

.location-bullet.sentiment-neutral {
  border-left-color: var(--yellow);
  background: rgba(241, 196, 15, 0.04);
}

.bullet-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.bullet-label {
  font-weight: 600;
  font-size: 0.85rem;
}

.sentiment-positive .bullet-label { color: var(--green); }
.sentiment-negative .bullet-label { color: var(--red); }
.sentiment-neutral .bullet-label { color: #d4a017; }

.bullet-strength {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.bullet-strength.strength-strong { background: rgba(108, 92, 231, 0.15); color: var(--accent); }
.bullet-strength.strength-medium { background: rgba(108, 92, 231, 0.08); color: var(--accent); }
.bullet-strength.strength-weak { background: rgba(0, 0, 0, 0.06); color: #888; }

.bullet-orb {
  font-size: 0.75rem;
  color: #888;
}

.bullet-text {
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--text);
}
