/* ══════════════════════════════════════════════════════════════════════════
   DESIGN TOKENS
   ══════════════════════════════════════════════════════════════════════════ */
:root {
    --hi5-primary: #d35400;
    --text-main:   #1a1a1a;
    --text-muted:  #888;
    --bg-gray:     #f7f7f7;
    --border:      #e8e8e8;
    --transition:  all 0.2s ease;
}

/* ══════════════════════════════════════════════════════════════════════════
   RESET & BASE
   ══════════════════════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg-gray);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
h1, h2, h3, h4 { line-height: 1.2; }
img { max-width: 100%; }

/* ══════════════════════════════════════════════════════════════════════════
   HEADER / NAVIGATION
   ══════════════════════════════════════════════════════════════════════════ */
.site-header {
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 0 5%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-size: 1.4rem;
    font-weight: 900;
    letter-spacing: -1px;
    color: var(--hi5-primary);
    text-decoration: none;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 24px;
}

.nav-links a {
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: var(--transition);
}
.nav-links a:hover,
.nav-links a.active { color: var(--text-main); }

.user-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-gray);
    padding: 5px 12px 5px 6px;
    border-radius: 50px;
    border: 1px solid var(--border);
}

.nav-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

.username {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
    text-decoration: none;
}

.role-badge {
    font-size: 0.6rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--hi5-primary);
    background: #fff5eb;
    padding: 2px 7px;
    border-radius: 20px;
    border: 1px solid #fde0c8;
}

.logout-link {
    color: var(--text-muted);
    font-size: 1rem;
    display: flex;
    align-items: center;
    text-decoration: none;
}
.logout-link:hover { color: var(--hi5-primary); }

/* ══════════════════════════════════════════════════════════════════════════
   GLOBAL BUTTONS
   ══════════════════════════════════════════════════════════════════════════ */
.cta-btn {
    background: var(--hi5-primary);
    color: #fff;
    padding: 9px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.85rem;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
    font-family: inherit;
}
.cta-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.cta-btn.small { padding: 6px 14px; font-size: 0.78rem; }
.cta-btn.secondary {
    background: var(--bg-gray);
    color: var(--text-main);
    border: 1px solid var(--border);
}

.profile-btn {
    padding: 10px 18px;
    background: var(--bg-gray);
    color: var(--text-main);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.88rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
    font-family: inherit;
}
.profile-btn:hover { background: #ebebeb; }

/* ── Global custom select ────────────────────────────────────────────────── */
select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 13px;
    padding-right: 30px;
}

/* Stars */
.stars {
    display: inline-flex;
    gap: 2px;
    font-size: 0.85rem;
    color: #f5a623;
}

/* Delete link */
.delete-link {
    color: #ccc;
    font-size: 0.9rem;
    text-decoration: none;
    transition: color 0.2s;
}
.delete-link:hover { color: #c0392b; }

/* ══════════════════════════════════════════════════════════════════════════
   HERO — index.php
   ══════════════════════════════════════════════════════════════════════════ */
.hero {
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 80px 5% 60px;
    text-align: center;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 900;
    letter-spacing: -2px;
    margin: 0 0 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.hero p {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin: 0 0 60px;
}

/* Rotary headline animation */
.rotary-wrapper {
    display: inline-block;
    overflow: hidden;
    height: 1em;
    vertical-align: bottom;
    clip-path: inset(0);
}
.rotary-list {
    will-change: transform;
}
.rotary-item {
    color: #00578e;
    height: 1em;
    line-height: 0.95em;
}

/* ══════════════════════════════════════════════════════════════════════════
   SEARCH BAR
   ══════════════════════════════════════════════════════════════════════════ */
.search-tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.tab-track {
    display: inline-flex;
    background: var(--bg-gray);
    border: 1px solid var(--border);
    border-radius: 50px;
    padding: 4px;
    position: relative;
}

.tab-btn {
    padding: 9px 28px;
    border: none;
    border-radius: 50px;
    background: transparent;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    color: var(--text-muted);
    position: relative;
    z-index: 1;
    font-family: inherit;
    transition: color 0.25s;
    white-space: nowrap;
}
.tab-btn.active { color: #fff; }

.tab-slider {
    position: absolute;
    top: 4px;
    bottom: 4px;
    left: 4px;
    width: calc(50% - 4px);
    background: var(--text-main);
    border-radius: 50px;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}
.tab-track[data-active="playground"] .tab-slider {
    transform: translateX(100%);
}

.modern-search-bar {
    display: flex;
    align-items: stretch;
    max-width: 840px;
    margin: 0 auto;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.06);
    overflow: hidden;
}

.criteria-wrapper {
    display: flex;
    flex: 1;
    min-width: 0;
}

/* Generic input-group base (forms, dashboard) */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.input-group label {
    font-size: 0.6rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: black;
    white-space: nowrap;
}

.input-group input,
.input-group select {
    border: none;
    outline: none;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
    background: transparent;
    padding: 4px 0;
    border-bottom: 2px solid var(--border);
    transition: border-color 0.2s;
    width: 100%;
}
.input-group input:focus,
.input-group select:focus { border-bottom-color: var(--hi5-primary); }

/* Search bar field overrides — divider-style */
.modern-search-bar .input-group {
    padding: 15px 18px;
    border-right: 1px solid var(--border);
    justify-content: center;
    min-width: 0;
    gap: 3px;
    transition: background 0.15s;
}
.modern-search-bar .input-group:hover { background: #fafafa; }
.modern-search-bar .criteria-wrapper .input-group:last-child { border-right: none; }

.modern-search-bar .input-group label {
    font-size: 0.57rem;
    letter-spacing: 0.5px;
}

.modern-search-bar .input-group input,
.modern-search-bar .input-group select {
    border-bottom: none;
    padding: 2px 0;
    padding-right: 22px;
    font-size: 0.88rem;
    transition: none;
}
.modern-search-bar .input-group input::placeholder {
    color: #bbb;
    font-weight: 500;
}
.modern-search-bar .input-group input:focus,
.modern-search-bar .input-group select:focus { border-bottom: none; }

.search-icon-btn {
    width: 62px;
    flex-shrink: 0;
    background: var(--hi5-primary);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: filter 0.2s;
    font-family: inherit;
}
.search-icon-btn:hover { filter: brightness(1.1); }
.search-icon-btn svg { stroke: #fff; }

/* ══════════════════════════════════════════════════════════════════════════
   HOME SECTIONS
   ══════════════════════════════════════════════════════════════════════════ */
.sections-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 5% 60px;
}

.home-section { margin-bottom: 56px; }

.section-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 20px;
}
.section-header h2 {
    margin: 0 0 4px;
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.section-desc {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.see-all-link {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--hi5-primary);
    text-decoration: none;
    white-space: nowrap;
}
.see-all-link:hover { text-decoration: underline; }

.section-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.empty-section {
    color: var(--text-muted);
    font-size: 0.9rem;
    padding: 40px;
    text-align: center;
    grid-column: 1 / -1;
    border: 1px dashed var(--border);
    border-radius: 12px;
}

/* ══════════════════════════════════════════════════════════════════════════
   GALLERY CARDS
   ══════════════════════════════════════════════════════════════════════════ */
.gallery-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 22px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: box-shadow 0.2s;
    position: relative;
}
.gallery-card:hover { box-shadow: 0 8px 32px rgba(0,0,0,0.07); }

.compare-check-wrapper {
    position: absolute;
    top: 14px;
    right: 14px;
}
.comp-check {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--hi5-primary);
}

.section-highlight {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    align-self: flex-start;
}
.hl-gold   { background: #fff8e1; color: #b8860b; }
.hl-fire   { background: #fff0e6; color: #c0392b; }
.hl-shield { background: #e8f5e9; color: #2e7d32; }
.hl-value  { background: #e3f2fd; color: #1565c0; }
.hl-new    { background: #f3e5f5; color: #6a1b9a; }

.card-category {
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    display: block;
    margin-bottom: 4px;
}

.card-top h3 {
    margin: 0 0 4px;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -0.3px;
    padding-right: 24px;
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.card-stats { display: flex; gap: 10px; }

.stat-box {
    flex: 1;
    background: var(--bg-gray);
    border-radius: 8px;
    padding: 8px 10px;
}
.stat-label {
    display: block;
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    font-weight: 700;
    margin-bottom: 2px;
}
.stat-value {
    font-weight: 800;
    font-size: 0.92rem;
    color: var(--text-main);
}

.cta-link {
    display: inline-block;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--hi5-primary);
    text-decoration: none;
    margin-top: auto;
}
.cta-link:hover { text-decoration: underline; }

/* ══════════════════════════════════════════════════════════════════════════
   COMPARE TRAY (floating bar)
   ══════════════════════════════════════════════════════════════════════════ */
#compare-tray {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--text-main);
    color: #fff;
    padding: 16px 5%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    z-index: 500;
}
#compare-tray.active { transform: translateY(0); }
#tray-count { font-size: 0.88rem; font-weight: 600; }
.tray-btn {
    background: var(--hi5-primary);
    color: #fff;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: var(--transition);
}
.tray-btn:hover { filter: brightness(1.1); }

/* ══════════════════════════════════════════════════════════════════════════
   CATALOG PAGE (map + sidebar)
   ══════════════════════════════════════════════════════════════════════════ */
.catalog-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 60px);
    overflow: hidden;
}

.catalog-map-area {
    height: 28vh;
    min-height: 180px;
    flex-shrink: 0;
    position: relative;
    border-bottom: 1px solid var(--border);
    order: -1;
}
#map { width: 100%; height: 100%; }

.catalog-sidebar {
    flex: 1;
    min-height: 0;
    background: #fff;
    overflow-y: auto;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
}

.results-stack {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
    align-content: start;
}

/* ══════════════════════════════════════════════════════════════════════════
   CATALOG FILTERS & CARDS
   ══════════════════════════════════════════════════════════════════════════ */
.catalog-filters {
    padding-bottom: 14px;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.filter-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-select {
    flex: 1;
    min-width: 110px;
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-gray);
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    transition: var(--transition);
}
.filter-select:focus {
    outline: none;
    border-color: var(--hi5-primary);
    background: #fff;
}

.sidebar-header {
    padding-bottom: 12px;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.sidebar-header h2 {
    margin: 0 0 2px;
    font-size: 1.05rem;
    font-weight: 800;
}
.sidebar-header p {
    margin: 0;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.catalog-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 10px;
    transition: box-shadow 0.2s;
}
.catalog-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.06); }

.catalog-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.catalog-card-dist {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 600;
    background: var(--bg-gray);
    padding: 2px 8px;
    border-radius: 20px;
}

.catalog-card-name {
    margin: 0 0 2px;
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: -0.3px;
}

.catalog-card-city {
    margin: 0 0 10px;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.card-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 10px;
}

.card-chip {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 20px;
    background: var(--bg-gray);
    border: 1px solid var(--border);
    color: var(--text-muted);
    white-space: nowrap;
}

.catalog-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 0.88rem;
}

/* ══════════════════════════════════════════════════════════════════════════
   DETAILS PAGE
   ══════════════════════════════════════════════════════════════════════════ */
.profile-container {
    max-width: 1100px;
    margin: 36px auto 60px;
    padding: 0 5%;
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 28px;
}

.hero-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 32px 28px;
    margin-bottom: 20px;
}

.hero-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.badge-tag {
    display: inline-block;
    background: var(--bg-gray);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 4px 10px;
    border-radius: 20px;
    white-space: nowrap;
    flex-shrink: 0;
}

.reviews-list {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 28px;
}

.review-card {
    border-bottom: 1px solid var(--border);
    padding: 20px 0;
}
.review-card:first-child { padding-top: 0; }
.review-card:last-child  { border-bottom: none; padding-bottom: 0; }

.review-user {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 4px;
}
.review-user strong { font-size: 0.92rem; display: block; }

.metric-bar {
    display: flex;
    gap: 16px;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-top: 10px;
}

.info-widget {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px 20px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f5f5f5;
    font-size: 0.88rem;
}
.info-row:last-child { border-bottom: none; }

.info-label {
    color: var(--text-muted);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
}
.info-value {
    font-weight: 700;
    color: var(--text-main);
    text-align: right;
}

/* Submit review (btn-submit, anon-label) */
.btn-submit {
    width: 100%;
    padding: 13px;
    background: var(--hi5-primary);
    color: #fff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
    font-size: 1rem;
    margin-top: 8px;
    font-family: inherit;
    transition: var(--transition);
}
.btn-submit:hover { filter: brightness(1.08); transform: translateY(-1px); }

.anon-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 16px;
    cursor: pointer;
}

/* ══════════════════════════════════════════════════════════════════════════
   COMPARE PAGE
   ══════════════════════════════════════════════════════════════════════════ */
.compare-wrapper {
    max-width: 1100px;
    margin: 40px auto 80px;
    padding: 0 5%;
}

.compare-table {
    display: flex;
    gap: 20px;
    overflow-x: auto;
}

.compare-labels {
    flex-shrink: 0;
    width: 160px;
    display: flex;
    flex-direction: column;
}
.label-item {
    padding: 14px 0;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    border-bottom: 1px solid #f5f5f5;
    display: flex;
    align-items: center;
    min-height: 52px;
}

.compare-column {
    flex: 1;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
}
.compare-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-gray);
}
.compare-header h3 { margin: 4px 0; font-size: 1rem; }

.compare-data-point {
    padding: 14px 20px;
    border-bottom: 1px solid #f5f5f5;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
    min-height: 52px;
    display: flex;
    align-items: center;
}
.compare-data-point:last-child { border-bottom: none; }

/* ══════════════════════════════════════════════════════════════════════════
   DASHBOARD
   ══════════════════════════════════════════════════════════════════════════ */
.dashboard-container {
    display: flex;
    min-height: calc(100vh - 60px);
}

.dash-sidebar {
    width: 240px;
    background: var(--text-main);
    color: #fff;
    padding: 32px 20px;
    flex-shrink: 0;
}

.owner-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 32px;
}
.avatar-circle {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--hi5-primary);
    color: #fff;
    font-weight: 800;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}
.owner-brand h3 { margin: 0; font-size: 0.9rem; color: #fff; }

.dash-nav { display: flex; flex-direction: column; gap: 4px; }
.dash-nav a {
    color: rgba(255,255,255,0.65);
    text-decoration: none;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    transition: var(--transition);
}
.dash-nav a:hover,
.dash-nav a.active { background: rgba(255,255,255,0.12); color: #fff; }
.dash-nav a.disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }

.dash-content {
    flex: 1;
    padding: 40px;
    background: var(--bg-gray);
    overflow-y: auto;
}
.dash-section { max-width: 860px; }

.section-title {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    margin: 0 0 20px;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}
.metric-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.metric-card .label {
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}
.metric-card .value {
    font-size: 2rem;
    font-weight: 900;
    letter-spacing: -1px;
    color: var(--text-main);
}

.card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
}
.card h3 { margin: 0 0 16px; }

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.form-grid .input-group input,
.form-grid .input-group select {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    width: 100%;
    font-family: inherit;
    font-size: 0.9rem;
}

.checklist-area {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.checklist-area h4 { margin: 0 0 8px; font-size: 0.85rem; }
.checklist-area label { font-size: 0.88rem; display: flex; align-items: center; gap: 8px; cursor: pointer; }

.billing-status { font-weight: 700; margin-bottom: 12px; }
.billing-status.active { color: #1a7a4a; }

.alert-toast {
    background: #edfaf3;
    color: #1a7a4a;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    margin: 0 40px 20px;
}

.reply-form textarea {
    width: 100%;
    min-height: 80px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    font-family: inherit;
    font-size: 0.88rem;
    resize: vertical;
    margin-bottom: 8px;
}

/* ══════════════════════════════════════════════════════════════════════════
   FOOTER
   ══════════════════════════════════════════════════════════════════════════ */
footer {
    background: var(--text-main);
    color: rgba(255,255,255,0.7);
    padding: 48px 5% 28px;
}

.footer-grid {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 32px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.footer-col .logo { color: #fff; display: block; margin-bottom: 12px; }
.mission-text {
    font-size: 0.82rem;
    line-height: 1.7;
    color: rgba(255,255,255,0.55);
}
.footer-col h4 {
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255,255,255,0.4);
    margin: 0 0 14px;
}
.footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.footer-col ul li a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 0.88rem;
    transition: color 0.2s;
}
.footer-col ul li a:hover { color: #fff; }

.copyright {
    max-width: 1100px;
    margin: 24px auto 0;
    font-size: 0.78rem;
    color: rgba(255,255,255,0.35);
    text-align: center;
}

/* ══════════════════════════════════════════════════════════════════════════
   MOBILE SUB-NAV (Find Care + Login strip — hidden on desktop)
   ══════════════════════════════════════════════════════════════════════════ */
.mobile-subnav {
    display: none;
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 10px 5%;
    gap: 10px;
    position: sticky;
    top: 60px;
    z-index: 99;
}

.mobile-subnav-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--text-muted);
    background: var(--bg-gray);
    transition: var(--transition);
}
.mobile-subnav-btn:hover,
.mobile-subnav-btn.active {
    background: var(--text-main);
    color: #fff;
    border-color: var(--text-main);
}

/* ══════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
    .profile-container { grid-template-columns: 1fr; }
    .compare-labels    { display: none; }
}

@media (max-width: 768px) {
    /* Header — hide all nav links except CTA/user-pill */
    .nav-links a          { display: none; }
    .nav-links a.cta-btn  { display: inline-flex; }
    .user-pill            { padding: 5px 8px 5px 6px; gap: 6px; }

    /* Show mobile sub-nav */
    .mobile-subnav { display: flex; }

    /* Hero */
    .hero                 { padding: 48px 5% 58px; }
    .hero h1              { font-size: 2.5rem; letter-spacing: -1px; }
    .hero p               { font-size: 0.95rem; }

    /* Search bar — compact 2-column grid: [Zip][D1] / [D2][D3] / [Button] */
    .modern-search-bar    { flex-direction: row; flex-wrap: wrap; border-radius: 16px; }
    .criteria-wrapper     { display: contents; } /* flatten — children join parent flex */
    .modern-search-bar .input-group {
        flex: 0 0 50%;
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding: 12px 14px;
    }
    .modern-search-bar .input-group:nth-child(odd)  { border-right: 1px solid var(--border); }
    .modern-search-bar .input-group input,
    .modern-search-bar .input-group select { font-size: 0.92rem; font-weight: 300;}
    .search-icon-btn      { flex: 0 0 100%; height: 48px; border-radius: 0; }

    /* Home cards single column */
    .section-grid         { grid-template-columns: 1fr; }
    .sections-wrap        { padding: 24px 5% 40px; }
    .home-section         { margin-bottom: 36px; }

    /* Catalog — already column layout; on mobile just allow natural scroll */
    .catalog-container    { height: auto; overflow: visible; }
    .catalog-map-area     { height: 40vh; }
    .catalog-sidebar      { overflow-y: visible; }
    .results-stack        { grid-template-columns: 1fr; }

    /* Details */
    .profile-container    { grid-template-columns: 1fr; padding: 0 4%; }
    .hero-card            { padding: 24px 20px; }

    /* Footer */
    .footer-grid          { grid-template-columns: 1fr; gap: 24px; }

    /* Dashboard */
    .metrics-grid         { grid-template-columns: 1fr; }
    .dashboard-container  { flex-direction: column; }
    .dash-sidebar         { width: 100%; }
    .form-grid            { grid-template-columns: 1fr; }
    .dash-content         { padding: 24px; }

    /* Compare */
    .compare-table        { flex-direction: column; }
    .compare-wrapper      { padding: 0 4%; }
}

/* ══════════════════════════════════════════════════════════════════════════
   PHOSPHOR ICONS — global baseline
   ══════════════════════════════════════════════════════════════════════════ */
i[class^="ph"],
i[class*=" ph"] {
    vertical-align: -0.13em;
    line-height: 1;
}
.nav-links a i { margin-right: 3px; }

/* ══════════════════════════════════════════════════════════════════════════
   AUTH PAGES — redesigned with header + footer
   ══════════════════════════════════════════════════════════════════════════ */
.auth-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 300px);
    padding: 48px 20px;
    background: var(--bg-gray);
}

.auth-card {
    background: #fff;
    padding: 44px 40px;
    border-radius: 16px;
    border: 1px solid var(--border);
    width: 100%;
    max-width: 400px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.04);
}

.auth-icon {
    display: block;
    font-size: 2.4rem;
    color: var(--hi5-primary);
    margin-bottom: 14px;
    line-height: 1;
}

.auth-card h2 {
    margin: 0 0 6px;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.auth-subtitle {
    color: var(--text-muted);
    font-size: 0.88rem;
    margin: 0 0 24px;
}

.auth-field { margin-bottom: 16px; }

.auth-field label {
    display: block;
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.auth-field input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    box-sizing: border-box;
    transition: border-color 0.2s;
}
.auth-field input:focus {
    outline: none;
    border-color: var(--hi5-primary);
    box-shadow: 0 0 0 3px rgba(211,84,0,0.08);
}

.auth-submit {
    width: 100%;
    padding: 13px;
    background: var(--hi5-primary);
    color: #fff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
    font-size: 1rem;
    margin-top: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
    font-family: inherit;
}
.auth-submit:hover { filter: brightness(1.08); transform: translateY(-1px); }

.auth-error {
    color: #c0392b;
    background: #fdf0ed;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.auth-success {
    color: #1a7a4a;
    background: #edfaf3;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.auth-link {
    display: block;
    text-align: center;
    margin-top: 20px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.88rem;
}
.auth-link strong { color: var(--hi5-primary); }
.auth-link:hover strong { text-decoration: underline; }

/* ══════════════════════════════════════════════════════════════════════════
   DETAILS PAGE — reviews header + trigger button
   ══════════════════════════════════════════════════════════════════════════ */
.reviews-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.review-trigger-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: var(--text-main);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    font-family: inherit;
}
.review-trigger-btn:hover { background: #2c2c2c; transform: translateY(-1px); }

.review-date {
    font-size: 0.78rem;
    color: var(--text-muted);
    white-space: nowrap;
}

/* ══════════════════════════════════════════════════════════════════════════
   REVIEW REACTIONS
   ══════════════════════════════════════════════════════════════════════════ */
.reaction-bar {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #f5f5f5;
    flex-wrap: wrap;
}

.reaction-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: 50px;
    background: #fff;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
    font-family: inherit;
}
.reaction-btn i,
.reaction-btn svg { font-size: 1rem; pointer-events: none; }
.reaction-btn:hover {
    border-color: var(--hi5-primary);
    color: var(--hi5-primary);
    background: #fff8f4;
}
.reaction-btn.reacted {
    background: #fff5eb;
    border-color: var(--hi5-primary);
    color: var(--hi5-primary);
}
.rxn-count {
    font-variant-numeric: tabular-nums;
    min-width: 12px;
    text-align: center;
}

/* ══════════════════════════════════════════════════════════════════════════
   REVIEW MODAL
   ══════════════════════════════════════════════════════════════════════════ */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(26,26,26,0.45);
    z-index: 3000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(3px);
}
.modal-overlay.open { display: flex; }

.modal-panel {
    background: #fff;
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 500px;
    position: relative;
    max-height: 92vh;
    overflow-y: auto;
    animation: modal-slide-in 0.22s cubic-bezier(0.4,0,0.2,1);
}

@keyframes modal-slide-in {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-muted);
    transition: var(--transition);
    font-family: inherit;
}
.modal-close:hover { background: var(--bg-gray); color: var(--text-main); }

.modal-field {
    margin-bottom: 16px;
    flex: 1;
}
.modal-field label {
    display: block;
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.modal-field select,
.modal-field textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    box-sizing: border-box;
    transition: border-color 0.2s;
}
.modal-field select:focus,
.modal-field textarea:focus {
    outline: none;
    border-color: var(--hi5-primary);
    box-shadow: 0 0 0 3px rgba(211,84,0,0.08);
}
.modal-field textarea { resize: vertical; min-height: 90px; }

.modal-row { display: flex; gap: 12px; }

/* ══════════════════════════════════════════════════════════════════════════
   PROFILE PAGE — Swedish minimalist redesign
   ══════════════════════════════════════════════════════════════════════════ */
.pg-hero {
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 40px 5%;
}

.pg-hero-inner {
    max-width: 940px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.pg-avatar {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border);
    background: var(--bg-gray);
    flex-shrink: 0;
}

.pg-hero-info { flex: 1; }
.pg-hero-info h1 { margin: 0 0 6px; font-size: 1.5rem; font-weight: 800; letter-spacing: -0.5px; }

.pg-stat-row { display: flex; gap: 28px; margin-left: auto; }
.pg-stat { display: flex; flex-direction: column; align-items: center; }
.pg-stat-num { font-size: 1.6rem; font-weight: 800; line-height: 1; color: var(--text-main); }
.pg-stat-label { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); font-weight: 700; margin-top: 3px; }

.pg-toast {
    max-width: 940px;
    margin: 16px auto 0;
    padding: 12px 20px;
    background: #edfaf3;
    color: #1a7a4a;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.pg-body {
    max-width: 940px;
    margin: 36px auto 60px;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 28px;
}

.pg-section-title {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    margin: 0 0 18px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.pg-review-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 22px 24px;
    margin-bottom: 12px;
    transition: box-shadow 0.2s;
}
.pg-review-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.05); }

.pg-review-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.pg-facility-link {
    font-weight: 700;
    font-size: 0.98rem;
    text-decoration: none;
    color: var(--text-main);
}
.pg-facility-link:hover { color: var(--hi5-primary); }

.pg-type-pill {
    display: inline-block;
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    border: 1px solid var(--border);
    padding: 2px 8px;
    border-radius: 20px;
    margin-left: 8px;
    vertical-align: middle;
}

.pg-review-date {
    font-size: 0.78rem;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

.pg-review-text {
    font-size: 0.92rem;
    line-height: 1.65;
    color: #444;
    margin: 10px 0 12px;
}

.pg-review-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pg-scores {
    display: flex;
    gap: 14px;
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 600;
}
.pg-scores i { margin-right: 2px; }

.pg-empty {
    text-align: center;
    padding: 64px 20px;
    color: var(--text-muted);
    border: 1px dashed var(--border);
    border-radius: 12px;
}
.pg-empty i { display: block; font-size: 2.4rem; color: #ccc; margin-bottom: 12px; }
.pg-empty p { margin: 0 0 20px; }

.pg-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 22px 20px;
    margin-bottom: 14px;
}
.pg-card h3 {
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    margin: 0 0 16px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.icon-scroll { display: flex; flex-wrap: wrap; gap: 8px; }

.icon-opt {
    cursor: pointer;
    border-radius: 50%;
    border: 2px solid transparent;
    transition: border-color 0.15s;
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-gray);
}
.icon-opt input { display: none; }
.icon-opt img { width: 30px; height: 30px; object-fit: contain; opacity: 0.55; transition: opacity 0.15s; }
.icon-opt:hover, .icon-opt.selected { border-color: var(--hi5-primary); background: #fff8f4; }
.icon-opt:hover img, .icon-opt.selected img { opacity: 1; }

.pg-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-sizing: border-box;
    font-family: inherit;
    font-size: 0.95rem;
}
.pg-input:focus { outline: none; border-color: var(--hi5-primary); box-shadow: 0 0 0 3px rgba(211,84,0,0.08); }

@media (max-width: 768px) {
    .pg-hero-inner  { gap: 14px; }
    .pg-stat-row    { margin-left: 0; }
    .pg-body        { grid-template-columns: 1fr; }
    .pg-sidebar     { order: -1; }
    .modal-panel    { padding: 28px 20px; }
    .modal-row      { flex-direction: column; gap: 0; }
    .reviews-list-header { flex-direction: column; gap: 12px; align-items: flex-start; }
}
