:root {
    --bg: #f4f7f5;
    --ink: #121718;
    --muted: #687277;
    --panel: #ffffff;
    --line: #dfe7e3;
    --nav: #15191b;
    --nav-soft: #232a2d;
    --coral: #ef6f5e;
    --coral-dark: #d95848;
    --teal: #1d9a8a;
    --teal-soft: #dff4ef;
    --amber: #f5b84b;
    --danger: #d84f4a;
    --shadow: 0 16px 40px rgba(18, 23, 24, 0.10);
    --radius: 8px;
    --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font);
    letter-spacing: 0;
}

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

img {
    display: block;
    max-width: 100%;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

.toast {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 50;
    max-width: min(420px, calc(100vw - 36px));
    padding: 13px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: var(--shadow);
    font-size: 14px;
    font-weight: 700;
}

.toast-success {
    border-color: rgba(29, 154, 138, 0.28);
    color: #086b5c;
}

.toast-error {
    border-color: rgba(216, 79, 74, 0.32);
    color: #a73531;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    background: var(--panel);
    color: var(--ink);
    font-size: 14px;
    font-weight: 800;
    transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--coral);
    color: #fff;
}

.btn-primary:hover {
    background: var(--coral-dark);
}

.btn-ghost {
    border-color: var(--line);
    background: #fff;
}

.btn-small {
    min-height: 36px;
    padding: 0 14px;
    font-size: 13px;
}

.icon-btn {
    width: 38px;
    height: 38px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    color: var(--coral);
    font-size: 18px;
    line-height: 1;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 900;
}

.brand-mark {
    display: inline-grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--coral), var(--teal));
    color: #fff;
    font-size: 13px;
    font-weight: 900;
}

.landing-body {
    background:
        linear-gradient(180deg, rgba(21, 25, 27, .96) 0, rgba(21, 25, 27, .88) 620px, var(--bg) 620px),
        var(--bg);
}

.landing {
    width: min(1180px, calc(100vw - 40px));
    margin: 0 auto;
    padding: 30px 0 70px;
}

.landing-brand {
    margin-bottom: 72px;
    color: #fff;
}

.hero {
    min-height: 620px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(340px, 480px);
    gap: 60px;
    align-items: center;
    color: #fff;
}

.hero h1 {
    max-width: 720px;
    margin: 0;
    font-size: clamp(42px, 7vw, 78px);
    line-height: .96;
    letter-spacing: 0;
}

.hero p {
    max-width: 650px;
    margin: 24px 0 0;
    color: rgba(255, 255, 255, .74);
    font-size: 18px;
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 30px;
}

.hero-visual {
    position: relative;
    min-height: 520px;
}

.phone-card {
    position: absolute;
    inset: 34px 16px auto auto;
    width: min(390px, 100%);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: 0 26px 80px rgba(0, 0, 0, .24);
    color: var(--ink);
}

.phone-card img {
    width: 100%;
    height: 420px;
    object-fit: cover;
}

.phone-card div {
    padding: 18px;
}

.phone-card strong,
.phone-card span,
.phone-card small {
    display: block;
}

.phone-card strong {
    font-size: 24px;
}

.phone-card span {
    margin-top: 5px;
    color: var(--muted);
}

.phone-card small {
    width: fit-content;
    margin-top: 14px;
    padding: 6px 9px;
    border-radius: var(--radius);
    background: var(--teal-soft);
    color: #087263;
    font-weight: 800;
}

.floating-card {
    position: absolute;
    padding: 14px 16px;
    border-radius: var(--radius);
    background: #fff;
    color: var(--ink);
    box-shadow: 0 18px 50px rgba(0, 0, 0, .18);
    font-weight: 900;
}

.card-one {
    top: 86px;
    left: 0;
}

.card-two {
    right: 0;
    bottom: 42px;
}

.auth-grid {
    display: grid;
    grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
    gap: 22px;
    align-items: start;
    margin-top: -10px;
}

.panel {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: var(--shadow);
}

.auth-panel {
    padding: 26px;
}

.auth-panel h2,
.panel h2 {
    margin: 0 0 18px;
    font-size: 24px;
    line-height: 1.15;
}

label {
    display: grid;
    gap: 7px;
    color: #384246;
    font-size: 13px;
    font-weight: 800;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid #ced9d4;
    border-radius: var(--radius);
    background: #fff;
    color: var(--ink);
    padding: 12px 13px;
    font-size: 15px;
    outline: none;
}

textarea {
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(29, 154, 138, .14);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.host-form .form-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.auth-panel,
.host-form,
.inline-form,
.message-form {
    display: grid;
    gap: 14px;
}

.form-note {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.pricing-strip {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 10px;
    margin: 22px 0 0;
}

.price-chip {
    min-height: 94px;
    display: grid;
    align-content: center;
    gap: 8px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
}

.price-chip strong,
.price-chip span {
    display: block;
}

.price-chip span {
    color: var(--coral-dark);
    font-weight: 900;
}

.vip-chip {
    border-color: rgba(245, 184, 75, .6);
    background: #fff9e9;
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 270px minmax(0, 1fr);
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 22px;
    padding: 22px;
    background: var(--nav);
    color: #fff;
}

.side-nav {
    display: grid;
    gap: 6px;
}

.side-nav a,
.logout-link {
    padding: 12px 13px;
    border-radius: var(--radius);
    color: rgba(255, 255, 255, .72);
    font-size: 14px;
    font-weight: 800;
}

.side-nav a:hover,
.side-nav a.is-active,
.logout-link:hover {
    background: var(--nav-soft);
    color: #fff;
}

.side-meter {
    margin-top: auto;
    display: grid;
    gap: 8px;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .06);
}

.side-meter strong,
.side-meter span {
    display: block;
}

.side-meter strong {
    font-size: 16px;
}

.side-meter span {
    color: rgba(255, 255, 255, .68);
    font-size: 13px;
    line-height: 1.45;
}

.main-panel {
    min-width: 0;
    padding: 28px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}

.topbar h1 {
    margin: 4px 0 0;
    font-size: 34px;
    line-height: 1.1;
}

.topline {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 900;
    text-transform: uppercase;
}

.mini-profile {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 8px 12px 8px 8px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    font-weight: 900;
}

.mini-profile img {
    width: 38px;
    height: 38px;
    border-radius: var(--radius);
    object-fit: cover;
}

.stats-grid,
.admin-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.stat-panel,
.admin-tile {
    min-height: 136px;
    display: grid;
    align-content: space-between;
    gap: 10px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: 0 8px 22px rgba(18, 23, 24, .06);
}

.stat-panel span,
.admin-tile span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 900;
    text-transform: uppercase;
}

.stat-panel strong,
.admin-tile strong {
    font-size: 26px;
    line-height: 1.1;
}

.stat-panel small {
    color: var(--muted);
    line-height: 1.45;
}

.stat-panel.accent {
    border-color: rgba(239, 111, 94, .34);
    background: #fff1ef;
}

.notice-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
    padding: 16px 18px;
    border: 1px solid rgba(29, 154, 138, .25);
    border-radius: var(--radius);
    background: var(--teal-soft);
}

.notice-panel strong,
.notice-panel span {
    display: block;
}

.notice-panel span {
    margin-top: 3px;
    color: #38665f;
    line-height: 1.5;
}

.section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin: 26px 0 14px;
}

.section-head.compact {
    align-items: flex-start;
    margin: 0 0 18px;
}

.section-head h2 {
    margin: 0;
    font-size: 26px;
}

.section-head p {
    margin: 6px 0 0;
    color: var(--muted);
    line-height: 1.55;
}

.profile-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(220px, 1fr));
    gap: 16px;
}

.profile-grid.compact-cards {
    grid-template-columns: repeat(3, minmax(220px, 1fr));
}

.profile-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: 0 12px 26px rgba(18, 23, 24, .07);
}

.profile-image {
    position: relative;
    aspect-ratio: 4 / 5;
    background: #edf3f0;
}

.profile-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.host-label {
    position: absolute;
    left: 10px;
    bottom: 10px;
    padding: 6px 9px;
    border-radius: var(--radius);
    background: rgba(21, 25, 27, .84);
    color: #fff;
    font-size: 12px;
    font-weight: 900;
}

.host-label.verified {
    background: rgba(29, 154, 138, .88);
}

.host-label.inline {
    position: static;
    background: var(--nav);
}

.profile-body {
    display: grid;
    gap: 10px;
    padding: 14px;
}

.profile-body h3 {
    margin: 0;
    font-size: 20px;
}

.profile-body p {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}

.profile-body .bio {
    min-height: 44px;
    font-size: 14px;
}

.profile-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.profile-meta span,
.balance-pill,
.photo-counter {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 10px;
    border-radius: var(--radius);
    background: #eef4f1;
    color: #49605a;
    font-size: 12px;
    font-weight: 900;
}

.card-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.two-column {
    display: grid;
    grid-template-columns: minmax(0, .96fr) minmax(340px, .72fr);
    gap: 18px;
    align-items: start;
}

.two-column .panel,
.messages-layout .panel,
.panel {
    padding: 20px;
}

.upload-box {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    margin-bottom: 14px;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.photo-grid figure,
.empty-photo {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    margin: 0;
    border: 1px dashed #c6d2ce;
    border-radius: var(--radius);
    background: #eef4f1;
}

.photo-grid figure img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-grid figure form {
    position: absolute;
    right: 7px;
    bottom: 7px;
}

.photo-grid figure button {
    border: 0;
    border-radius: var(--radius);
    background: rgba(21, 25, 27, .78);
    color: #fff;
    padding: 6px 8px;
    font-size: 12px;
    font-weight: 800;
}

.empty-photo {
    display: grid;
    place-items: center;
    color: var(--muted);
    font-weight: 900;
}

.messages-layout {
    display: grid;
    grid-template-columns: 310px minmax(0, 1fr);
    gap: 18px;
    align-items: stretch;
}

.conversation-list {
    display: grid;
    align-content: start;
    gap: 10px;
}

.person-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px;
    border-radius: var(--radius);
    border: 1px solid transparent;
}

.person-row:hover,
.person-row.is-active {
    border-color: var(--line);
    background: #f7faf8;
}

.person-row img {
    width: 46px;
    height: 46px;
    object-fit: cover;
    border-radius: var(--radius);
}

.person-row strong,
.person-row small {
    display: block;
}

.person-row small {
    color: var(--muted);
}

.chat-panel {
    min-height: 620px;
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: 14px;
}

.chat-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
}

.chat-head img {
    width: 58px;
    height: 58px;
    object-fit: cover;
    border-radius: var(--radius);
}

.chat-head h2,
.chat-head p {
    margin: 0;
}

.chat-head p {
    margin-top: 4px;
    color: var(--muted);
}

.message-stream {
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow: auto;
    padding: 4px;
}

.message-bubble {
    width: fit-content;
    max-width: min(620px, 86%);
    padding: 12px 13px;
    border-radius: var(--radius);
    background: #eef4f1;
}

.message-bubble.mine {
    align-self: flex-end;
    background: var(--coral);
    color: #fff;
}

.message-bubble p,
.message-bubble small {
    margin: 0;
}

.message-bubble small {
    display: block;
    margin-top: 6px;
    opacity: .72;
    font-size: 12px;
}

.message-form {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
}

.empty-state {
    min-height: 320px;
    display: grid;
    place-items: center;
    color: var(--muted);
    text-align: center;
    font-weight: 800;
}

.coin-hero {
    background: #fff1ef;
    border-color: rgba(239, 111, 94, .28);
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(220px, 1fr));
    gap: 16px;
}

.pricing-card {
    min-height: 230px;
    display: grid;
    align-content: space-between;
    gap: 18px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: 0 10px 26px rgba(18, 23, 24, .07);
}

.pricing-card h2,
.pricing-card p {
    margin: 0;
}

.pricing-card p {
    margin-top: 8px;
    color: var(--muted);
    line-height: 1.5;
}

.pricing-card > strong {
    font-size: 30px;
}

.vip-card {
    background: #15191b;
    color: #fff;
}

.vip-card p {
    color: rgba(255, 255, 255, .72);
}

.admin-tile:hover {
    transform: translateY(-1px);
}

.admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    min-width: 900px;
    border-collapse: collapse;
}

th,
td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
}

th {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

td strong,
td small {
    display: block;
}

td small {
    margin-top: 4px;
    color: var(--muted);
}

.small-input {
    max-width: 140px;
}

.checkbox-line {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 7px;
    font-size: 12px;
}

.checkbox-line input {
    width: auto;
}

.inline-form {
    grid-template-columns: repeat(6, minmax(120px, 1fr));
    align-items: end;
}

@media (max-width: 1180px) {
    .profile-grid,
    .pricing-grid {
        grid-template-columns: repeat(3, minmax(220px, 1fr));
    }

    .stats-grid,
    .admin-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .pricing-strip {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .hero,
    .auth-grid,
    .two-column,
    .messages-layout {
        grid-template-columns: 1fr;
    }

    .landing-brand {
        margin-bottom: 42px;
    }

    .hero-visual {
        min-height: 420px;
    }

    .phone-card {
        inset: 0 auto auto 0;
        width: min(390px, 92vw);
    }

    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        height: auto;
    }

    .side-nav {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .side-nav a,
    .logout-link {
        text-align: center;
    }

    .profile-grid,
    .profile-grid.compact-cards,
    .pricing-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .host-form .form-row,
    .inline-form {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 640px) {
    .landing,
    .main-panel {
        width: auto;
        padding-left: 14px;
        padding-right: 14px;
    }

    .landing {
        width: min(100%, calc(100vw - 20px));
    }

    .hero {
        min-height: auto;
        padding-bottom: 30px;
    }

    .hero h1 {
        font-size: 42px;
    }

    .hero p {
        font-size: 16px;
    }

    .form-row,
    .host-form .form-row,
    .side-nav,
    .stats-grid,
    .admin-grid,
    .profile-grid,
    .profile-grid.compact-cards,
    .pricing-grid,
    .pricing-strip,
    .photo-grid,
    .inline-form,
    .message-form {
        grid-template-columns: 1fr;
    }

    .topbar,
    .section-head,
    .notice-panel {
        align-items: stretch;
        flex-direction: column;
    }

    .topbar h1 {
        font-size: 30px;
    }

    .mini-profile {
        justify-content: flex-start;
    }

    .upload-box {
        grid-template-columns: 1fr;
    }
}
