:root {
    --bg: #05070b;
    --bg-2: #0b0f16;
    --panel: rgba(18, 23, 34, 0.92);
    --panel-2: rgba(14, 18, 27, 0.96);
    --line: rgba(255, 255, 255, 0.08);
    --text: #f4f7fb;
    --muted: #97a3b6;
    --muted-2: #7f8a9a;
    --accent: #56a8f5;
    --accent-2: #2aabee;
    --success: #31c48d;
    --danger: #ff6b6b;
    --shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
    --radius-xl: 28px;
    --radius-lg: 22px;
    --radius-md: 16px;
    --radius-pill: 999px;
}

* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
    background:
            radial-gradient(1100px 520px at 50% -10%, rgba(86, 168, 245, 0.16), transparent 55%),
            radial-gradient(900px 460px at 100% 0%, rgba(42, 171, 238, 0.08), transparent 50%),
            linear-gradient(180deg, #070b12 0%, #04060a 100%);
    color: var(--text);
    font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body {
    min-height: 100vh;
}

.app {
    width: 100%;
    max-width: 460px;
    margin: 0 auto;
    min-height: 100vh;
    padding:
            max(18px, env(safe-area-inset-top))
            16px
            max(24px, env(safe-area-inset-bottom) + 10px);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.hero {
    padding: 12px 4px 6px;
}

.eyebrow {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 10px;
}

.hero h1 {
    margin: 0;
    font-size: 34px;
    line-height: 1.02;
    letter-spacing: -0.035em;
    font-weight: 800;
}

.hero p {
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.55;
    max-width: 42ch;
}

.panel {
    background: linear-gradient(180deg, var(--panel), var(--panel-2));
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.search-card,
.categories-card,
.popular-experts-card,
.cta-card,
.placeholder-card {
    padding: 20px;
}

.section-title {
    margin: 0;
    font-size: 23px;
    line-height: 1.08;
    font-weight: 850;
    letter-spacing: -0.035em;
}

.section-note {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.45;
}

.search-mock {
    margin-top: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--muted);
}

.search-icon {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
    opacity: .88;
}

.search-text {
    font-size: 15px;
}

.chips {
    margin-top: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 10px 14px;
    border-radius: 999px;
    text-decoration: none;
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 14px;
    font-weight: 700;
}

.chip:visited {
    color: var(--text);
}

.chip:active {
    transform: translateY(1px);
}

.cta-main {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.btn {
    appearance: none;
    width: 100%;
    border: 0;
    border-radius: 18px;
    padding: 16px 18px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font: inherit;
    font-weight: 800;
    transition: transform .15s ease, opacity .15s ease, background .15s ease;
}

.btn:visited {
    color: inherit;
}

.btn:active {
    transform: translateY(1px) scale(0.995);
}

.btn-primary {
    color: #fff;
    background: linear-gradient(180deg, #61b4ff 0%, #479df0 100%);
    box-shadow: 0 14px 30px rgba(71, 157, 240, 0.28);
}

.btn-secondary {
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--line);
}

.mini-list {
    margin-top: 14px;
    display: grid;
    gap: 10px;
}

.mini-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(255,255,255,0.025);
    border: 1px solid rgba(255,255,255,0.05);
}

.mini-left {
    min-width: 0;
}

.mini-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
}

.mini-sub {
    margin-top: 2px;
    font-size: 12px;
    color: var(--muted-2);
}

.mini-state {
    flex: 0 0 auto;
    font-size: 12px;
    font-weight: 800;
    color: var(--muted);
}

.foot-note {
    color: var(--muted-2);
    font-size: 12px;
    line-height: 1.5;
    padding: 2px 4px 0;
    text-align: center;
}

@media (min-width: 480px) {
    .app {
        padding-left: 18px;
        padding-right: 18px;
    }
}

.btn-grid {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.debug {
    padding: 0 4px;
    color: var(--muted-2);
    font-size: 12px;
    line-height: 1.45;
    word-break: break-word;
    min-height: 18px;
}

.hidden {
    display: none !important;
}

.btn-soft-blue {
    color: #dff1ff;
    background: rgba(86, 168, 245, 0.14);
    border: 1px solid rgba(86, 168, 245, 0.28);
    box-shadow: none;
}

.btn-soft-blue:hover {
    background: rgba(86, 168, 245, 0.18);
}

.section-head-inline {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.popular-experts-grid {
    margin-top: 14px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.popular-expert-tile {
    display: block;
    min-width: 0;
    text-decoration: none;
    color: var(--text);
    padding: 14px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.045);
    border: 1px solid rgba(255, 255, 255, 0.075);
    transition: transform .15s ease, background .15s ease, border-color .15s ease;
}

.popular-expert-tile:visited {
    color: var(--text);
}

.popular-expert-tile:active {
    transform: translateY(1px);
}

.popular-expert-avatar-wrap {
    margin-bottom: 12px;
}

.popular-expert-avatar {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 18px;
    object-fit: cover;
    display: block;
    background: #151b25;
    border: 1px solid rgba(255,255,255,0.05);
}

.popular-expert-avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-size: 28px;
    font-weight: 800;
    background: rgba(255,255,255,0.035);
}

.popular-expert-name {
    font-size: 16px;
    font-weight: 800;
    line-height: 1.22;
    color: var(--text);
    overflow-wrap: anywhere;
    word-break: normal;
}

.popular-expert-username {
    margin-top: 4px;
    font-size: 12px;
    color: var(--muted);
    min-height: 16px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.popular-expert-meta {
    margin-top: 10px;
    display: grid;
    gap: 4px;
}

.popular-expert-rating {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 800;
    color: var(--text);
}

.popular-expert-star {
    color: #ffd66b;
}

.popular-expert-reviews {
    font-size: 12px;
    color: var(--muted-2);
}

.empty-inline {
    margin-top: 14px;
    color: var(--muted-2);
    font-size: 13px;
    line-height: 1.45;
}

@media (min-width: 560px) {
        .popular-experts-grid {
            grid-template-columns: repeat(3, minmax(0, 1fr));
        }
}

@media (max-width: 340px) {
        .popular-experts-grid {
            grid-template-columns: 1fr;
        }
}

/* Homepage card color identities - flat, no circus gradients */

/* Intro: slightly blue, same style */
.hero-intro-card {
    position: relative;
    padding: 26px 20px 28px;
    border-radius: 30px;
    border: 1px solid rgba(86, 168, 245, 0.18);
    background: rgba(18, 28, 44, 0.72);
    box-shadow:
            0 18px 55px rgba(0, 0, 0, 0.22),
            inset 0 1px 0 rgba(255, 255, 255, 0.045);
}

.hero-intro-card p {
    margin-bottom: 0;
}

/* Search: slightly teal/blue, flat */
.search-card-separated {
    border-color: rgba(244, 114, 182, 0.24);
    background: rgba(48, 25, 43, 0.84);
}

.search-card-separated .search-mock {
    background: rgba(255, 255, 255, 0.045);
    border-color: rgba(244, 114, 182, 0.18);
}

/* IMPORTANT:
   Do not override .categories-card-separated background.
   Browse categories keeps the previous working style. */

.categories-card-separated {
    border-color: rgba(129, 140, 248, 0.22);
    background:
            radial-gradient(360px 180px at 90% 0%, rgba(120, 95, 255, 0.12), transparent 64%),
            linear-gradient(180deg, rgba(20, 25, 39, 0.96), rgba(15, 19, 30, 0.96));
}

/* Popular experts: slightly warm/dark olive, flat */
.popular-experts-card {
    border-color: rgba(52, 211, 153, 0.14);
    background: rgba(18, 33, 29, 0.72);
}

/* CTA: slightly blue, flat */
.cta-card {
    border-color: rgba(86, 168, 245, 0.13);
    background: rgba(18, 27, 40, 0.72);
}

/* Coming next: keep neutral */
.placeholder-card {
    background: linear-gradient(180deg, var(--panel), var(--panel-2));
}

/* Category chips */

.category-chips {
    gap: 10px;
}

.category-chips .chip {
    border-width: 1px;
    box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.045),
            0 8px 18px rgba(0, 0, 0, 0.12);
}

.category-chips .chip:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.18);
}

.chip-blue {
    background: rgba(86, 168, 245, 0.18);
    border-color: rgba(86, 168, 245, 0.32);
}

.chip-green {
    background: rgba(52, 211, 153, 0.17);
    border-color: rgba(52, 211, 153, 0.30);
}

.chip-rose {
    background: rgba(244, 114, 182, 0.17);
    border-color: rgba(244, 114, 182, 0.30);
}

.chip-lime {
    background: rgba(132, 204, 22, 0.17);
    border-color: rgba(132, 204, 22, 0.30);
}

.chip-sky {
    background: rgba(56, 189, 248, 0.17);
    border-color: rgba(56, 189, 248, 0.30);
}

.chip-orange {
    background: rgba(249, 115, 22, 0.17);
    border-color: rgba(249, 115, 22, 0.30);
}

.chip-slate {
    background: rgba(148, 163, 184, 0.16);
    border-color: rgba(148, 163, 184, 0.28);
}

.chip-cyan {
    background: rgba(34, 211, 238, 0.17);
    border-color: rgba(34, 211, 238, 0.30);
}

.chip-yellow {
    background: rgba(250, 204, 21, 0.17);
    border-color: rgba(250, 204, 21, 0.30);
}

.chip-indigo {
    background: rgba(129, 140, 248, 0.18);
    border-color: rgba(129, 140, 248, 0.32);
}

.chip-violet {
    background: rgba(167, 139, 250, 0.18);
    border-color: rgba(167, 139, 250, 0.32);
}

.search-form {
    cursor: text;
    transition:
            border-color .15s ease,
            background .15s ease,
            box-shadow .15s ease,
            transform .15s ease;
}

.search-form:focus-within {
    border-color: rgba(244, 114, 182, 0.28);
    background: rgba(255, 255, 255, 0.05);
    box-shadow:
            0 0 0 3px rgba(244, 114, 182, 0.08),
            inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.search-form:active {
    transform: translateY(1px);
}

.search-input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    padding: 0;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 15px;
    line-height: 1.4;
}

.search-input::placeholder {
    color: var(--muted);
    opacity: 1;
}

.search-input::-webkit-search-decoration,
.search-input::-webkit-search-cancel-button,
.search-input::-webkit-search-results-button,
.search-input::-webkit-search-results-decoration {
    -webkit-appearance: none;
}

.eyebrow a {
    color: inherit;
    text-decoration: none;
}

.eyebrow a:visited {
    color: inherit;
}

.eyebrow a:hover {
    color: inherit;
    text-decoration: none;
}

.eyebrow a:active {
    color: inherit;
}