/* --- Core Layout --- */
  body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: #f4f7f6;
    color: #333;
    margin: 0;
    line-height: 1.6;
  }

  .container {
    max-width: 900px;
    margin: 40px auto;
    padding: 20px;
  }

  header {
    text-align: center;
    margin-bottom: 40px;
  }

  h1 { color: #2c3e50; margin-bottom: 10px; }

  /* --- Search Grid --- */
  .search-grid {
    display: grid;
    grid-template-columns: 1fr 50px 1fr;
    gap: 20px;
    align-items: start;
  }

  /* For mobile: stack the cards */
  @media (max-width: 768px) {
    .search-grid { grid-template-columns: 1fr; }
    .vs-divider { padding: 10px 0; }
  }

  .selection-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    position: relative; /* Essential for absolute search results */
  }

  label {
    font-weight: bold;
    font-size: 0.9em;
    color: #666;
    text-transform: uppercase;
  }

  /* --- Input & Button Group --- */
  .input-group {
    display: flex;
    gap: 5px;
    margin: 10px 0;
  }

  .input-group input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 16px; /* Prevents iOS zoom on focus */
  }

  .btn-search {
    padding: 10px 15px;
    background: #2196F3;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
  }

  .btn-search:hover { background: #1976D2; }

  /* --- Search Results Dropdown --- */
  /* Update your search-results block */
  .search-results {
    position: absolute;
    top: 75px;
    left: 20px;
    right: 20px;
    background: white;
    z-index: 1000;
    border-radius: 4px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    max-height: 250px;
    overflow-y: auto;

    /* ADD THESE TWO LINES: */
    border: none; /* Hide border by default */
    display: none; /* Hide box by default */
  }

  /* Show the box only if it HAS content */
  .search-results:not(:empty) {
    display: block;
    border: 1px solid #eee;
  }

  .result-item {
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    font-size: 0.95em;
    transition: background 0.2s;
  }

  .result-item:last-child { border-bottom: none; }
  .result-item:hover { background: #f0f7ff; color: #2196F3; }

  .result-info {
    padding: 15px;
    color: #888;
    font-style: italic;
    text-align: center;
  }

  /* --- Selection Feedback --- */
  .selected-badge {
    background: #e0f2f1;
    padding: 10px;
    margin-top: 10px;
    border-radius: 4px;
    color: #00796b;
    font-weight: bold;
    text-align: center;
    border: 1px dashed #b2dfdb;
  }

  .vs-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #999;
    height: 100px; /* Aligns roughly with input vertical center */
  }

  /* --- Relationship Result View --- */
  .result-container {
    margin-top: 30px;
    padding: 30px;
    background: #fff;
    border-left: 5px solid #2196F3;
    border-radius: 4px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
  }

  #relationship-headline {
    color: #2c3e50;
    margin-top: 0;
  }

  #path-steps p {
    margin: 8px 0;
    padding-left: 20px;
    position: relative;
    color: #555;
  }

  #path-steps p::before {
    content: "→";
    position: absolute;
    left: 0;
    color: #2196F3;
  }

  /* --- Setup/Privacy Overlay --- */
  #setup-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: #f4f7f6;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
  }

  .btn-download {
    position: absolute;
    top: 20px;
    right: 20px;
    padding: 10px 16px;
    background-color: #4cafef;
    color: white;
    font-weight: bold;
    text-decoration: none;
    border-radius: 6px;
    box-shadow: 0 3px 6px rgba(0,0,0,0.2);
    transition: background 0.2s, transform 0.1s;
}

.btn-download:hover {
    background-color: #66b3ff;
    transform: translateY(-2px);
}

  .setup-card {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 35px rgba(0,0,0,0.1);
    max-width: 450px;
    width: 90%;
    text-align: center;
  }

  .setup-card input[type="file"] {
    margin: 20px 0;
    padding: 10px;
    border: 1px dashed #2196F3;
    width: 100%;
    border-radius: 4px;
    cursor: pointer;
  }

  /* --- Utility --- */
  .hidden { display: none !important; }

  .btn-reset {
    background: #95a5a6;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8em;
    margin-top: 10px;
  }
  .btn-reset:hover { background: #7f8c8d; }
  .lifespan-text {
    font-size: 0.85em;
    color: #888;
    margin-left: 5px;
    font-weight: normal;
  }

  .result-item strong {
    color: #2c3e50;
  }