:root {
    --navy: #071f3f;
    --blue: #0e3a67;
    --gold: #d4af37;
    --teal: #1f9e98;
    --bg: #f4f7fb;
    --paper: #ffffff;
    --text: #1f2937;
    --muted: #64748b;
    --line: #dbe3f0;
    --danger: #9f1239;
    --success: #166534;
    --shadow: 0 16px 38px rgba(10, 24, 52, 0.12);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.65;
}

a {
    color: inherit;
    text-decoration: none;
}

.container {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

/* Header */

.header {
    background: linear-gradient(135deg, #071f3f, #0e3a67);
    color: white;
    padding: 18px 0;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.brand {
    font-weight: 900;
    font-size: 21px;
}

.nav {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.nav a {
    padding: 9px 13px;
    border-radius: 999px;
    background: rgba(255,255,255,0.12);
    color: white;
    font-weight: 800;
    font-size: 14px;
}

/* Hero */

.hero {
    background:
        radial-gradient(circle at top right, rgba(212,175,55,0.22), transparent 34%),
        linear-gradient(135deg, #071f3f, #0e3a67);
    color: white;
    padding: 42px 0;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.3fr 0.7fr;
    gap: 28px;
    align-items: center;
}

.hero h1 {
    margin: 0 0 10px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(32px, 5vw, 58px);
    line-height: 1.08;
}

.hero p {
    margin: 0;
    max-width: 820px;
    color: rgba(255,255,255,0.92);
    font-size: 18px;
}

.hero-card {
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.22);
    border-radius: 24px;
    padding: 22px;
    box-shadow: 0 18px 45px rgba(0,0,0,0.18);
}

.hero-number {
    font-size: 46px;
    font-weight: 900;
    color: var(--gold);
    line-height: 1;
}

.hero-label {
    font-weight: 800;
    margin-top: 6px;
}

/* Main */

.main {
    padding: 30px 0 80px;
}

/* Buttons */

.btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    border-radius: 999px;
    border: 1px solid var(--line);
    padding: 12px 18px;
    background: white;
    color: var(--navy);
    font-weight: 900;
    cursor: pointer;
    white-space: nowrap;
    text-align: center;
}

.btn.gold {
    background: linear-gradient(135deg, var(--gold), #ffed9d);
    border-color: var(--gold);
    color: var(--navy);
}

.btn.navy {
    background: var(--navy);
    border-color: var(--navy);
    color: white;
}

/* Forms */

input,
select,
textarea {
    width: 100%;
    border: 1px solid #cfd9ea;
    border-radius: 14px;
    padding: 13px 14px;
    font: inherit;
    background: white;
}

textarea {
    min-height: 160px;
    resize: vertical;
}

label {
    display: block;
    color: var(--navy);
    font-weight: 900;
    margin-bottom: 6px;
}

.hidden-field {
    position: absolute;
    left: -9999px;
    opacity: 0;
}

/* Directory index */

.stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}

.stat {
    background: white;
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 18px;
    box-shadow: var(--shadow);
}

.stat strong {
    display: block;
    color: var(--navy);
    font-size: 30px;
}

.stat span {
    color: var(--muted);
    font-weight: 800;
}

.toolbar {
    background: white;
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 16px;
    box-shadow: var(--shadow);
    display: grid;
    grid-template-columns: 1fr 190px auto;
    gap: 12px;
    align-items: center;
    margin-bottom: 20px;
}

.result-line {
    margin: 18px 0;
    color: var(--blue);
    font-weight: 900;
}

.grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0,1fr));
    gap: 22px;
}

.card {
    background: white;
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: var(--shadow);
    padding: 24px;
}

.grid .card {
    border-radius: 26px;
    overflow: hidden;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.card-top {
    padding: 20px 20px 12px;
    background: linear-gradient(180deg, rgba(14,58,103,0.06), rgba(255,255,255,0));
}

.photo {
    width: 106px;
    height: 106px;
    object-fit: cover;
    border-radius: 24px;
    border: 4px solid white;
    box-shadow: 0 12px 24px rgba(0,0,0,0.14);
    background: #e8eef9;
}

.badges {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.badge {
    display: inline-flex;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
    background: #eef4ff;
    color: #1d4ed8;
    border: 1px solid #c7d2fe;
}

.badge.verified {
    background: #e8f7ec;
    color: #166534;
    border-color: #b7e4c7;
}

.badge.available {
    background: #ecfeff;
    color: #0f766e;
    border-color: #a5f3fc;
}

.badge.gold {
    background: linear-gradient(135deg, var(--gold), #ffed9d);
    color: var(--navy);
    border-color: var(--gold);
}

.card-body {
    padding: 0 20px 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.card h2 {
    margin: 0 0 14px;
    color: var(--navy);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 26px;
}

.card-body h2 {
    font-size: 22px;
    margin: 14px 0 6px;
    line-height: 1.25;
}

.role {
    color: var(--teal);
    font-weight: 900;
    margin-bottom: 8px;
}

.meta {
    color: var(--muted);
    font-size: 14px;
    margin-bottom: 6px;
}

.summary {
    text-align: justify;
    font-size: 14.5px;
    color: #374151;
    margin: 12px 0 16px;
}

.actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: auto;
}

.actions .btn {
    flex: 1;
}

.empty,
.notice-box {
    background: white;
    border: 1px dashed #9eb1d8;
    border-radius: 22px;
    padding: 38px;
    text-align: center;
    color: var(--muted);
}

.empty h2,
.notice-box h2 {
    color: var(--navy);
    margin-top: 0;
    font-family: Georgia, "Times New Roman", serif;
}

/* Profile page */

.profile-grid {
    display: grid;
    grid-template-columns: 1.4fr 0.6fr;
    gap: 24px;
    align-items: start;
}

.profile-photo {
    width: 160px;
    height: 160px;
    object-fit: cover;
    border-radius: 30px;
    border: 5px solid white;
    box-shadow: 0 18px 38px rgba(0,0,0,0.24);
    background: #e8eef9;
}

.justify {
    text-align: justify;
}

.info-row {
    padding: 12px 0;
    border-bottom: 1px solid #edf2f7;
}

.info-row:last-child {
    border-bottom: none;
}

.info-row strong {
    display: block;
    color: var(--navy);
    margin-bottom: 4px;
}

.tag-list {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.tag {
    display: inline-flex;
    padding: 7px 10px;
    border-radius: 999px;
    background: #eef4ff;
    color: #1d4ed8;
    border: 1px solid #c7d2fe;
    font-weight: 800;
    font-size: 13px;
}

.project-list {
    margin: 0;
    padding-left: 20px;
}

.project-list li {
    margin-bottom: 10px;
}

.sidebar .card {
    position: sticky;
    top: 16px;
}

.action-stack {
    display: grid;
    gap: 10px;
}

/* Contact page */

.contact-grid {
    display: grid;
    grid-template-columns: 0.75fr 1.25fr;
    gap: 24px;
    align-items: start;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.form-row {
    margin-bottom: 14px;
}

.full {
    grid-column: 1 / -1;
}

.expert-card {
    text-align: center;
}

.contact-photo {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 30px;
    border: 5px solid white;
    box-shadow: 0 14px 30px rgba(0,0,0,0.16);
    background: #e8eef9;
    margin-bottom: 14px;
}

.expert-name {
    font-family: Georgia, "Times New Roman", serif;
    color: var(--navy);
    font-weight: 900;
    font-size: 24px;
}

.notice {
    padding: 14px 16px;
    border-radius: 16px;
    margin-bottom: 18px;
    font-weight: 800;
}

.notice.success {
    background: #edf9f1;
    border: 1px solid #b7e7c6;
    color: var(--success);
}

.notice.error {
    background: #fff1f2;
    border: 1px solid #fecdd3;
    color: var(--danger);
}

.empty-select {
    max-width: 760px;
    margin: 0 auto;
    text-align: center;
}

/* Map page */

.map-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 20px;
    align-items: stretch;
}

.map-sidebar {
    background: white;
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: var(--shadow);
    padding: 18px;
    max-height: 720px;
    overflow: auto;
}

.map-sidebar h2 {
    margin: 0 0 12px;
    color: var(--navy);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 25px;
}

.search-box {
    margin-bottom: 14px;
}

.expert-list {
    display: grid;
    gap: 10px;
}

.expert-item {
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 11px;
    background: #f8fbff;
    cursor: pointer;
    transition: 0.2s ease;
}

.expert-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(10, 24, 52, 0.10);
}

.expert-item strong {
    color: var(--navy);
    display: block;
    line-height: 1.25;
}

.expert-item span {
    color: var(--muted);
    font-size: 13px;
}

.map-card {
    background: white;
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: var(--shadow);
    padding: 14px;
    min-height: 720px;
}

#expertMap {
    width: 100%;
    height: 690px;
    border-radius: 18px;
    overflow: hidden;
    background: #e8eef9;
}

.popup {
    width: 240px;
}

.popup-top {
    display: flex;
    gap: 10px;
    align-items: center;
}

.popup-photo {
    width: 58px;
    height: 58px;
    object-fit: cover;
    border-radius: 14px;
    border: 2px solid white;
    box-shadow: 0 6px 14px rgba(0,0,0,0.14);
    background: #e8eef9;
}

.popup-name {
    font-weight: 900;
    color: #071f3f;
    line-height: 1.25;
}

.popup-role {
    color: #1f9e98;
    font-weight: 800;
    font-size: 12px;
    margin-top: 4px;
}

.popup-meta {
    margin-top: 8px;
    color: #64748b;
    font-size: 12px;
}

.popup-actions {
    display: flex;
    gap: 7px;
    margin-top: 10px;
}

.popup-actions a {
    flex: 1;
    text-align: center;
    padding: 7px 8px;
    border-radius: 999px;
    font-weight: 900;
    font-size: 12px;
    background: #071f3f;
    color: white;
}

.popup-actions a.gold {
    background: linear-gradient(135deg, #d4af37, #ffed9d);
    color: #071f3f;
}

/* Footer */

.footer {
    padding: 28px 0;
    background: var(--navy);
    color: rgba(255,255,255,0.84);
    text-align: center;
}

/* Responsive */

@media (max-width: 1000px) {
    .hero-grid,
    .grid {
        grid-template-columns: 1fr 1fr;
    }

    .toolbar {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 950px) {
    .map-layout {
        grid-template-columns: 1fr;
    }

    .map-sidebar {
        max-height: none;
    }

    .map-card {
        min-height: 520px;
    }

    #expertMap {
        height: 500px;
    }
}

@media (max-width: 900px) {
    .profile-grid,
    .contact-grid,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .sidebar .card {
        position: static;
    }
}

@media (max-width: 700px) {
    .hero-grid,
    .grid,
    .stats {
        grid-template-columns: 1fr;
    }

    .hero {
        padding-top: 32px;
    }

    .nav a,
    .btn {
        width: 100%;
    }

    .card {
        padding: 18px;
    }

    .grid .card {
        padding: 0;
    }
}

/* PWA install section */

.install-card {
    background: linear-gradient(135deg, #ffffff, #f8fbff);
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: var(--shadow);
    padding: 20px;
    margin: 22px 0;
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 12px;
    align-items: center;
}

.install-card h2 {
    margin: 0 0 4px;
    color: var(--navy);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 24px;
}

.install-card p {
    margin: 0;
    color: var(--muted);
}

.install-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.install-note {
    display: none;
    background: #fff7df;
    border: 1px solid #f3d37a;
    color: #6b4b00;
    border-radius: 18px;
    padding: 14px 16px;
    margin-top: 12px;
    font-weight: 700;
}

.install-note.show {
    display: block;
}

.wmvp-install-btn[hidden] {
    display: none !important;
}

@media (max-width: 800px) {
    .install-card {
        grid-template-columns: 1fr;
    }

    .install-actions {
        width: 100%;
    }

    .install-actions .btn {
        width: 100%;
    }
}
.nav button {
    padding: 9px 13px;
    border-radius: 999px;
    font-weight: 800;
    font-size: 14px;
}