:root {
    --primary: #c43b35;
    --primary-hover: #b8322e;
    --secondary: #258354;
    --dark: #17212b;
    --gray: #596575;
    --body-bg: #f8fafc;
    --white: #ffffff;
    --light: #f1f5f8;
    --border-color: #e2e8ee;
    --shadow: 0 8px 32px rgba(23, 33, 43, 0.08);
    --sidebar-width: 260px;
    --bg-color: var(--body-bg);
    --card-bg: var(--white);
    --text-main: var(--dark);
    --text-muted: var(--gray);
    --bg: var(--body-bg);
    --surface: var(--white);
    --ink: var(--dark);
    --muted: var(--gray);
    --line: var(--border-color);
    --brand: var(--primary-hover);
    --brand-dark: #9f2d29;
    --soft: #fcebea;
    --warm: #f1f5f8;
    --green: var(--secondary);
    --green-line: #d5e8dc;
    --danger: #b8322e;
    --space-0: 0;
    --space-25: 2px;
    --space-50: 4px;
    --space-75: 8px;
    --space-100: 12px;
    --space-200: 16px;
    --space-300: 24px;
    --space-400: 32px;
    --space-500: 40px;
    --space-600: 48px;
    --space-700: 64px;
    --space-800: 80px;
    --space-900: 96px;
    --font-size-12: 12px;
    --font-size-14: 14px;
    --font-size-16: 16px;
    --font-size-20: 20px;
    --font-size-24: 24px;
    --font-size-28: 28px;
    --font-size-32: 32px;
    --font-size-40: 40px;
    --font-size-48: 48px;
    --font-size-64: 64px;
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-2xl: 24px;
    --radius-full: 999px;
    --motion-curve: cubic-bezier(0.22, 1, 0.36, 1);
    --focus-ring: #236bc2;
    font-size: 16px;
}

body {
    color: var(--dark);
    background-color: var(--body-bg);
    font-family: "Poppins", sans-serif;
    line-height: 1.5;
}

body button,
body input,
body textarea,
body select,
body h1,
body h2,
body h3,
body h4,
body h5,
body h6 {
    font-family: "Poppins", sans-serif !important;
}

body h1,
body h2,
body h3,
body h4,
body h5,
body h6 {
    font-weight: 600;
    text-wrap: balance;
}

body p,
body li,
body label,
body summary {
    text-wrap: pretty;
}

body small {
    font-size: 12px !important;
    line-height: 16px !important;
}

body[data-page] .metric strong {
    font-family: "Poppins", sans-serif !important;
    font-weight: 600;
}

body[data-page] .post-meta,
body[data-page] .type-label,
body[data-page] .tag,
body[data-page] .post-actions button,
body[data-page] .nav-caption {
    font-size: 12px !important;
    line-height: 16px !important;
}

body[data-page] .eyebrow {
    font-size: 12px !important;
    letter-spacing: 0.04em;
    line-height: 16px !important;
}

body[data-page] .page-heading p,
body[data-page] .hero p,
body[data-page] .post-content,
body[data-page] .profile-bio,
body[data-page] .aside p,
body[data-page] .settings-row p,
body[data-page] .shared-post p,
body[data-page] .empty p,
body[data-page] .quiet,
body[data-page] .comment-text {
    font-size: 14px;
    line-height: 20px;
}

body[data-page] .profile-facts,
body[data-page] .feed-tools,
body[data-page] .metric span,
body[data-page] .comment-actions button {
    font-size: 12px;
    line-height: 16px;
}

body[data-page] .tabs button {
    font-size: 14px;
    line-height: 20px;
}

body[data-page] .button {
    font-size: 14px;
    line-height: 20px;
}

body[data-page] .field input,
body[data-page] .field textarea,
body[data-page] .field select,
body[data-page] .search-input,
body[data-page] .chat-input textarea {
    font-size: 16px;
    line-height: 24px;
}

body[data-page] .bubble {
    font-size: 14px;
    line-height: 20px;
}

body[data-page] .skeleton {
    background: var(--light);
    animation: none;
}

body[data-page] .profile-cover {
    background-image: none;
}

/* Unified layout, sidebar, cards, and spacing */
body .sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--white);
    position: fixed;
    top: 0;
    left: 0;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 32px 24px;
    transition: transform 500ms var(--motion-curve);
    z-index: 100;
}

body .sidebar .brand {
    font-family: "Poppins", sans-serif;
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 32px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

body .sidebar .brand svg,
.brand-mark {
    width: 30px;
    height: 30px;
    margin-right: 0 !important;
    flex-shrink: 0;
    display: block;
}

.brand-wordmark {
    display: inline-flex;
    align-items: baseline;
    font-family: "Poppins", sans-serif;
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.02em;
}

.brand-med {
    color: var(--primary, #c43b35);
}

.brand-e {
    color: var(--dark, #17212b);
}

.brand-life {
    color: var(--secondary, #258354);
}

body .sidebar .nav-items {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

body .sidebar .nav-item {
    padding: 8px 12px;
    border-radius: 8px;
    color: var(--gray);
    font-size: 14px;
    line-height: 20px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 300ms var(--motion-curve), color 300ms var(--motion-curve);
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: none !important;
}

body .sidebar .nav-item:hover:not(.active) {
    background: var(--light);
    color: var(--dark);
}

body .sidebar .nav-item.active {
    background: var(--primary);
    color: #ffffff;
    font-weight: 600;
    box-shadow: none !important;
}

body .sidebar .user-mini-profile {
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

body .sidebar .mini-avatar {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    object-fit: cover;
    border: 1px solid var(--border-color);
}

/* Unified flat card borders (no single-sided borders or dashed borders) */
body .action-card {
    background: var(--white);
    padding: 24px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: background-color 300ms var(--motion-curve), border-color 300ms var(--motion-curve), transform 500ms var(--motion-curve);
}

body .action-card:hover {
    border-color: var(--dark);
    background: var(--light);
}

body .action-card i {
    font-size: 24px;
    color: var(--dark);
    margin-bottom: 12px;
}

body .notification-card {
    border: 1px solid var(--border-color) !important;
    border-left: 1px solid var(--border-color) !important;
    border-radius: 12px;
    box-shadow: none;
}

body .doc-category-title {
    border-left: 0 !important;
    padding-left: 0 !important;
    font-size: 16px;
    line-height: 24px;
    font-weight: 600;
    margin: 24px 0 12px 0;
}

body .doc-card,
body .doctor-card,
body .list-item {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: none;
}

body .doc-icon {
    background: var(--light);
    color: var(--dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

body .btn-view {
    background: var(--light);
    color: var(--dark);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 20px;
    font-weight: 500;
}

body .btn-view:hover {
    background: var(--border-color);
}

em,
i {
    font-style: normal;
}

input:not([type="checkbox"]):not([type="radio"]),
textarea,
select {
    border-radius: var(--radius-md);
}

:focus-visible {
    outline: 3px solid var(--focus-ring) !important;
    outline-offset: 3px;
}

button:disabled {
    cursor: wait;
    opacity: 0.6;
}

button:active:not(:disabled),
[role="button"]:active,
.action-card:active,
.tab-item:active,
.nav-item:active {
    transform: scale(0.98);
}

[hidden] {
    display: none !important;
}

.site-skip-link {
    position: fixed;
    top: var(--space-200);
    left: var(--space-200);
    z-index: 10000;
    padding: var(--space-100) var(--space-200);
    border-radius: var(--radius-md);
    color: var(--white);
    background: var(--dark);
    transform: translateY(-160%);
    transition: transform 500ms var(--motion-curve);
}

.site-skip-link:focus {
    transform: translateY(0);
}

.site-not-found {
    display: grid;
    min-height: 100vh;
    align-content: center;
    justify-items: center;
    gap: var(--space-300);
    padding: var(--space-700) var(--space-200);
    text-align: center;
}

.site-not-found h1 {
    max-width: 680px;
    font-size: 48px;
    line-height: 48px;
}

.site-not-found p {
    max-width: 560px;
    color: var(--gray);
}

.site-not-found .button {
    min-height: 48px;
    padding: var(--space-75) var(--space-200);
    border: 0;
    border-radius: var(--radius-md);
    color: var(--white);
    background: var(--primary);
    font-size: 16px;
    font-weight: 600;
    line-height: 24px;
}

.site-not-found .button:hover {
    background: var(--primary-hover);
}

body.dark-mode {
    --white: #181818;
    --dark: #ededed;
    --light: #1f1f1f;
    --gray: #b3b3b3;
    --body-bg: #000000;
    --border-color: #313131;
    --shadow: none;
    --bg-color: var(--body-bg);
    --card-bg: var(--white);
    --text-main: var(--dark);
    --text-muted: var(--gray);
    --bg: #000000;
    --surface: #181818;
    --ink: #ededed;
    --muted: #b3b3b3;
    --line: #313131;
    --soft: #272727;
    --warm: #1f1f1f;
    --green: #8bd1a9;
    --green-line: #313131;
    --danger: #fca5a5;
    --focus-ring: #60a5fa;
    color-scheme: dark;
    color: var(--dark);
    background-color: var(--body-bg);
}

@media (max-width: 768px) {
    body .sidebar {
        transform: translateX(-100%);
    }

    body .sidebar.active {
        transform: translateX(0);
    }
}

@media (max-width: 600px) {
    .site-not-found h1 {
        font-size: 36px;
        line-height: 40px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto !important;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}

.ml-photo-backdrop {
    position: fixed;
    inset: 0;
    z-index: 950;
    background: rgba(15, 23, 42, 0.56);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.ml-photo-dialog {
    width: 100%;
    max-width: 440px;
    background: var(--surface, #ffffff);
    color: var(--ink, #17212b);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 16px;
    padding: 20px;
    font-family: "Poppins", sans-serif;
}

.ml-photo-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.ml-photo-title {
    margin: 0;
    font-size: 18px;
    line-height: 24px;
    font-weight: 600;
    color: var(--ink, #17212b);
}

.ml-photo-close {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    border: 1px solid var(--border-color, #e2e8f0);
    background: transparent;
    color: var(--muted, #64748b);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 220ms var(--motion-curve), color 220ms var(--motion-curve);
}

.ml-photo-close:hover {
    background: var(--soft, #f1f5f9);
    color: var(--ink, #17212b);
}

.ml-photo-error {
    margin: 0 0 12px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #fecaca;
    background: #fef2f2;
    color: #991b1b;
    font-size: 13px;
    line-height: 18px;
}

body.dark-mode .ml-photo-error {
    border-color: #7f1d1d;
    background: #2b1313;
    color: #fecaca;
}

.ml-photo-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.ml-photo-file-input,
.ml-photo-capture-input {
    display: none;
}

.ml-photo-section-label {
    margin: 0 0 -4px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--muted, #64748b);
}

.ml-photo-presets {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.ml-photo-preset {
    position: relative;
    padding: 0;
    border: 2px solid var(--border-color, #e2e8f0);
    border-radius: 10px;
    overflow: hidden;
    background: var(--surface, #ffffff);
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: border-color 200ms var(--motion-curve), box-shadow 200ms var(--motion-curve);
}

.ml-photo-preset:hover {
    border-color: var(--primary, #c43b35);
}

.ml-photo-preset.is-selected {
    border-color: var(--primary, #c43b35);
    box-shadow: 0 0 0 2px rgba(196, 59, 53, 0.22);
}

.ml-photo-preset:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.ml-photo-preset-img {
    display: block;
    width: 100%;
    height: 52px;
    object-fit: cover;
}

.ml-photo-preset-label {
    display: block;
    padding: 5px 8px;
    font-size: 11px;
    font-weight: 500;
    line-height: 15px;
    color: var(--ink, #17212b);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ml-photo-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ml-photo-option {
    width: 100%;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--border-color, #e2e8f0);
    background: var(--surface, #ffffff);
    color: var(--ink, #17212b);
    cursor: pointer;
    font-family: inherit;
    transition: border-color 220ms var(--motion-curve), background-color 220ms var(--motion-curve);
}

.ml-photo-option:hover {
    background: var(--soft, #f1f5f9);
    border-color: var(--primary, #c43b35);
}

.ml-photo-option:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.ml-photo-option-icon {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    background: var(--soft, #f1f5f9);
    color: var(--primary, #c43b35);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.ml-photo-health-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ml-photo-option-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ml-photo-option-copy strong {
    font-size: 14px;
    line-height: 20px;
    font-weight: 600;
}

.ml-photo-option-copy span {
    font-size: 12px;
    line-height: 17px;
    color: var(--muted, #64748b);
}

.ml-photo-hint {
    margin: 0;
    font-size: 12px;
    line-height: 18px;
    color: var(--muted, #64748b);
    text-align: center;
}

.ml-photo-camera-stage {
    width: 100%;
    aspect-ratio: 1 / 1;
    max-height: 300px;
    border-radius: 12px;
    overflow: hidden;
    background: #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ml-photo-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1);
}

.ml-cropper-stage {
    position: relative;
    width: 280px;
    height: 280px;
    margin: 0 auto;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--border-color, #e2e8f0);
    background: #0f172a;
    touch-action: none;
    user-select: none;
}

.ml-cropper-stage--cover {
    width: 280px;
    height: 132px;
}

.ml-cropper-canvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: grab;
}

.ml-cropper-canvas:active {
    cursor: grabbing;
}

.ml-cropper-ring {
    position: absolute;
    left: 18px;
    top: 18px;
    width: 244px;
    height: 244px;
    border-radius: 999px;
    border: 2px solid #ffffff;
    box-shadow: 0 0 0 999px rgba(15, 23, 42, 0.56);
    pointer-events: none;
}

.ml-cropper-ring--rect {
    left: 10px;
    top: 28.5px;
    width: 260px;
    height: 75px;
    border-radius: 10px;
}

.ml-cropper-zoom-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ml-cropper-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--muted, #64748b);
}

.ml-cropper-range {
    flex: 1;
    accent-color: var(--primary, #c43b35);
    cursor: pointer;
}

.ml-cropper-step {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 1px solid var(--border-color, #e2e8f0);
    background: var(--surface, #ffffff);
    color: var(--ink, #17212b);
    font-weight: 600;
    cursor: pointer;
}

.ml-cropper-tools {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.ml-photo-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 6px;
    border-top: 1px solid var(--border-color, #e2e8f0);
}

.ml-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid var(--border-color, #e2e8f0);
    background: var(--surface, #ffffff);
    color: var(--ink, #17212b);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 220ms var(--motion-curve), border-color 220ms var(--motion-curve);
}

.ml-btn:hover:not(:disabled) {
    background: var(--soft, #f1f5f9);
}

.ml-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.ml-btn-primary {
    background: var(--primary, #c43b35);
    border-color: var(--primary, #c43b35);
    color: #ffffff;
}

.ml-btn-primary:hover:not(:disabled) {
    background: var(--primary-hover, #9f2d28);
    border-color: var(--primary-hover, #9f2d28);
}

/* Unified Community-style verification badges across the platform */
.verified,
.verified-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    flex-shrink: 0;
    margin-left: 5px;
    line-height: 1;
}

.verified .icon,
.verified-badge svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
    display: block;
}

.verified--doctor,
.verified-badge.badge-pro {
    color: var(--primary, #c43b35);
}

.verified--patient,
.verified-badge.badge-patient {
    color: var(--secondary, #258354);
}

.verified--pharmacy,
.verified-badge.badge-pharmacy {
    color: #dc2626;
}

body.dark-mode .verified--pharmacy,
body.dark-mode .verified-badge.badge-pharmacy {
    color: #f87171;
}

.verified--pharmacy .pharmacy-badge-ring,
.verified-badge.badge-pharmacy .pharmacy-badge-ring {
    fill: #fee2e2;
    stroke: currentColor;
    stroke-width: 1.75;
}

.verified--pharmacy .pharmacy-badge-cross,
.verified-badge.badge-pharmacy .pharmacy-badge-cross {
    fill: currentColor;
    stroke: none;
}

body.dark-mode .verified--pharmacy .pharmacy-badge-ring,
body.dark-mode .verified-badge.badge-pharmacy .pharmacy-badge-ring {
    fill: rgba(220, 38, 38, 0.2);
}
