:root {
    --bg: #ffffff;
    --text: #1a1a1a;
    --text-muted: #666460;
    --border: #d8d5cd;
    --accent: #3454a3;

    --neutral-text: #666460;
    --info-text: #1f4694;
    --success-text: #1f6b3a;
    --danger-text: #a3372a;

    --radius: 6px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 17px;
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
}

a {
    color: var(--accent);
}

.page {
    max-width: 720px;
    margin: 0 auto;
    padding: 1rem 1rem 3rem;
}

.topbar {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.topbar h1 {
    font-size: 1.3rem;
    margin: 0;
}

/* Status filter -- a dropdown scales to any number of statuses without
   wrapping or scrolling, unlike a tab bar or a growing vertical list. */

.status-select {
    display: block;
    width: 100%;
    padding: 0.6rem 0.75rem;
    font-size: 1rem;
    font-family: inherit;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--text);
    margin-bottom: 1.25rem;
}

.status-select:focus {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}

/* Search */

.search-input {
    display: block;
    width: 100%;
    padding: 0.6rem 0.75rem;
    font-size: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--text);
    margin-bottom: 1.25rem;
}

.search-input:focus {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}

/* Person list -- plain divided rows, no cards */

.person-list {
    list-style: none;
    margin: 0;
    padding: 0;
    border-top: 1px solid var(--border);
}

.person-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 0.1rem;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    color: var(--text);
}

.person-row:hover,
.person-row:active {
    background: #f4f2ee;
}

.person-row__info {
    min-width: 0;
}

.person-row__name {
    font-size: 1.1rem;
    font-weight: 600;
}

.person-row__meta {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 0.15rem;
}

.person-status {
    flex: none;
    font-size: 0.95rem;
    font-weight: 600;
    white-space: nowrap;
}

.status-select-inline {
    flex: none;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
}

.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 2.5rem 1rem;
}

.status--neutral { color: var(--neutral-text); }
.status--info { color: var(--info-text); }
.status--success { color: var(--success-text); }
.status--danger { color: var(--danger-text); }

/* Person detail */

.actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.back-link,
.button {
    display: inline-block;
    padding: 0.6rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    text-decoration: none;
    font-size: 1rem;
}

.back-link:hover,
.back-link:active,
.button:hover,
.button:active {
    background: #f4f2ee;
}

.detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.25rem;
}

.detail-header h1 {
    font-size: 1.4rem;
    margin: 0;
}

.detail-email {
    color: var(--text-muted);
    margin: 0 0 1.5rem;
}

.detail-section {
    margin-bottom: 2rem;
}

.detail-section h2 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin: 0 0 0.5rem;
}

.answer-list {
    margin: 0;
    border-top: 1px solid var(--border);
}

.answer-list__item {
    padding: 0.75rem 0.1rem;
    border-bottom: 1px solid var(--border);
}

.answer-list__label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.15rem;
}

.answer-list__value {
    font-size: 1.05rem;
}

.notes-textarea {
    display: block;
    width: 100%;
    min-height: 8rem;
    padding: 0.75rem;
    font: inherit;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    resize: vertical;
}

.notes-textarea:focus {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}

.notes-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.notes-status {
    color: var(--text-muted);
    font-size: 0.9rem;
}

@media (min-width: 640px) {
    .page {
        padding: 2rem 1.5rem 4rem;
    }
}

@media (min-width: 900px) {
    .page {
        max-width: 900px;
    }

    /* Status filter and search share a row instead of stacking -- there's room */
    .toolbar {
        display: flex;
        align-items: center;
        gap: 1rem;
        margin-bottom: 1.25rem;
    }

    .toolbar .status-select {
        width: 220px;
        flex: none;
        margin-bottom: 0;
    }

    .toolbar .search-input {
        width: 260px;
        flex: none;
        margin-bottom: 0;
    }

    /* Long answer lists (20+ fields) read better in two columns than one
       tall single-column scroll once there's width to spare. */
    .answer-list {
        columns: 2;
        column-gap: 2rem;
    }

    .answer-list__item {
        break-inside: avoid;
    }

    .login-form {
        max-width: 320px;
    }

    .login-form .search-input {
        margin-bottom: 0.75rem;
    }
}
