/* ===== Referral Insights - page styles (reuses /styles.css variables) ===== */

.in-hero {
    background: var(--bg-white);
    padding: 104px 0 28px;
}
@media (min-width: 640px) { .in-hero { padding: 120px 0 32px; } }
.in-hero h1 {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.12;
    color: var(--text-primary);
    margin: 0 0 10px;
    letter-spacing: -0.025em;
}
@media (min-width: 640px) { .in-hero h1 { font-size: 2.5rem; } }
.in-hero__subtitle {
    font-size: 1.0625rem;
    color: var(--text-body);
    max-width: 640px;
    margin: 0 0 6px;
    line-height: 1.6;
}
.in-hero__trust {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.5;
}
.in-hero__back {
    display: inline-block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
    margin-bottom: 14px;
}
.in-hero__back:hover { text-decoration: underline; }

/* Control bar */
.in-controls {
    background: var(--bg-light);
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 20;
}
.in-controls__grid {
    display: grid;
    gap: 12px;
    align-items: end;
}
@media (min-width: 720px) {
    .in-controls__grid { grid-template-columns: 1fr 1.4fr auto; }
}
.in-field__label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.in-select,
.in-input {
    width: 100%;
    padding: 11px 14px;
    font-size: 0.9rem;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--bg-white);
    border: 1.5px solid var(--border-light);
    border-radius: var(--radius-md);
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s var(--ease-smooth), box-shadow 0.2s var(--ease-smooth);
}
.in-select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748B' d='M2.5 4.5L6 8l3.5-3.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 12px;
    padding-right: 36px;
    cursor: pointer;
}
.in-select:focus,
.in-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}
.in-input::placeholder { color: var(--text-muted); }

/* Searchable picker */
.in-picker { position: relative; }
.in-picker__list {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    max-height: 300px;
    overflow-y: auto;
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 30;
    padding: 6px;
}
.in-picker__list[hidden] { display: none; }
.in-picker__item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 10px;
    border: 0;
    background: transparent;
    font-family: inherit;
    font-size: 0.875rem;
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    cursor: pointer;
}
.in-picker__item:hover,
.in-picker__item:focus,
.in-picker__item.is-active {
    background: var(--bg-tinted);
    outline: none;
}
.in-picker__item small {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
}
.in-picker__empty {
    padding: 10px;
    font-size: 0.8125rem;
    color: var(--text-muted);
}
.in-toggle {
    display: inline-flex;
    border: 1.5px solid var(--border-light);
    border-radius: var(--radius-pill);
    background: var(--bg-white);
    padding: 3px;
}
.in-toggle button {
    border: 0;
    background: transparent;
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-muted);
    padding: 7px 14px;
    border-radius: var(--radius-pill);
    cursor: pointer;
}
.in-toggle button.is-active {
    background: var(--accent);
    color: #fff;
}

/* Tabs */
.in-tabs {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-light);
}
.in-tabs__list {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.in-tab {
    flex: 0 0 auto;
    border: 0;
    background: transparent;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    padding: 16px 14px 14px;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.15s var(--ease-smooth);
}
.in-tab:hover { color: var(--text-primary); }
.in-tab.is-active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* Views */
.in-view {
    background: var(--bg-light);
    padding: 40px 0 64px;
}
.in-view[hidden] { display: none; }
.in-view__head { margin-bottom: 20px; }
.in-view__head h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 6px;
}
.in-view__head p {
    font-size: 0.875rem;
    color: var(--text-body);
    margin: 0;
    line-height: 1.6;
}
.in-method {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 8px 0 0;
}
.in-method::before {
    content: "i";
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent-pale);
    color: var(--accent);
    font-size: 0.65rem;
    font-weight: 700;
    margin-top: 2px;
}

.in-grid {
    display: grid;
    gap: 20px;
}
@media (min-width: 960px) {
    .in-grid--2 { grid-template-columns: 1fr 1fr; }
    .in-grid--main { grid-template-columns: 1.4fr 1fr; }
}

.in-card {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-md);
    min-width: 0;
}
.in-card--accent {
    border-color: var(--accent);
    border-width: 2px;
}
.in-card__title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 4px;
}
.in-card__sub {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin: 0 0 16px;
    line-height: 1.5;
}
.in-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

/* Member identity block */
.in-me {
    display: flex;
    gap: 14px;
    align-items: center;
    margin-bottom: 18px;
}
.in-me__avatar {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9375rem;
}
.in-me__name {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}
.in-me__meta {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin: 2px 0 0;
}
.in-me__meta strong { color: var(--accent); font-weight: 600; }

/* Audience rows (reverse view) */
.in-rows { display: flex; flex-direction: column; gap: 8px; }
.in-row {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(90px, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    background: var(--bg-white);
}
.in-row--top {
    background: var(--accent-pale);
    border-color: rgba(37, 99, 235, 0.25);
}
.in-row__label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    min-width: 0;
}
.in-row__group {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    background: var(--bg-tinted);
    padding: 2px 7px;
    border-radius: var(--radius-pill);
}
.in-row__ranks {
    font-size: 0.75rem;
    color: var(--text-body);
    text-align: right;
    line-height: 1.4;
    white-space: nowrap;
}
.in-row__ranks b { color: var(--text-primary); }
.in-row__ranks .is-top { color: var(--accent); font-weight: 700; }
@media (max-width: 560px) {
    .in-row { grid-template-columns: 1fr auto; }
    .in-row .in-bar { grid-column: 1 / -1; }
}

/* Bars */
.in-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.in-bar__track {
    flex: 1;
    height: 6px;
    background: var(--bg-tinted);
    border-radius: 3px;
    overflow: hidden;
}
.in-bar__fill {
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
}
.in-bar__fill--muted { background: #94A3B8; }
.in-bar__fill--green { background: var(--green); }
.in-bar__value {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-primary);
    min-width: 30px;
    text-align: right;
}

/* Pitch box */
.in-pitch {
    font-size: 0.9375rem;
    color: var(--text-primary);
    line-height: 1.65;
    background: var(--bg-light);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius-sm);
    padding: 16px 18px;
    margin: 0 0 14px;
    white-space: pre-wrap;
}
.in-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.in-copy {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--accent);
    background: var(--bg-white);
    border: 1.5px solid var(--accent);
    border-radius: var(--radius-pill);
    padding: 8px 16px;
    cursor: pointer;
    transition: background 0.15s var(--ease-smooth), color 0.15s var(--ease-smooth);
}
.in-copy:hover { background: var(--accent); color: #fff; }
.in-copy.is-done { background: var(--green-bg); border-color: var(--green); color: var(--green-text); }

/* People list (one-to-ones, ask results) */
.in-people { display: flex; flex-direction: column; gap: 10px; }
.in-person {
    display: grid;
    grid-template-columns: 32px 1fr;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: var(--bg-white);
    cursor: default;
}
.in-person--selectable { cursor: pointer; transition: border-color 0.15s var(--ease-smooth), box-shadow 0.15s var(--ease-smooth); }
.in-person--selectable:hover { border-color: var(--accent); }
.in-person.is-selected { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.in-person__rank {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--bg-tinted);
    color: var(--text-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    margin-top: 2px;
}
.in-person:first-child .in-person__rank { background: var(--accent); color: #fff; }
.in-person__name {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}
.in-person__meta {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin: 1px 0 6px;
}
.in-person__meta strong { color: var(--accent); font-weight: 600; }
.in-person__line {
    font-size: 0.8125rem;
    color: var(--text-body);
    margin: 4px 0 0;
    line-height: 1.5;
}
.in-person__line b { color: var(--text-primary); font-weight: 600; }
.in-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.in-tag {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-body);
    background: var(--bg-tinted);
    border-radius: var(--radius-pill);
    padding: 3px 9px;
}
.in-tag--accent { background: var(--accent-pale); color: var(--accent); }
.in-tag--green { background: var(--green-bg); color: var(--green-text); }
.in-tag--muted { background: var(--bg-light); color: var(--text-muted); border: 1px dashed var(--border-light); }

/* Seat list (power team) */
.in-seats { display: flex; flex-direction: column; gap: 8px; }
.in-seat {
    display: grid;
    grid-template-columns: 22px 1fr;
    gap: 10px;
    align-items: start;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
}
.in-seat--present { background: var(--green-bg); border-color: rgba(22, 163, 74, 0.25); }
.in-seat--missing { background: var(--red-bg); border-color: rgba(220, 38, 38, 0.2); }
.in-seat__icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 800;
    color: #fff;
    margin-top: 1px;
}
.in-seat--present .in-seat__icon { background: var(--green); }
.in-seat--missing .in-seat__icon { background: var(--red); }
.in-seat__name { font-size: 0.875rem; font-weight: 700; color: var(--text-primary); margin: 0; }
.in-seat__who { font-size: 0.8125rem; color: var(--text-body); margin: 2px 0 0; line-height: 1.5; }
.in-seat__who span { color: var(--text-muted); }

/* Cluster cards */
.in-clusters { display: grid; gap: 16px; }
@media (min-width: 720px) { .in-clusters { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .in-clusters { grid-template-columns: repeat(3, 1fr); } }
.in-cluster {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    box-shadow: var(--shadow-sm);
}
.in-cluster__title {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 2px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.in-cluster__sub { font-size: 0.75rem; color: var(--text-muted); margin: 0 0 12px; }
.in-cluster ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.in-cluster li { font-size: 0.8125rem; color: var(--text-body); line-height: 1.4; }
.in-cluster li b { color: var(--text-primary); font-weight: 600; }
.in-cluster li.is-seed b { color: var(--accent); }
.in-cluster li span { color: var(--text-muted); }

/* Stats and summary */
.in-summary {
    background: var(--bg-dark);
    color: var(--text-white);
    border-radius: var(--radius-lg);
    padding: 22px 24px;
    margin-bottom: 20px;
}
.in-summary p { margin: 0; font-size: 1rem; line-height: 1.55; }
.in-summary p b { color: #93C5FD; }
.in-summary small { display: block; margin-top: 6px; font-size: 0.78rem; color: var(--text-light); }
.in-stats { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); margin-bottom: 20px; }
@media (min-width: 720px) { .in-stats { grid-template-columns: repeat(4, 1fr); } }
.in-stat {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 14px 16px;
}
.in-stat__value { font-size: 1.5rem; font-weight: 800; color: var(--text-primary); letter-spacing: -0.02em; }
.in-stat__label { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-top: 2px; }

/* Tables */
.in-table-wrap { overflow-x: auto; }
.in-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
}
.in-table th,
.in-table td {
    text-align: left;
    padding: 9px 10px;
    border-bottom: 1px solid var(--border-subtle);
    vertical-align: top;
}
.in-table th {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 700;
    white-space: nowrap;
}
.in-table td { color: var(--text-body); }
.in-table td b { color: var(--text-primary); font-weight: 600; }
.in-table tr.is-me td { background: var(--accent-pale); }
.in-table td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.in-table th.num { text-align: right; }
.in-table .in-bar { min-width: 120px; }

/* Ask builder */
.in-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.in-chip {
    display: inline-block;
    padding: 7px 14px;
    font-size: 0.8125rem;
    font-family: inherit;
    color: var(--text-body);
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: border-color 0.2s var(--ease-smooth), color 0.2s var(--ease-smooth), background 0.2s var(--ease-smooth);
}
.in-chip:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-pale);
}
.in-ask__scopes { display: grid; gap: 16px; margin-top: 16px; }
@media (min-width: 900px) { .in-ask__scopes { grid-template-columns: 1fr 1fr; } }
.in-note {
    font-size: 0.8125rem;
    color: var(--text-muted);
    background: var(--bg-tinted);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    margin: 0;
    line-height: 1.5;
}
.in-note--warn { background: #FFFBEB; color: #92400E; }
.in-empty {
    font-size: 0.875rem;
    color: var(--text-muted);
    padding: 20px;
    text-align: center;
    border: 1px dashed var(--border-light);
    border-radius: var(--radius-md);
}
.in-loading {
    padding: 80px 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Brand bar / footer note (copied language from index) */
.in-footer-note {
    background: var(--bg-white);
    padding: 28px 0 36px;
    text-align: center;
    border-top: 1px solid var(--border-light);
}
.in-footer-note p {
    font-size: 0.8125rem;
    color: var(--text-muted);
    max-width: 640px;
    margin: 0 auto;
    line-height: 1.6;
}
.in-footer-note p a { color: var(--text-body); font-weight: 600; text-decoration: none; }
.in-footer-note p a:hover { color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
    .in-copy, .in-tab, .in-person--selectable { transition: none; }
}
