:root {
    --bg: #ffffff;
    --bg-elevated: #f0f2f5;
    --bg-card: #ffffff;
    --border: #dddfe2;
    --text: #1c1e21;
    --text-muted: #65676b;
    --primary: #1877f2;
    --primary-hover: #166fe5;
    --primary-light: #e7f3ff;
    --accent: #1877f2;
    --danger: #e41e3f;
    --warning: #f59e0b;
    --radius: 8px;
    --radius-sm: 6px;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    --font: 'Inter', system-ui, -apple-system, sans-serif;
}

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

html {
    scroll-behavior: smooth;
}

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

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

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

.container {
    width: min(1120px, calc(100% - 2rem));
    margin-inline: auto;
}

/* Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 68px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--primary);
}

.logo-img {
    height: 36px;
    width: auto;
    display: block;
}

.logo-text {
    font-size: 1.25rem;
}

.nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-link {
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-link.is-active {
    color: var(--primary);
    font-weight: 600;
}

.nav-link:hover {
    color: var(--primary);
}

@media (max-width: 640px) {
    .header-inner {
        height: auto;
        min-height: 56px;
        padding: 0.5rem 0;
        gap: 0.5rem;
    }

    .logo-img {
        height: 30px;
    }

    .nav {
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: 0.35rem 0.75rem;
        max-width: 100%;
    }

    .nav-link {
        font-size: 0.82rem;
    }

    .nav .btn-sm {
        padding: 0.45rem 0.75rem;
        font-size: 0.8rem;
    }
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.35rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.btn-sm {
    padding: 0.55rem 1rem;
    font-size: 0.875rem;
}

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

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

.btn-secondary {
    background: var(--bg-elevated);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: #e4e6eb;
}

.btn-ghost {
    background: transparent;
    color: var(--primary);
    border: none;
}

.btn-ghost:hover {
    background: var(--primary-light);
}

.btn-block {
    width: 100%;
}

/* Flash */
.flash {
    padding: 0.85rem 0;
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
}

.flash-success {
    background: #e7f3ff;
    color: #1877f2;
    border-bottom: 1px solid #b3d4fc;
}

.flash-error {
    background: #ffebe8;
    color: #e41e3f;
    border-bottom: 1px solid #f5c6cb;
}

.flash-info {
    background: #e7f3ff;
    color: #1877f2;
    border-bottom: 1px solid #b3d4fc;
}

/* Landing – Facebook-style split */
.landing-split {
    padding: 3rem 0 4rem;
    background: var(--bg-elevated);
}

.landing-split-inner {
    display: grid;
    grid-template-columns: 1fr 396px;
    gap: 4rem;
    align-items: center;
}

.landing-copy .hero-badge {
    margin-bottom: 1rem;
}

.landing-copy h1 {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.03em;
    margin-bottom: 1rem;
}

.landing-copy h1 span {
    color: var(--primary);
}

.landing-lead {
    font-size: 1.25rem;
    color: var(--text-muted);
    line-height: 1.5;
    max-width: 36ch;
}

.landing-card {
    width: 100%;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
}

.landing-card h2 {
    font-size: 1.35rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 0.25rem;
}

.landing-card .subtitle {
    text-align: center;
    margin-bottom: 1.25rem;
}

.form-error {
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    padding: 0.75rem;
    font-size: 0.9rem;
}

/* Hero (legacy) */
.hero {
    padding: 5rem 0 4rem;
    text-align: center;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.hero h1 {
    font-size: clamp(2.2rem, 5vw, 3.5rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.03em;
    margin-bottom: 1.25rem;
    max-width: 18ch;
    margin-inline: auto;
}

.hero h1 span {
    color: var(--primary);
}

.hero-sub {
    font-size: 1.15rem;
    color: var(--text-muted);
    max-width: 52ch;
    margin: 0 auto 2.5rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 4rem;
}

/* Features */
.features {
    padding: 2rem 0 5rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem;
    transition: border-color 0.2s, transform 0.2s;
}

.feature-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
}

.feature-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.feature-icon.blue { background: var(--primary-light); }
.feature-icon.green { background: var(--primary-light); }
.feature-icon.purple { background: var(--primary-light); }

.feature-card h3 {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.feature-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Pricing highlight */
.pricing-banner {
    margin-top: 3rem;
    background: var(--primary-light);
    border: 1px solid #b3d4fc;
    border-radius: var(--radius);
    padding: 2rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.pricing-banner h3 {
    font-size: 1.2rem;
    margin-bottom: 0.35rem;
}

.pricing-banner p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.price-tag {
    font-size: 2rem;
    font-weight: 800;
    color: var(--accent);
}

.price-tag small {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
}

/* Auth pages */
.auth-page {
    flex: 1;
    display: grid;
    place-items: center;
    padding: 2rem 0 4rem;
}

.auth-card {
    width: min(440px, 100%);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.25rem;
    box-shadow: var(--shadow);
}

.auth-card h1 {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 0.35rem;
    letter-spacing: -0.02em;
}

.auth-card .subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.75rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.15rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--text-muted);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 0.9rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(24, 119, 242, 0.2);
}

.form-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
}

.tax-number-row {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.tax-number-row input {
    width: 100%;
    min-width: 0;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.tax-number-row input#tax_number_1 {
    flex: 3;
}

.tax-number-row input#tax_number_2 {
    flex: 0 0 2.5rem;
}

.tax-number-row input#tax_number_3 {
    flex: 0 0 3.25rem;
}

.tax-number-sep {
    color: var(--text-muted);
    font-weight: 600;
    flex-shrink: 0;
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.auth-footer a {
    color: var(--primary);
    font-weight: 600;
}

.auth-footer a:hover {
    text-decoration: underline;
}

.auth-divider {
    text-align: center;
    margin: 1.5rem 0 1.25rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    position: relative;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 38%;
    height: 1px;
    background: var(--border);
}

.auth-divider::before { left: 0; }
.auth-divider::after { right: 0; }

.auth-register-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Account type selector */
.account-type-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.account-type-option {
    position: relative;
}

.account-type-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.account-type-label {
    display: block;
    padding: 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.account-type-label strong {
    display: block;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.account-type-label span {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.account-type-option input:checked + .account-type-label {
    border-color: var(--primary);
    background: var(--primary-light);
}

.account-type-option input:focus-visible + .account-type-label {
    box-shadow: 0 0 0 2px rgba(24, 119, 242, 0.2);
}

/* Dashboard */
.page-dashboard {
    background: var(--bg-elevated);
}

.dashboard-page {
    flex: 1;
    padding: 1.25rem 0 2rem;
}

.dashboard-layout {
    display: grid;
    grid-template-columns: 260px minmax(0, 680px) 260px;
    gap: 1.25rem;
    align-items: start;
}

.dashboard-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    box-shadow: var(--shadow);
}

.profile-card {
    text-align: center;
}

.profile-card strong {
    display: block;
    margin-top: 0.75rem;
    font-size: 0.95rem;
}

.profile-type {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-top: 0.75rem;
}

.sidebar-link {
    display: block;
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text);
}

.sidebar-link:hover {
    background: var(--bg-elevated);
}

.sidebar-link.is-active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}

.profile-avatar {
    width: 64px;
    height: 64px;
    margin: 0 auto;
    border-radius: 10px;
    background: var(--primary);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.profile-avatar-sm {
    width: 40px;
    height: 40px;
    margin: 0;
    font-size: 1rem;
    flex-shrink: 0;
    border-radius: 8px;
}

.profile-avatar-img {
    border-radius: 10px;
    object-fit: cover;
    display: block;
    flex-shrink: 0;
}

.profile-avatar-img.profile-avatar-sm {
    width: 40px;
    height: 40px;
    border-radius: 8px;
}

.profile-avatar-img.profile-avatar {
    width: 64px;
    height: 64px;
    margin: 0 auto;
}

.business-logo {
    border-radius: 8px;
    object-fit: cover;
    aspect-ratio: 1;
    flex-shrink: 0;
}

.business-logo.profile-avatar-sm,
.business-logo--empty.profile-avatar-sm {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
}

.business-logo.profile-avatar,
.business-logo--empty.profile-avatar {
    width: 64px;
    height: 64px;
    min-width: 64px;
    min-height: 64px;
    border-radius: 10px;
}

.business-logo--empty {
    display: grid;
    place-items: center;
    background: #f0f2f5;
    padding: 0;
    overflow: hidden;
}

.business-logo--empty.profile-avatar-sm {
    font-size: 0;
}

.business-logo--empty.profile-avatar {
    font-size: 0;
}

.compose-card h2 {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
}

.compose-row {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.compose-row textarea {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-family: inherit;
    font-size: 0.95rem;
    resize: none;
    min-height: 44px;
    background: var(--bg-elevated);
}

.compose-row textarea:focus {
    outline: none;
    border-color: var(--primary);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
}

.compose-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.75rem;
    gap: 1rem;
}

.compose-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.compose-upload {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
    cursor: pointer;
}

.compose-upload input {
    display: none;
}

.feed-post-image {
    width: 100%;
    border-radius: var(--radius-sm);
    margin-top: 0.75rem;
}

.dashboard-feed {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.feed-post-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.feed-post-avatar-link {
    flex-shrink: 0;
    line-height: 0;
}

.feed-post-author {
    display: block;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
}

.feed-post-author:hover {
    text-decoration: underline;
}

.feed-post-header time {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.feed-post-content {
    font-size: 0.95rem;
    line-height: 1.55;
    word-break: break-word;
}

.feed-post-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.75rem;
    padding-top: 0.65rem;
    border-top: 1px solid var(--border);
    font-size: 0.82rem;
    color: var(--text-muted);
}

.feed-post-stat-likes {
    color: var(--text-muted);
}

.feed-post-stat-comments {
    margin-left: auto;
    padding: 0;
    border: 0;
    background: none;
    color: var(--text-muted);
    font: inherit;
    cursor: pointer;
}

.feed-post-stat-comments:hover {
    text-decoration: underline;
}

.feed-post-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.35rem;
    margin-top: 0.5rem;
    padding-top: 0.35rem;
    border-top: 1px solid var(--border);
}

.feed-post-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.55rem 0.5rem;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.feed-post-action:hover {
    background: var(--bg-elevated);
}

.feed-post-action-like.is-active {
    color: var(--primary);
}

.feed-post-action-icon {
    font-size: 1rem;
    line-height: 1;
}

.feed-post-comments {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

.post-comments-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin-bottom: 0.75rem;
}

.post-comment {
    font-size: 0.88rem;
    line-height: 1.45;
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
    padding: 0.55rem 0.75rem;
}

.post-comment strong {
    color: var(--text);
    font-size: 0.85rem;
}

.post-comment time {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.post-comments-empty,
.post-comments-login {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.post-comment-form {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.post-comment-form input {
    flex: 1;
    min-width: 0;
    padding: 0.6rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-family: inherit;
    font-size: 0.88rem;
    background: var(--bg-elevated);
}

.post-comment-form input:focus {
    outline: none;
    border-color: var(--primary);
}

.post-action-toast {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%) translateY(1rem);
    background: #1c1e21;
    color: #fff;
    padding: 0.65rem 1.1rem;
    border-radius: 999px;
    font-size: 0.85rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
    z-index: 1000;
}

.post-action-toast.is-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.dashboard-layout--single {
    grid-template-columns: minmax(0, 680px);
    justify-content: center;
}

.post-single-back {
    margin-top: 1rem;
    font-size: 0.9rem;
}

.post-single-back a {
    color: var(--primary);
    font-weight: 600;
}

.feed-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem 1rem;
}

.feed-posts {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.feed-loader,
.feed-end {
    text-align: center;
    padding: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.user-sidebar-card {
    margin-bottom: 0;
}

/* Business profile page */
.page-profile {
    background: var(--bg-elevated);
}

.profile-page {
    padding-bottom: 2rem;
}

.profile-top {
    max-width: 1080px;
}

.breadcrumbs {
    padding: 0.75rem 0 1rem;
}

.breadcrumbs-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    list-style: none;
    font-size: 0.85rem;
}

.breadcrumbs-item {
    display: inline-flex;
    align-items: center;
    color: var(--text-muted);
}

.breadcrumbs-item:not(:last-child)::after {
    content: '/';
    margin-left: 0.35rem;
    color: var(--border);
}

.breadcrumbs-item a {
    color: var(--primary);
    font-weight: 500;
}

.breadcrumbs-item a:hover {
    text-decoration: underline;
}

.breadcrumbs-item span {
    color: var(--text);
    font-weight: 600;
}

.profile-cover-wrap {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    background: var(--bg-card);
}

.profile-cover {
    width: 100%;
    height: clamp(160px, 28vw, 360px);
    background-size: cover;
    background-position: center;
    background-color: #dfe7f5;
}

.profile-cover--empty {
    background-color: #eef1f5;
}

.profile-cover-placeholder {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.profile-header-wrap {
    margin-top: -44px;
    position: relative;
    z-index: 1;
    padding: 0 0.25rem;
}

.profile-header {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    padding-bottom: 1rem;
}

.profile-logo-wrap {
    position: relative;
    flex-shrink: 0;
    width: 120px;
    height: 120px;
}

.profile-logo-wrap > .profile-logo {
    width: 100%;
    height: 100%;
}

.profile-cover-upload {
    position: absolute;
    right: 0.75rem;
    bottom: 0.75rem;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
}

.profile-logo-upload {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.35);
    opacity: 0;
    transition: opacity 0.2s;
}

.profile-logo-wrap:hover .profile-logo-upload,
.profile-logo-upload:focus-within {
    opacity: 1;
}

.profile-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.75rem;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.95);
    color: var(--text);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border);
}

.profile-upload-btn--logo {
    background: rgba(255, 255, 255, 0.92);
    flex-direction: column;
    padding: 0.5rem 0.65rem;
    text-align: center;
    line-height: 1.2;
}

.profile-upload-btn:hover {
    background: #fff;
}

.profile-upload-btn input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
}

.profile-upload-btn-icon {
    font-size: 1rem;
    line-height: 1;
}

.profile-upload-hint {
    margin: 0;
    font-size: 0.7rem;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    text-align: center;
}

.profile-cover-upload .profile-upload-hint {
    background: rgba(0, 0, 0, 0.45);
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
}

.profile-logo-upload .profile-upload-hint {
    color: #fff;
    font-size: 0.65rem;
}

@media (hover: none) {
    .profile-logo-upload {
        opacity: 1;
        background: rgba(0, 0, 0, 0.3);
    }
}

.profile-upload-error {
    margin-bottom: 0.75rem;
}

.profile-logo {
    width: 120px;
    height: 120px;
    border-radius: 14px;
    border: 4px solid var(--bg-card);
    object-fit: cover;
    background: var(--bg-card);
    box-shadow: var(--shadow);
    flex-shrink: 0;
}

.profile-logo--empty {
    display: grid;
    place-items: center;
    background: #f0f2f5;
    padding: 0;
    overflow: hidden;
}

.profile-logo-placeholder {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Vállalkozásom oldal: minden kis logó szigorúan négyszög */
.page-profile .business-logo,
.page-profile .business-logo--empty,
.page-profile .feed-post-avatar-link img,
.page-profile .feed-post-avatar-link .profile-avatar,
.page-profile .user-sidebar-card .business-logo,
.page-profile .user-sidebar-card .business-logo--empty {
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

.page-profile .profile-header .profile-logo {
    width: 120px;
    height: 120px;
    border-radius: 14px;
}

.page-profile .user-sidebar-card .business-logo,
.page-profile .user-sidebar-card .business-logo--empty {
    width: 64px;
    height: 64px;
    border-radius: 10px;
}

.page-profile .feed-post-header .business-logo,
.page-profile .feed-post-header .business-logo--empty {
    width: 40px;
    height: 40px;
    border-radius: 8px;
}

.profile-header-text h1 {
    font-size: 1.75rem;
    margin-bottom: 0.25rem;
}

.profile-header-text p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.profile-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    gap: 1.25rem;
    align-items: start;
    margin-top: 1rem;
    max-width: 1080px;
}

.profile-info-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.profile-info-card h3 {
    font-size: 0.95rem;
    margin: 1.1rem 0 0.65rem;
    color: var(--text);
}

.profile-edit-card h2 {
    margin-bottom: 1rem;
}

.profile-edit-form {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.profile-form-section {
    border: 0;
    margin: 0 0 1rem;
    padding: 0;
}

.profile-form-section legend {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--primary);
    margin-bottom: 0.65rem;
    padding: 0;
}

.profile-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
}

.profile-edit-form .form-group {
    margin-bottom: 0.75rem;
}

.profile-edit-form .form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
    color: var(--text-muted);
}

.profile-edit-form .form-group input,
.profile-edit-form .form-group select,
.profile-edit-form .form-group textarea {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.88rem;
    background: var(--bg-elevated);
}

.profile-edit-form .form-group input:focus,
.profile-edit-form .form-group select:focus,
.profile-edit-form .form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(24, 119, 242, 0.15);
}

.profile-edit-form textarea {
    resize: vertical;
    min-height: 100px;
}

.profile-public-link {
    margin-top: 0.75rem;
}

@media (max-width: 600px) {
    .profile-form-row {
        grid-template-columns: 1fr;
    }
}

.profile-info-card h2,
.profile-info-card h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
}

.profile-info-card h3 {
    margin-top: 1rem;
}

.profile-info-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.profile-info-list dt {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.profile-info-list dd {
    font-size: 0.9rem;
    margin-top: 0.15rem;
}

.profile-description {
    font-size: 0.9rem;
    line-height: 1.55;
    color: var(--text-muted);
}

.profile-feed-title {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    padding-left: 0.25rem;
}

.profile-main {
    min-width: 0;
}

.profile-tabs {
    display: flex;
    gap: 0.35rem;
    margin-bottom: 0.85rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 0.15rem;
}

.profile-tabs::-webkit-scrollbar {
    display: none;
}

.profile-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1rem;
    border-radius: 999px;
    background: var(--bg-elevated);
    color: var(--text-muted);
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    border: 1px solid var(--border);
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.profile-tab:hover {
    color: var(--primary);
    border-color: rgba(24, 119, 242, 0.35);
}

.profile-tab.is-active {
    background: rgba(24, 119, 242, 0.12);
    color: var(--primary);
    border-color: rgba(24, 119, 242, 0.35);
}

.profile-tab-badge,
.nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1;
}

.profile-edit-link {
    margin-top: 1rem;
}

.form-success {
    border-radius: var(--radius-sm);
    margin-bottom: 0.75rem;
    padding: 0.65rem;
    font-size: 0.85rem;
    background: #e7f3e8;
    color: #1b7f4b;
}

.profile-feed {
    min-width: 0;
}

.guest-card p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    text-align: center;
}

.guest-card .btn {
    margin-bottom: 0.5rem;
}

.guest-card .btn:last-child {
    margin-bottom: 0;
}

.info-card h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
}

.info-card ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.info-card li {
    font-size: 0.85rem;
    color: var(--text-muted);
    padding-left: 1rem;
    position: relative;
}

.info-card li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--primary);
}

.form-error {
    border-radius: var(--radius-sm);
    margin-bottom: 0.75rem;
    padding: 0.65rem;
    font-size: 0.85rem;
}

/* Payment page */
.payment-card {
    width: min(500px, 100%);
}

.payment-summary {
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.payment-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    font-size: 0.95rem;
}

.payment-row.total {
    border-top: 1px solid var(--border);
    margin-top: 0.5rem;
    padding-top: 1rem;
    font-weight: 700;
    font-size: 1.1rem;
}

.payment-note {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 1rem;
    line-height: 1.5;
}

/* Footer */
.site-footer {
    margin-top: auto;
    border-top: 1px solid var(--border);
    padding: 1.5rem 0;
}

.footer-inner p {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

main {
    flex: 1;
}

/* Responsive */
@media (max-width: 1100px) {
    .dashboard-layout {
        grid-template-columns: 1fr;
    }

    .dashboard-sidebar:last-child {
        display: none;
    }

    .profile-layout {
        grid-template-columns: 1fr;
    }

    .tab-messages .profile-info-sidebar {
        display: none;
    }

    .tab-messages .dashboard-sidebar:first-child {
        display: none;
    }
}

@media (max-width: 900px) {
    .landing-split-inner {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .landing-copy {
        text-align: center;
    }

    .landing-lead {
        margin-inline: auto;
    }
}

@media (max-width: 600px) {
    .account-type-grid {
        grid-template-columns: 1fr;
    }

    .hero {
        padding-top: 3rem;
    }

    .pricing-banner {
        flex-direction: column;
        text-align: center;
    }
}

/* Nav badge (header) */
.nav-link .nav-badge {
    margin-left: 0.25rem;
}

/* Messages (embedded in profile / dashboard) */
.dashboard-messages-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    text-decoration: none;
    color: inherit;
    font-weight: 600;
    font-size: 0.9rem;
    transition: border-color 0.15s, background 0.15s;
}

.dashboard-messages-link:hover,
.dashboard-messages-link.is-active {
    border-color: rgba(24, 119, 242, 0.35);
    background: rgba(24, 119, 242, 0.06);
}

.profile-messages {
    display: grid;
    grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
    gap: 0.85rem;
    align-items: stretch;
    min-height: 420px;
}

.profile-messages-title {
    font-size: 1rem;
    margin: 0;
}

.profile-messages-list {
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-height: min(70vh, 640px);
    overflow: hidden;
}

.profile-messages-list .thread-list {
    overflow-y: auto;
    flex: 1;
    -webkit-overflow-scrolling: touch;
}

.profile-messages-chat {
    min-height: 420px;
}

.messages-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 2rem 1.25rem;
    text-align: center;
}

.messages-sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
    flex-shrink: 0;
}

.messages-badge {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary);
    background: rgba(24, 119, 242, 0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    white-space: nowrap;
}

.messages-empty,
.messages-hint {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

.thread-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.thread-list-item {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: inherit;
    transition: background 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.thread-list-item:hover {
    background: var(--bg-elevated);
}

.thread-list-item.is-active {
    background: rgba(24, 119, 242, 0.1);
}

.thread-list-item.is-unread strong {
    color: var(--primary);
}

.thread-list-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
}

.thread-list-top time {
    font-size: 0.72rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.thread-list-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.thread-avatar {
    flex-shrink: 0;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 999px;
    background: rgba(24, 119, 242, 0.15);
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.thread-list-item.is-unread .thread-avatar {
    background: var(--primary);
    color: #fff;
}

.thread-snippet {
    display: block;
    margin-top: 0.15rem;
}

.thread-snippet-bubble {
    display: block;
    padding: 0.45rem 0.6rem;
    border-radius: 0.75rem;
    background: var(--bg-elevated);
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.thread-list-item.is-unread .thread-snippet-bubble {
    background: rgba(24, 119, 242, 0.1);
    color: var(--text);
}

.thread-snippet-author {
    font-weight: 600;
    color: var(--primary);
}

.thread-list-subject {
    font-size: 0.85rem;
    color: var(--text);
}

.thread-list-preview {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-panel {
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.chat-header-main {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
}

.chat-header-main h3 {
    font-size: 0.95rem;
    margin: 0 0 0.15rem;
    word-break: break-word;
}

.chat-back-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 999px;
    background: var(--bg-elevated);
    color: var(--primary);
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 700;
    flex-shrink: 0;
}

.chat-partner {
    margin: 0;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 0.85rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    -webkit-overflow-scrolling: touch;
}

.chat-bubble-wrap {
    display: flex;
}

.chat-bubble-wrap.is-mine {
    justify-content: flex-end;
}

.chat-bubble {
    max-width: min(88%, 420px);
    padding: 0.65rem 0.85rem;
    border-radius: 1rem;
    background: var(--bg-elevated);
    font-size: 0.9rem;
}

.chat-bubble-wrap.is-mine .chat-bubble {
    background: rgba(24, 119, 242, 0.12);
    border-bottom-right-radius: 0.25rem;
}

.chat-bubble-wrap:not(.is-mine) .chat-bubble {
    border-bottom-left-radius: 0.25rem;
}

.chat-bubble strong {
    display: block;
    font-size: 0.78rem;
    margin-bottom: 0.25rem;
    color: var(--primary);
}

.chat-bubble p {
    margin: 0;
    line-height: 1.45;
    word-break: break-word;
}

.chat-bubble time {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.72rem;
    color: var(--text-muted);
    text-align: right;
}

.chat-reply-form {
    padding: 0.65rem 1rem calc(0.75rem + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--border);
    background: var(--bg);
    flex-shrink: 0;
}

.chat-reply-row {
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
}

.chat-reply-row textarea {
    flex: 1;
    resize: none;
    min-height: 2.75rem;
    max-height: 120px;
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 1rem;
    background: var(--bg-elevated);
}

.chat-reply-row textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(24, 119, 242, 0.15);
}

.chat-send-btn {
    flex-shrink: 0;
    min-height: 2.75rem;
    min-width: 4.5rem;
}

.contact-card {
    margin-top: 0;
}

.contact-card h2 {
    font-size: 1rem;
    margin: 0 0 0.5rem;
}

.contact-card-lead {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0 0 1rem;
    line-height: 1.45;
}

.contact-form .form-group {
    margin-bottom: 0.75rem;
}

@media (max-width: 900px) {
    .profile-messages {
        grid-template-columns: 1fr;
        min-height: calc(100dvh - 11rem);
    }

    .profile-messages-list {
        max-height: none;
    }

    .profile-messages-chat {
        min-height: 0;
    }

    .messages-thread-open .profile-messages-list {
        display: none;
    }

    .messages-thread-open .profile-messages-chat {
        display: flex;
        min-height: calc(100dvh - 11rem);
    }

    .profile-messages:not(.has-thread) .profile-messages-chat {
        display: none;
    }

    .profile-messages.has-thread .profile-messages-chat {
        display: flex;
    }

    .chat-back-btn {
        display: inline-flex;
    }

    .chat-messages {
        flex: 1;
        max-height: none;
    }

    .chat-reply-row {
        align-items: stretch;
    }

    .chat-send-btn {
        align-self: flex-end;
    }

    .chat-profile-link {
        display: none;
    }
}

@media (max-width: 600px) {
    .profile-tabs {
        margin-inline: -0.15rem;
    }

    .profile-tab {
        padding: 0.5rem 0.85rem;
        font-size: 0.84rem;
    }

    .thread-list-item {
        padding: 0.85rem 0.65rem;
    }

    .chat-bubble {
        max-width: 92%;
        font-size: 0.95rem;
    }
}

/* Floating chat widget */
body.has-chat-widget main {
    padding-bottom: calc(5rem + env(safe-area-inset-bottom, 0px));
}

body.has-chat-widget .profile-feed,
body.has-chat-widget .dashboard-feed {
    padding-bottom: 0.5rem;
}

.chat-widget {
    position: fixed;
    right: max(1rem, env(safe-area-inset-right, 0px));
    bottom: max(1rem, env(safe-area-inset-bottom, 0px));
    z-index: 250;
}

.chat-fab {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3.5rem;
    height: 3.5rem;
    border: none;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    box-shadow: 0 8px 24px rgba(24, 119, 242, 0.45);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.chat-fab:hover {
    transform: scale(1.04);
    box-shadow: 0 10px 28px rgba(24, 119, 242, 0.5);
}

.chat-fab.has-unread {
    animation: chat-fab-pulse 2s ease-in-out infinite;
}

@keyframes chat-fab-pulse {
    0%, 100% { box-shadow: 0 8px 24px rgba(24, 119, 242, 0.45); }
    50% { box-shadow: 0 8px 28px rgba(228, 30, 63, 0.55); }
}

.chat-fab-icon {
    display: block;
}

.chat-fab-badge {
    position: absolute;
    top: -0.15rem;
    right: -0.15rem;
    min-width: 1.35rem;
    height: 1.35rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    background: #e41e3f;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.35rem;
    text-align: center;
    border: 2px solid var(--bg);
}

.chat-fab {
    position: relative;
}

.chat-drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 248;
}

.chat-drawer {
    position: fixed;
    right: max(1rem, env(safe-area-inset-right, 0px));
    bottom: calc(4.75rem + env(safe-area-inset-bottom, 0px));
    width: min(380px, calc(100vw - 2rem));
    height: min(520px, calc(100dvh - 7rem));
    min-height: 320px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 16px 48px rgba(15, 23, 42, 0.2);
    z-index: 249;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.chat-drawer-header h2 {
    margin: 0;
    font-size: 1rem;
}

.chat-drawer-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border: none;
    border-radius: 999px;
    background: var(--bg-elevated);
    color: var(--text-muted);
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
}

.chat-drawer-body {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.chat-drawer-loading,
.chat-drawer-error,
.chat-drawer-hint {
    padding: 1.5rem 1rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.chat-widget-messages {
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
    grid-template-columns: none;
}

.chat-widget-messages .profile-messages-list,
.chat-widget-messages .profile-messages-chat {
    border: none;
    border-radius: 0;
    box-shadow: none;
    max-height: none;
    min-height: 0;
}

.chat-widget-messages .profile-messages-list {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 0.75rem 1rem 1rem;
}

.chat-widget-messages .profile-messages-list .thread-list {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.chat-widget-messages .profile-messages-chat {
    flex: 1;
    display: none;
}

.chat-widget-messages.has-thread .profile-messages-list {
    display: none;
}

.chat-widget-messages.has-thread .profile-messages-chat {
    display: flex;
}

.chat-widget-messages .messages-sidebar-head {
    padding: 0 0.25rem;
}

.chat-widget-messages .chat-back-btn {
    display: inline-flex;
}

.chat-widget-messages .chat-messages {
    max-height: none;
    flex: 1;
}

.chat-widget-messages .chat-panel {
    min-height: 0;
}

button.thread-list-item {
    width: 100%;
    border: none;
    background: none;
    text-align: left;
    font: inherit;
    cursor: pointer;
}

a.thread-list-item {
    width: 100%;
}

body.chat-drawer-open {
    overflow: hidden;
}

@media (max-width: 600px) {
    .chat-drawer {
        right: 0;
        left: 0;
        bottom: 0;
        width: 100%;
        max-height: min(88vh, 100dvh);
        border-radius: 1rem 1rem 0 0;
        border-left: none;
        border-right: none;
        border-bottom: none;
    }

    .chat-widget {
        right: max(0.75rem, env(safe-area-inset-right, 0px));
        bottom: max(0.75rem, env(safe-area-inset-bottom, 0px));
    }

    .chat-fab {
        width: 3.25rem;
        height: 3.25rem;
    }
}
