:root {
    --primary: #0a66c2;
    --primary-dark: #004182;
    --bg: #f3f2ef;
    --card-bg: #ffffff;
    --text: #1d2226;
    --text-light: #5e6b73;
    --border: #e0e0e0;
    --error: #d32f2f;
    --success: #2e7d32;
}

/* Regular */
@font-face {
  font-family: 'Ubuntu';
  src: url('/fonts/Ubuntu/Ubuntu-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
}

/* Italic */
@font-face {
  font-family: 'Ubuntu';
  src: url('/fonts/Ubuntu/Ubuntu-Italic.ttf') format('truetype');
  font-weight: 400;
  font-style: italic;
}

/* Light */
@font-face {
  font-family: 'Ubuntu';
  src: url('/fonts/Ubuntu/Ubuntu-Light.ttf') format('truetype');
  font-weight: 300;
  font-style: normal;
}

/* Light Italic */
@font-face {
  font-family: 'Ubuntu';
  src: url('/fonts/Ubuntu/Ubuntu-LightItalic.ttf') format('truetype');
  font-weight: 300;
  font-style: italic;
}

/* Medium */
@font-face {
  font-family: 'Ubuntu';
  src: url('/fonts/Ubuntu/Ubuntu-Medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
}

/* Medium Italic */
@font-face {
  font-family: 'Ubuntu';
  src: url('/fonts/Ubuntu/Ubuntu-MediumItalic.ttf') format('truetype');
  font-weight: 500;
  font-style: italic;
}

/* Bold */
@font-face {
  font-family: 'Ubuntu';
  src: url('/fonts/Ubuntu/Ubuntu-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
}

/* Bold Italic */
@font-face {
  font-family: 'Ubuntu';
  src: url('/fonts/Ubuntu/Ubuntu-BoldItalic.ttf') format('truetype');
  font-weight: 700;
  font-style: italic;
}

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

body {
    font-family: 'Ubuntu', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; width: 100%; }

/* Site header only — this selector is scoped so it does NOT apply
   to <header class="post-head"> inside posts. */
header.site-header {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    padding: 10px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}
header.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; max-width: 820px; }
.logo img { height: 44px; display: block; }

nav { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
nav a { text-decoration: none; color: var(--text); font-weight: 500; font-size: 0.95rem; }
nav a:hover { color: var(--primary); }

.btn, .btn-primary, .btn-danger, .btn-small {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 6px 14px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.82rem;
    line-height: 1.2;
    border: none;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    font-family: inherit;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn { background: transparent; color: var(--primary); border: 1px solid var(--primary); }
.btn:hover { background: var(--primary); color: #fff; }
.btn-danger { background: transparent; color: var(--error); border: 1px solid var(--error); }
.btn-danger:hover { background: var(--error); color: #fff; }

main { flex: 1; padding: 40px 0; }

@media (max-width: 500px) {
    .connection-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    .connection-actions .inline-form,
    .connection-actions form {
        width: 100%;
    }
    .connection-actions .conn-action {
        width: 100%;
        min-width: 0;
    }
}

@media (max-width: 640px) {
    .profile-owner-actions {
        justify-content: center;
    }
}

.hero {
    text-align: center;
    padding: 70px 20px;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.hero h1 { font-size: 3rem; color: var(--primary); margin-bottom: 10px; }
.hero p { font-size: 1.25rem; color: var(--text-light); margin-bottom: 30px; }

.form-card {
    max-width: 520px;
    margin: 0 auto;
    background: var(--card-bg);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}
.form-card h1 { margin-bottom: 20px; font-size: 1.75rem; }
.form-card label { display: block; margin-bottom: 15px; font-weight: 500; font-size: 0.95rem; }
.form-card input, .form-card textarea, .form-card select {
    width: 100%;
    padding: 12px 14px;
    margin-top: 6px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    background: #fff;
    transition: border-color 0.2s;
}
.form-card input:focus, .form-card textarea:focus, .form-card select:focus {
    outline: none; border-color: var(--primary);
}
.form-card button { width: 100%; margin-top: 10px; padding: 12px; font-size: 1rem; }
.form-card p { margin-top: 20px; text-align: center; font-size: 0.9rem; color: var(--text-light); }
.form-card p a:not([class*="btn"]) {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}
.row { display: flex; gap: 14px; }
.row > * { flex: 1; }
.checkbox-line { display: flex; align-items: center; gap: 8px; margin-bottom: 15px; font-weight: 500; }
.checkbox-line input { width: auto; margin: 0; }
@media (max-width: 640px) {
    .notify-prefs .checkbox-line {
        display: block;
        padding: 14px 0;
        font-size: 1rem;
        line-height: 1.45;
        cursor: pointer;
    }

    .notify-prefs .checkbox-line + .checkbox-line {
        border-top: 1px solid var(--border);
    }

    .notify-prefs .checkbox-line input[type="checkbox"] {
        width: 22px;
        height: 22px;
        margin: 0 10px 0 0;
        vertical-align: -4px;
        flex: 0 0 auto;
        accent-color: var(--primary);
    }

    .notify-prefs .checkbox-line .muted {
        display: block;
        margin: 4px 0 0 32px;
        font-size: 0.85rem;
        font-weight: 400;
    }
}


.error   { background: #ffebee; color: var(--error);   padding: 12px; border-radius: 8px; margin-bottom: 20px; font-size: 0.9rem; }
.success { background: #e8f5e9; color: var(--success); padding: 12px; border-radius: 8px; margin-bottom: 20px; font-size: 0.9rem; }
.muted   { color: var(--text-light); font-size: 0.9rem; }

.section-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

/* ---------------- Homepage ---------------- */

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
}
.stat-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px 12px;
    background: #f7fafc;
    border: 1px solid var(--border);
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}
.stat-tile:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 10px rgba(10, 102, 194, 0.12);
    transform: translateY(-1px);
}
.stat-tile .stat-num {
    font-size: 1.55rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.1;
}
.stat-tile .stat-label {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 4px;
    text-align: center;
}
.stat-tile.is-alert {
    background: #fff5f5;
    border-color: #f1c3c3;
}
.stat-tile.is-alert .stat-num { color: var(--error); }

.alert-banner {
    margin-top: 18px;
    padding: 14px 18px;
    background: #eef4fb;
    border: 1px solid #c9dcf1;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.alert-banner p { margin: 0; font-size: 0.92rem; color: var(--text); }

.completion-bar {
    height: 6px;
    background: #e9eef3;
    border-radius: 4px;
    overflow: hidden;
}
.completion-bar span {
    display: block;
    height: 100%;
    background: var(--primary);
    border-radius: 4px;
    transition: width 0.3s;
}

.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.hero-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 20px;
    margin-top: 28px;
}
.feature-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 26px 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.feature-card h3 {
    font-size: 1.05rem;
    margin-bottom: 8px;
    color: var(--primary);
}
.feature-card p {
    font-size: 0.95rem;
    color: var(--text-light);
    margin: 0;
    line-height: 1.55;
}

/* ---------------- Signed out homepage index.php ---------------- */

.example-section {
    margin: 48px auto 0;
    text-align: center;
}

.example-section h2 {
    margin-bottom: 6px;
}

.example-section .muted {
    margin-bottom: 24px;
}

.example-frame {
    margin: 0 auto;
    width: 85%;
    border: 1px solid var(--border, #e2e2e2);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .12);
    background: #fff;
    line-height: 0;
}

.example-frame img {
    display: block;
    width: 100%;
    height: auto;
}

.example-caption {
    margin-top: 14px;
    font-size: .9rem;
}

/* ================================================================== */
/*  Signed-out landing page                                           */
/* ================================================================== */

.hero-landing {
    text-align: center;
    padding: 80px 24px 60px;
    position: relative;
    isolation: isolate;      /* keeps the z-index contained */
    background: #ffffff;     /* base colour behind the image */
    overflow: hidden;        /* clips the image to the border-radius */
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.hero-landing::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('/image/homepage_bg1.webp') center / cover no-repeat;
    opacity: 0.06;
    z-index: -1;
    pointer-events: none;    /* clicks pass through to buttons */
}

.hero-landing .btn-hero:not(.btn-primary) {
    background: #ffffff;
    border: 1px solid var(--border);
}
.hero-landing .btn-hero:not(.btn-primary):hover {
    background: #f4f8fd;
    border-color: var(--primary);
    color: var(--primary);
}

.hero-eyebrow {
    display: inline-block;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--primary);
    background: #eaf2fb;
    padding: 5px 12px;
    border-radius: 20px;
    margin-bottom: 20px;
}

.hero-landing h1 {
    font-size: clamp(2rem, 5vw, 3.25rem);
    line-height: 1.1;
    color: var(--text);
    margin: 0 0 18px;
    font-weight: 700;
}

.hero-landing .hero-sub {
    font-size: 1.08rem;
    line-height: 1.6;
    color: color-mix(in srgb, var(--text-light), #000000 40%);
    max-width: 640px;
    margin: 0 auto 10px;
}

.hero-landing .hero-note {
    margin-bottom: 16px;
    font-size: 1rem;
    color: color-mix(in srgb, var(--text-light), #000000 40%);
}

.btn-hero {
    padding: 14px 28px;
    font-size: 1rem;
    border-radius: 26px;
}

/* ---- Landing blocks ---- */

.landing-section {
    margin-top: 28px;
    background: var(--card-bg);
    border-radius: 12px;
    padding: 36px 32px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.section-head-center {
    justify-content: center;
    text-align: center;
    margin-bottom: 26px;
}
.section-head-center h2 {
    font-size: 1.6rem;
    font-weight: 700;
}

/* ---- How it works (Steps 1,2,3,4 on signed out homepage index.php) ---- */

.steps-title { margin-bottom: 4px; }

.steps {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
    padding: 0;
    margin: 0;
}
.steps li { padding: 0; }

/* 4th step sits on its own full-width row */
.steps li:nth-child(4) {
    grid-column: 1 / -1;
}

.step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 12px;
}
.steps h3 {
    font-size: 1.05rem;
    margin-bottom: 6px;
    color: var(--text);
}
.steps p {
    color: var(--text-light);
    font-size: 0.92rem;
    line-height: 1.55;
    margin: 0;
}

/* On narrow screens stack them all vertically */
@media (max-width: 760px) {
    .steps { grid-template-columns: 1fr; }
    .steps li:nth-child(4) { grid-column: auto; }
}

/* ---- Example section heading size ---- */

.example-section h2 {
    font-size: 1.6rem;
    font-weight: 700;
}

/* ---- Final CTA band ---- */

.final-cta {
    margin-top: 28px;
    background: var(--primary);
    color: #fff;
    border-radius: 12px;
    padding: 48px 32px;
    text-align: center;
    box-shadow: 0 4px 18px rgba(10, 102, 194, 0.25);
}
.final-cta h2 {
    font-size: 1.7rem;
    margin-bottom: 10px;
    color: #fff;
}
.final-cta p {
    font-size: 1rem;
    color: rgba(255,255,255,0.88);
    margin-bottom: 24px;
}
.final-cta .btn-hero {
    background: #fff;
    color: var(--primary);
    border: none;
}
.final-cta .btn-hero:hover {
    background: #eef5fc;
    color: var(--primary-dark);
}

@media (max-width: 640px) {
    .hero-landing { padding: 56px 20px 40px; }
    .landing-section { padding: 26px 20px; }
    .final-cta { padding: 36px 22px; }
    .btn-hero { width: 100%; }
    .hero-actions { flex-direction: column; }
    .hero-actions .btn,
    .hero-actions .btn-primary { width: 100%; }
}

/* ---------------- Profile ---------------- */

.profile-card {
    max-width: 820px;
    margin: 0 auto;
    background: var(--card-bg);
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}
.profile-header { display: flex; gap: 24px; align-items: center; margin-bottom: 10px; }
.avatar {
    width: 96px; height: 96px; border-radius: 50%;
    background: var(--primary); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 2.2rem; font-weight: 700; flex-shrink: 0;
    overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-sm { width: 52px; height: 52px; font-size: 1.2rem; }
.avatar-lg { width: 128px; height: 128px; font-size: 2.8rem; }
.profile-header h1 { font-size: 1.85rem; margin-bottom: 4px; }
.headline { color: var(--text); font-size: 1.05rem; }
.location, .occupation { color: var(--text-light); font-size: 0.95rem; }

.section { margin-top: 30px; padding-top: 24px; border-top: 1px solid var(--border); }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0px; gap: 12px; }
.section-head h2 { font-size: 1.35rem; font-weight: 720; }
.section p {
    color: var(--text-light);
    overflow-wrap: anywhere;
    word-break: break-word;
}
.section p a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}
.section p a:hover {
    text-decoration: underline;
}
.entry {
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}
.entry:last-child { border-bottom: none; }
.entry h3 { font-size: 1.05rem; }
.entry .meta { color: var(--text-light); font-size: 0.9rem; }
.entry > div {
    flex: 1 1 auto;
    min-width: 0;
}
.entry .desc {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-top: 6px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
    max-width: 100%;
}
.entry-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
    align-items: center;
    white-space: nowrap;
}
.entry-actions form {
    display: inline-flex;
    align-items: center;
    margin: 0;
    padding: 0;
}
.entry-actions form button {
    margin: 0;
}

.tag-list { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
    background: #eef3f8; color: var(--primary-dark);
    border-radius: 20px; padding: 6px 14px; font-size: 0.88rem;
    display: inline-flex; align-items: center; gap: 8px;
}
.tag form { display: inline; }
.tag button {
    background: none; border: none; cursor: pointer;
    color: var(--text-light); font-size: 1rem; line-height: 1; padding: 0;
}
.tag button:hover { color: var(--error); }

/* ---------------- People grid ---------------- */

.search-bar {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    margin-bottom: 24px;
}
.search-bar form { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.search-bar label { flex: 1 1 180px; font-size: 0.85rem; font-weight: 600; color: var(--text-light); }
.search-bar input, .search-bar select {
    width: 100%; padding: 10px 12px; margin-top: 4px;
    border: 1px solid var(--border); border-radius: 8px;
    font-size: 0.95rem; font-family: inherit; background: #fff;
}
.search-bar button { padding: 11px 26px; }

.people-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 18px;
}
.person-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 22px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    text-decoration: none;
    color: inherit;
    display: flex;
    gap: 14px;
    align-items: flex-start;
    transition: box-shadow 0.2s, transform 0.2s;
}
.person-card:hover { box-shadow: 0 6px 20px rgba(0,0,0,0.12); transform: translateY(-2px); }
.person-card h3 { font-size: 1rem; margin-bottom: 2px; }
.person-card .headline { font-size: 0.88rem; color: var(--text-light); }
.person-card .location { font-size: 0.82rem; }

.pagination { display: flex; gap: 8px; justify-content: center; margin-top: 28px; flex-wrap: wrap; }
.pagination a, .pagination span {
    padding: 8px 14px; border-radius: 8px; text-decoration: none;
    border: 1px solid var(--border); background: #fff; color: var(--text); font-size: 0.9rem;
}
.pagination .current { background: var(--primary); color: #fff; border-color: var(--primary); }

.empty {
    text-align: center; padding: 50px 20px; color: var(--text-light);
    background: var(--card-bg); border-radius: 12px;
}

footer { background: var(--card-bg); border-top: 1px solid var(--border); padding: 20px 0; text-align: center; font-size: 0.85rem; color: var(--text-light); }

/* ---------------- Preview banner ---------------- */

.preview-banner {
    background: #fff8e1;
    border: 1px solid #ffd54f;
    color: #6d4c00;
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.preview-banner a { color: var(--primary); font-weight: 600; text-decoration: none; }

/* ---------------- Misc ---------------- */

code {
    background: #f4f4f4;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    word-break: break-all;
}

input[list] {
    background-image:
        linear-gradient(45deg, transparent 50%, #888 50%),
        linear-gradient(135deg, #888 50%, transparent 50%);
    background-position:
        calc(100% - 16px) 50%,
        calc(100% - 11px) 50%;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}

@media (max-width: 640px) {
    .hero h1 { font-size: 2rem; }
    .form-card, .profile-card { padding: 24px; }
    .profile-header { flex-direction: column; text-align: center; }
    .row { flex-direction: column; gap: 0; }
    .entry { flex-direction: column; }
}

.connection-count {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-top: 4px;
}

fieldset {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    margin: 20px 0;
}
fieldset legend {
    font-weight: 600;
    padding: 0 6px;
}
/* ---------------- Connection actions ---------------- */

.connection-actions {
    margin-top: 12px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.inline-form {
    display: inline-flex;
    align-items: center;
    margin: 0;
    padding: 0;
}

.conn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    min-width: 110px;
    padding: 8px 16px;
    font-size: 0.95rem;
    line-height: 1.2;
    box-sizing: border-box;
    white-space: nowrap;
}

.conn-action.is-disabled {
    opacity: 0.75;
    cursor: default;
    pointer-events: none;
    background: #eef3f8;
    color: var(--primary-dark);
    border: 1px solid #d5e2ef;
}

/* ---------------- Nav: pending requests indicator ---------------- */

.nav-connections {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.nav-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--error);
    border-radius: 50%;
    margin-left: 6px;
    vertical-align: middle;
    box-shadow: 0 0 0 2px var(--card-bg);
    animation: nav-dot-pulse 1.8s ease-in-out infinite;
}

@keyframes nav-dot-pulse {
    0%, 100% { transform: scale(1);   opacity: 1; }
    50%      { transform: scale(1.2); opacity: 0.75; }
}
/* ---------------- Connection count button ---------------- */

.connection-count-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    font: inherit;
    font-size: 0.95rem;
    color: var(--primary);
    cursor: pointer;
    text-align: left;
}
.connection-count-btn:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}
.connection-count-btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ---------------- Modal ---------------- */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 16px;
    z-index: 200;
    overflow-y: auto;
}
.modal-overlay[hidden] { display: none; }

.modal {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 640px;
    max-height: calc(100vh - 80px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
}
.modal-head h2 { font-size: 1.15rem; }

.modal-close {
    background: none;
    border: none;
    font-size: 1.7rem;
    line-height: 1;
    color: var(--text-light);
    cursor: pointer;
    padding: 0 6px;
    border-radius: 6px;
}
.modal-close:hover { color: var(--text); background: #f4f4f4; }

.modal-body {
    padding: 16px 22px 22px;
    overflow-y: auto;
}

.modal-search {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    background: #fff;
    margin-bottom: 16px;
}
.modal-search:focus {
    outline: none;
    border-color: var(--primary);
}

.modal-body .people-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.modal-empty {
    margin-top: 16px;
    text-align: center;
}

body.modal-open { overflow: hidden; }

@media (max-width: 640px) {
    .modal-overlay { padding: 16px; }
    .modal-head { padding: 14px 16px; }
    .modal-body { padding: 14px 16px 18px; }
}
/* ---------------- Search loading overlay ---------------- */

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 300;
}
.loading-overlay[hidden] { display: none; }

.loading-box {
    background: var(--card-bg);
    padding: 24px 32px;
    border-radius: 12px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    font-weight: 600;
    color: var(--text);
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #e0e6ee;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spinner-spin 0.8s linear infinite;
}

@keyframes spinner-spin {
    to { transform: rotate(360deg); }
}
/* ---------------- Compact connections list ---------------- */

.person-card-link {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    flex: 1;
    min-width: 0;
    text-decoration: none;
    color: inherit;
}

.people-grid.is-compact {
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 10px;
}

.people-grid.is-compact .person-card {
    padding: 12px 14px;
    gap: 10px;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    align-items: center;
}

.people-grid.is-compact .person-card > div,
.people-grid.is-compact .person-card-link > div {
    min-width: 0;
}

.people-grid.is-compact .person-card .avatar {
    width: 38px;
    height: 38px;
    font-size: 0.95rem;
}

.people-grid.is-compact .person-card h3 {
    font-size: 0.9rem;
    line-height: 1.25;
    margin-bottom: 0;
}
.people-grid.is-compact .person-card .headline {
    font-size: 0.78rem;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.people-grid.is-compact .person-card-link {
    gap: 10px;
    align-items: center;
}

.people-grid.is-compact .person-card .conn-action {
    min-height: 26px;
    min-width: 0;
    width: auto;
    padding: 3px 10px;
    font-size: 0.7rem;
    line-height: 1.1;
    border-radius: 14px;
    font-weight: 600;
    flex-shrink: 0;
}

@media (max-width: 640px) {
    .people-grid.is-compact .person-card,
    .people-grid.is-compact .person-card-link {
        align-items: center;
    }
}

@media (max-width: 640px) {
    .dashboard-stats {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
    }
    .stat-tile {
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        padding: 8px 14px !important;
    }
    .stat-tile .stat-num {
        font-size: 1.15rem !important;
        line-height: 1 !important;
    }
    .stat-tile .stat-label {
        margin-top: 0 !important;
        font-size: 0.85rem !important;
        text-align: right !important;
    }
}

/* Compact person cards that carry action buttons (pending / sent requests) */
.people-grid.is-compact .person-card.has-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    cursor: default;
}

.people-grid.is-compact .person-card.has-actions:hover {
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    transform: none;
}

.person-card-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.person-card-actions form {
    flex: 1;
    display: flex;
    margin: 0;
    padding: 0;
}

.person-card-actions .conn-action {
    flex: 1;
    min-width: 0;
    min-height: 30px;
    padding: 5px 12px;
    font-size: 0.78rem;
}

/* ---------------- Messages ---------------- */

.messages-card { padding-bottom: 24px; }

.messages-head {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

.messages-head-user {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.message-thread {
    max-height: 55vh;
    overflow-y: auto;
    padding: 18px 4px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #fafbfc;
    border-radius: 10px;
    margin-top: 16px;
}

.msg { display: flex; flex-direction: column; max-width: 78%; }
.msg-mine   { align-self: flex-end; align-items: flex-end; }
.msg-theirs { align-self: flex-start; align-items: flex-start; }

.msg-bubble {
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 0.95rem;
    line-height: 1.45;
    word-wrap: break-word;
    overflow-wrap: anywhere;
}
.msg-mine .msg-bubble {
    background: var(--primary);
    color: #fff;
    border-bottom-right-radius: 4px;
}
.msg-theirs .msg-bubble {
    background: #eef1f4;
    color: var(--text);
    border-bottom-left-radius: 4px;
}
.msg-meta {
    font-size: 0.72rem;
    color: var(--text-light);
    margin-top: 4px;
}

.message-compose {
    margin-top: 18px;
    display: flex;
    gap: 10px;
    align-items: flex-end;
}
.message-compose textarea {
    flex: 1;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
    min-height: 60px;
    max-height: 200px;
    background: #fff;
}
.message-compose textarea:focus {
    outline: none;
    border-color: var(--primary);
}
.message-compose button {
    flex-shrink: 0;
    align-self: stretch;
}

/* Inbox list */
/* Inbox — conversation rows styled like the person cards */
.convo-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.convo-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.convo-card:hover {
    background: #f7fafc;
    border-color: #cbd7e3;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.convo-card.is-unread {
    background: #eef4fb;
    border-color: #c9dcf1;
}

.convo-card-body {
    flex: 1;
    min-width: 0;
}

.convo-card-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
}
.convo-card-top h3 {
    margin: 0;
    font-size: 0.95rem;
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.convo-time {
    font-size: 0.75rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.convo-card .convo-preview {
    margin: 2px 0 0;
    font-size: 0.83rem;
    color: var(--text-light);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.unread-badge {
    background: var(--primary);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    flex-shrink: 0;
}

@media (max-width: 640px) {
    .messages-head { flex-direction: column; align-items: flex-start; }
    .msg { max-width: 90%; }
    .message-compose { flex-direction: column; align-items: stretch; }
}

/* ---------- Message thread scrolling ---------- */

.messages-card { position: relative; }

.thread-loading {
    text-align: center;
    font-size: 0.82rem;
    color: var(--text-light);
    padding: 6px 0 10px;
}
.thread-loading[hidden] { display: none; }

.message-thread {
    background: linear-gradient(to bottom, #f0f2f5 0, #fafbfc 24px);
}

/* ---------- Jump-to-latest pill ---------- */

.jump-to-latest {
    position: absolute;
    right: 24px;
    bottom: 130px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(10, 102, 194, 0.35);
    transition: background 0.15s, transform 0.15s;
    z-index: 10;
}
.jump-to-latest:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}
.jump-to-latest[hidden] { display: none; }

/* ---------- Location dropdown for edit_profile.php ---------- */
.ac-wrap { position: relative; }

.ac-list {
    position: absolute;
    z-index: 20;
    left: 0; right: 0;
    top: calc(100% + 2px);
    max-height: 280px;
    overflow-y: auto;
    margin: 0;
    padding: 4px 0;
    list-style: none;
    background: var(--bg, #fff);
    border: 1px solid var(--border, #ccc);
    border-radius: 8px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .12);
    font-size: 0.9rem;
}
.ac-list[hidden] { display: none; }

.ac-item {
    padding: 7px 12px;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ac-item.active,
.ac-item:hover { background: var(--accent, #eef); }
.ac-item b { font-weight: 600; }

/* ================================================================== */
/*  Posts                                                             */
/* ================================================================== */

.post-composer {
    background: #f7fafc;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 16px;
}
.post-composer form { display: flex; flex-direction: column; gap: 10px; }
.post-composer textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
    min-height: 60px;
    background: #fff;
}
.post-composer textarea:focus { outline: none; border-color: var(--primary); }
.post-composer-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.post-composer-controls select {
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.88rem;
    background: #fff;
}
.post-file-label { cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.post-file-label input[type=file] { display: none; }
.post-file-name { font-size: 0.82rem; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.post-notify-label { margin: 0; font-size: 0.88rem; }
.post-composer-controls button[type=submit] { margin-left: auto; }

.post-list { display: flex; flex-direction: column; gap: 16px; }

.post-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.post-card-single { margin-bottom: 24px; }

/* Note: <header class="post-head"> is NOT sticky. Only <header.site-header> is. */
.post-head {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 12px;
}
.post-author-avatar { flex-shrink: 0; text-decoration: none; }
.post-head-text { flex: 1; min-width: 0; }
.post-head-text h3 { font-size: 1rem; margin: 0; }
.post-head-text h3 a { color: var(--text); text-decoration: none; }
.post-head-text h3 a:hover { color: var(--primary); }
.post-meta { font-size: 0.82rem; margin: 2px 0 0; }
.post-meta a { color: var(--text-light); text-decoration: underline; }
.post-meta a:hover { color: var(--primary); }
.post-vis { color: var(--text-light); }

.post-delete-form { flex-shrink: 0; margin: 0; }
.post-delete-btn {
    background: none;
    border: none;
    font-size: 1rem;
    line-height: 1.1;
    color: var(--text-light);
    cursor: pointer;
    padding: 0 6px;
    border-radius: 4px;
}
.post-delete-btn:hover { color: var(--error); background: #fee; }

.post-body {
    font-size: 0.95rem;
    line-height: 1.55;
    margin-bottom: 12px;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.post-image {
    margin: 8px 0 12px;
    border-radius: 10px;
    overflow: hidden;
    background: #f0f0f0;
    text-align: center;
}
.post-image img {
    width: 100%;
    height: auto;
    display: block;
    max-height: 600px;
    object-fit: contain;
}

.post-actions {
    display: flex;
    gap: 16px;
    align-items: center;
    padding: 10px 0 0;
    line-height: 1.8;
    border-top: 1px solid var(--border);
}
.post-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: none;
    border: none;
    font-family: inherit;
    font-size: 0.88rem;
    color: var(--text-light);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    text-decoration: none;
}
.post-action-btn:hover { background: #f0f4f8; color: var(--primary); }
.post-action-btn.is-liked { color: var(--error); }
.post-action-btn.is-liked:hover { color: var(--error); background: #fee; }
.post-action-btn:disabled { opacity: 0.6; cursor: default; }

/* Likers strip: "Liked by Alice, Bob and 3 others" */
.post-likers-strip {
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    padding: 6px 0 0;
    margin: 0;
    font-family: inherit;
    font-size: 0.82rem;
    color: var(--text-light);
    cursor: pointer;
    border-radius: 4px;
}
.post-likers-strip:hover { color: var(--primary); text-decoration: underline; }

.post-comments-preview {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px dashed var(--border);
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.post-comment {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    font-size: 0.88rem;
}
.post-comment-body {
    flex: 1;
    min-width: 0;
    padding-top: 1px;             /* aligns first line with avatar-xs */
}
.post-comment-body strong a {
    color: var(--text);
    text-decoration: none;
}
.post-comment-body strong a:hover { color: var(--primary); }
.post-comment-body strong { margin-right: 6px; }
.post-comment-text {
    overflow-wrap: anywhere;
    word-break: break-word;
    color: var(--text-light);
    text-decoration: none;
    transition: color 0.15s;
}
a.post-comment-text:hover {
    color: var(--text);
    text-decoration: underline;
}

.avatar-xs { width: 24px; height: 24px; font-size: 0.7rem; flex-shrink: 0; }

.post-view-all {
    font-size: 0.85rem;
    color: var(--primary);
    text-decoration: none;
    margin-top: 4px;
    align-self: flex-start;
}
.post-view-all:hover { text-decoration: underline; }

.post-comment-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 20px;
}
.post-comment-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 2px;
}
.post-comment-meta { font-size: 0.75rem; }
.post-comment-delete {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    font-size: 1.05rem;
    line-height: 1;
    margin-left: auto;
    padding: 0 6px;
    border-radius: 4px;
}
.post-comment-delete:hover { color: var(--error); background: #fee; }

.post-comment-form {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    margin-top: 12px;
}
.post-comment-form textarea {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.9rem;
    resize: vertical;
    min-height: 44px;
    background: #fff;
}
.post-comment-form textarea:focus { outline: none; border-color: var(--primary); }

/* Likers modal list — compact */
.likers-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.liker-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 8px;
    border-radius: 6px;
    text-decoration: none;
    color: inherit;
    line-height: 1.25;
    transition: background 0.15s;
}
.liker-row:hover { background: #f3f6fa; }
.liker-row .liker-body {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: baseline;
    gap: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.liker-row h3 {
    font-size: 0.88rem;
    margin: 0;
    flex-shrink: 0;
}
.liker-row p {
    margin: 0;
    font-size: 0.78rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 640px) {
    .post-composer-controls { gap: 8px; }
    .post-composer-controls button[type=submit] { margin-left: 0; width: 100%; }
    .post-comment-form { flex-direction: column; align-items: stretch; }
}

/* Wrapper + "or" divider */
.social-login {
    margin-top: 20px;
}

.divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 16px 0;
    color: #5f6368;
    font-size: 13px;
}

.divider::before,
.divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #dadce0;
}

/* Google button — matches Google's official specs */
.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 40px;
    padding: 0 12px;
    background: #ffffff;
    border: 1px solid #747775;
    border-radius: 4px;
    color: #1f1f1f;
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.25px;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
    box-sizing: border-box;
}

.btn-google:hover {
    background: #f8faff;
    border-color: #747775;
    box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);
}

.btn-google:active {
    background: #f1f3f4;
}

.btn-google:focus-visible {
    outline: 2px solid #4285F4;
    outline-offset: 2px;
}

.btn-google-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* SVG Icons */
.icon {
    display: inline-block;
    width: 1em;
    height: 1em;
    vertical-align: -0.15em;
    background-image: var(--icon, none);
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

.post-action-btn .like-icon {
    background-image: url('/svgicons/heart-unfilled.svg');
}
.post-action-btn.is-liked .like-icon {
    background-image: url('/svgicons/heart-filled.svg');
}

/* Feed card previews: cap image height without changing object-fit */
.post-card:not(.post-card-single) .post-image img {
    max-height: 400px;
}

/* ---------------- Image lightbox ---------------- */

.post-image img {
    cursor: zoom-in;
}

.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 400;
    cursor: zoom-out;
}
.lightbox-overlay[hidden] { display: none; }

.lightbox-overlay img {
    max-width: 95vw;
    max-height: 95vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    cursor: default;
}

.lightbox-close {
    position: absolute;
    top: 16px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-bottom: 2px;
}
.lightbox-close:hover { background: rgba(0, 0, 0, 0.8); }

body.lightbox-open { overflow: hidden; }

/* ================================================================== */
/*  Education page                                                    */
/* ================================================================== */

/* Month + year select pair */
.ym-row {
    display: flex;
    gap: 8px;
}
.ym-row select {
    flex: 1;
    min-width: 0;
}

/* Education list table */
.edu-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}
.edu-table thead th {
    text-align: left;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-light);
    padding: 9px 12px;
    border-bottom: 1px solid var(--border);
    background: #f7fafc;
}
.edu-table thead th:first-child { border-top-left-radius: 8px; }
.edu-table thead th:last-child  { border-top-right-radius: 8px; text-align: right; }

.edu-table tbody td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}
.edu-table tbody tr:last-child td { border-bottom: none; }
.edu-table tbody tr:hover { background: #fafbfc; }

.edu-school { font-weight: 600; color: var(--text); }
.edu-degree { color: var(--text-light); }
.edu-dates  { white-space: nowrap; color: var(--text-light); }

.edu-actions {
    text-align: right;
    white-space: nowrap;
    width: 1%;
}
.edu-actions form {
    display: inline-flex;
    align-items: center;
    margin: 0;
    padding: 0;
}
.edu-actions .btn,
.edu-actions .btn-danger {
    min-width: 80px;
    padding: 6px 14px;
    font-size: 0.82rem;
    line-height: 1.2;
    box-sizing: border-box;
    justify-content: center;
}

/* Stacked layout on small screens */
@media (max-width: 640px) {
    .edu-table thead { display: none; }
    .edu-table,
    .edu-table tbody,
    .edu-table tr,
    .edu-table td {
        display: block;
        width: 100%;
    }
    .edu-table tbody tr {
        border: 1px solid var(--border);
        border-radius: 10px;
        padding: 10px 12px;
        margin-bottom: 10px;
        background: #fff;
    }
    .edu-table tbody td {
        border: none;
        padding: 4px 0;
    }
    .edu-table .edu-actions {
        text-align: left;
        padding-top: 10px;
        width: auto;
    }
}

/* ================================================================== */
/*  Experience page                                                   */
/* ================================================================== */

/* Experience list table (mirrors .edu-table) */
.exp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}
.exp-table thead th {
    text-align: left;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-light);
    padding: 9px 12px;
    border-bottom: 1px solid var(--border);
    background: #f7fafc;
}
.exp-table thead th:first-child { border-top-left-radius: 8px; }
.exp-table thead th:last-child  { border-top-right-radius: 8px; text-align: right; }

.exp-table tbody td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}
.exp-table tbody tr:last-child td { border-bottom: none; }
.exp-table tbody tr:hover { background: #fafbfc; }

.exp-title   { font-weight: 600; color: var(--text); }
.exp-company { color: var(--text-light); }
.exp-dates   { white-space: nowrap; color: var(--text-light); }

.exp-actions {
    text-align: right;
    white-space: nowrap;
    width: 1%;
}
.exp-actions form {
    display: inline-flex;
    align-items: center;
    margin: 0;
    padding: 0;
}
.exp-actions .btn,
.exp-actions .btn-danger {
    min-width: 80px;
    padding: 6px 14px;
    font-size: 0.82rem;
    line-height: 1.2;
    box-sizing: border-box;
    justify-content: center;
}

/* Stacked layout on small screens */
@media (max-width: 640px) {
    .exp-table thead { display: none; }
    .exp-table,
    .exp-table tbody,
    .exp-table tr,
    .exp-table td {
        display: block;
        width: 100%;
    }
    .exp-table tbody tr {
        border: 1px solid var(--border);
        border-radius: 10px;
        padding: 10px 12px;
        margin-bottom: 10px;
        background: #fff;
    }
    .exp-table tbody td {
        border: none;
        padding: 4px 0;
    }
    .exp-table .exp-actions {
        text-align: left;
        padding-top: 10px;
        width: auto;
    }
}

/* ================================================================== */
/*  Recommended connections                                           */
/* ================================================================== */
.rec-section {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    margin-bottom: 24px;
}
.rec-section .section-head { margin-bottom: 14px; }

/* "N mutuals" chip sitting next to the Connect button in the
   person-card actions row. */
.person-card-actions .rec-more {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 5px 12px;
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.2;
    border-radius: 15px;
    background: #eef3f8;
    color: var(--primary-dark);
    border: 1px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
}
.person-card-actions .rec-more:hover {
    background: #dbe7f3;
}
.person-card-actions .rec-more:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 1px;
}