/* =========================================================================
   CENNA modern layout (Phase 1: shared layout, navigation, home, add-post modal)
   Scoped to body.cn-modern so pages that still use the classic Olympus layout
   are not affected.
   ========================================================================= */

.cn-modern {
    /* Palette restored from the original CENNA Baby Space Adobe XD prototype.
       Brand colours sampled from the prototype logo: turquoise #08B7CA,
       royal blue #044BAD, navy #0E3B78, pale-cyan canvas #E9F3F4. */
    --cn-primary: #13bccd;          /* CENNA turquoise (brand / primary actions) */
    --cn-primary-strong: #0fb0c2;   /* buttons / primary CTAs */
    --cn-primary-dark: #0a94a4;     /* hover */
    --cn-teal: #13c7da;             /* bright turquoise accents */
    --cn-teal-strong: #0a94a4;
    --cn-navy: #17386a;             /* headings, section titles, brand text */
    --cn-navy-strong: #0e2a52;
    --cn-royal: #0a56bd;            /* links / "View All" / royal-blue accents */
    --cn-bg: #f4f7f9;               /* clean neutral app canvas (CENNA light) */
    --cn-surface: #ffffff;
    --cn-soft: #e1f5f8;             /* turquoise tint (active nav / soft buttons) */
    --cn-soft-teal: #e1f5f8;
    --cn-border: #e2ebf0;
    --cn-text: #1d2939;
    --cn-text-2: #475467;
    --cn-muted: #7a8699;
    --cn-orange: #ff8a3d;
    --cn-purple: #7c5ac2;
    --cn-radius: 14px;
    --cn-radius-sm: 10px;
    --cn-shadow: 0 1px 2px rgba(16, 42, 77, .04), 0 6px 20px rgba(16, 42, 77, .06);
    --cn-shadow-lg: 0 12px 40px rgba(16, 42, 77, .18);
    --cn-sidebar-w: 264px;
    --cn-topbar-h: 72px;

    background: var(--cn-bg);
    color: var(--cn-text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.cn-modern [hidden] { display: none !important; }
.cn-modern a { color: var(--cn-royal); }
.cn-modern a:hover { color: var(--cn-navy); text-decoration: none; }
.cn-modern :focus-visible { outline: 3px solid rgba(19, 188, 205, .5); outline-offset: 2px; }
.cn-modern button { font-family: inherit; }

.cn-icon { width: 20px; height: 20px; flex: 0 0 auto; vertical-align: middle; }

.cn-avatar {
    width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: 0 0 auto;
    background: var(--cn-soft); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--cn-border);
}
.cn-avatar-square { border-radius: 12px; }

/* ---------------------------------------------------------------- layout */
.cn-app { min-height: 100vh; }
.cn-main { margin-left: var(--cn-sidebar-w); min-width: 0; }
.cn-content {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 28px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 32px 56px;
    align-items: start;
}
.cn-feed-col, .cn-right-col { min-width: 0; }
.cn-right-col { position: sticky; top: calc(var(--cn-topbar-h) + 16px); }

.cn-card {
    background: var(--cn-surface);
    border: 1px solid var(--cn-border);
    border-radius: var(--cn-radius);
    box-shadow: var(--cn-shadow);
}

/* ---------------------------------------------------------------- sidebar */
.cn-sidebar {
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 40;
    width: var(--cn-sidebar-w);
    display: flex; flex-direction: column;
    background: var(--cn-surface);
    border-right: 1px solid var(--cn-border);
    padding: 20px 16px;
    overflow-y: auto;
}
.cn-modern .cn-brand, .cn-modern .cn-topbar-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px; color: var(--cn-text); }
.cn-modern .cn-brand:hover, .cn-modern .cn-topbar-brand:hover { color: var(--cn-text); }
.cn-brand-logo {
    width: 40px; height: 40px; border-radius: 12px; flex: 0 0 auto;
    display: inline-flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--cn-primary) 0%, var(--cn-teal) 100%);
    box-shadow: 0 4px 12px rgba(56, 169, 255, .35);
}
.cn-brand-logo img { width: 22px; height: auto; }
.cn-brand-name { font-size: 20px; font-weight: 700; letter-spacing: .04em; }

.cn-modern .cn-sidebar-user {
    display: flex; align-items: center; gap: 12px;
    margin: 20px 0 16px; padding: 12px;
    border-radius: var(--cn-radius-sm);
    background: var(--cn-bg); color: var(--cn-text);
}
.cn-modern .cn-sidebar-user:hover { background: var(--cn-soft); color: var(--cn-text); }
.cn-sidebar-user-text { display: flex; flex-direction: column; min-width: 0; }
.cn-sidebar-user-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cn-sidebar-user-sub { font-size: 13px; color: var(--cn-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.cn-nav { display: flex; flex-direction: column; gap: 2px; }
.cn-nav-bottom { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--cn-border); }
.cn-modern .cn-nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; border-radius: 10px;
    color: var(--cn-text-2); font-weight: 500; font-size: 15px;
}
.cn-modern .cn-nav-item:hover { background: var(--cn-bg); color: var(--cn-text); }
.cn-modern .cn-nav-item.is-active { background: var(--cn-soft); color: var(--cn-primary-dark); font-weight: 600; }
.cn-nav-item.is-active .cn-icon { color: var(--cn-primary-strong); }
.cn-nav-item.is-disabled { color: #a3adbb; cursor: default; }
.cn-soon {
    margin-left: auto; font-size: 11px; font-weight: 600; letter-spacing: .02em;
    padding: 2px 8px; border-radius: 999px; background: var(--cn-bg); color: var(--cn-muted);
}

/* ---------------------------------------------------------------- top bar */
.cn-topbar {
    position: sticky; top: 0; z-index: 30;
    height: var(--cn-topbar-h);
    display: flex; align-items: center; gap: 16px;
    padding: 0 32px;
    background: rgba(243, 247, 251, .88);
    -webkit-backdrop-filter: saturate(160%) blur(10px);
    backdrop-filter: saturate(160%) blur(10px);
    border-bottom: 1px solid var(--cn-border);
}
.cn-modern .cn-topbar-brand { display: none; }
.cn-search { position: relative; flex: 1 1 auto; max-width: 560px; margin: 0; }
.cn-search .cn-icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--cn-muted); pointer-events: none; }
.cn-modern .cn-search input {
    width: 100%; height: 46px; margin: 0;
    padding: 0 16px 0 46px;
    border: 1px solid var(--cn-border); border-radius: 999px;
    background: var(--cn-surface); color: var(--cn-text); font-size: 15px;
    box-shadow: 0 1px 2px rgba(16, 42, 77, .04);
}
.cn-modern .cn-search input:focus { outline: none; border-color: var(--cn-primary); box-shadow: 0 0 0 4px rgba(56, 169, 255, .18); }
.cn-topbar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.cn-icon-btn {
    position: relative;
    width: 44px; height: 44px; border-radius: 12px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 0; background: transparent; color: var(--cn-text-2); cursor: pointer;
}
.cn-icon-btn:hover { background: var(--cn-surface); color: var(--cn-primary-strong); box-shadow: var(--cn-shadow); }
.cn-mobile-search-btn { display: none; }
.cn-avatar-btn { border: 0; background: none; padding: 2px; margin-left: 4px; border-radius: 50%; cursor: pointer; }
.cn-badge {
    position: absolute; top: 6px; right: 5px;
    min-width: 18px; height: 18px; padding: 0 5px;
    border-radius: 999px; border: 2px solid var(--cn-bg);
    background: var(--cn-primary-strong); color: #fff;
    font-size: 11px; font-weight: 700; line-height: 14px; text-align: center;
}
.cn-badge-orange { background: var(--cn-orange); }
.cn-badge-purple { background: var(--cn-purple); }

/* buttons */
.cn-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 44px; padding: 0 18px; margin: 0;
    border: 1px solid transparent; border-radius: 12px;
    font-size: 15px; font-weight: 600; line-height: 1; cursor: pointer; white-space: nowrap;
    transition: background-color .15s, box-shadow .15s, color .15s;
}
.cn-btn .cn-icon { width: 18px; height: 18px; }
.cn-modern .cn-btn-primary { background: var(--cn-primary-strong); color: #fff; box-shadow: 0 6px 16px rgba(15, 176, 194, .32); }
.cn-modern .cn-btn-primary:hover { background: var(--cn-primary-dark); color: #fff; }
.cn-modern .cn-btn-primary:disabled { opacity: .6; cursor: progress; }
.cn-modern .cn-btn-soft { background: var(--cn-soft); color: var(--cn-primary-dark); }
.cn-modern .cn-btn-soft:hover { background: #d9edff; color: var(--cn-primary-dark); }
.cn-modern .cn-btn-ghost { background: transparent; color: var(--cn-text-2); border-color: var(--cn-border); }
.cn-modern .cn-btn-ghost:hover { background: var(--cn-bg); color: var(--cn-text); }
.cn-btn-sm { height: 36px; padding: 0 14px; font-size: 14px; border-radius: 10px; }
.cn-btn-block { width: 100%; margin-top: 12px; }

/* dropdowns */
.cn-dropdown { position: relative; }
.cn-dropdown-panel {
    position: absolute; right: 0; top: calc(100% + 8px); z-index: 60;
    width: 360px; max-width: calc(100vw - 24px);
    background: var(--cn-surface); border: 1px solid var(--cn-border);
    border-radius: var(--cn-radius); box-shadow: var(--cn-shadow-lg);
    opacity: 0; visibility: hidden; transform: translateY(-4px);
    transition: opacity .15s, transform .15s, visibility .15s;
}
.cn-dropdown.is-open .cn-dropdown-panel { opacity: 1; visibility: visible; transform: none; }
.cn-dropdown-head {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 14px 16px; border-bottom: 1px solid var(--cn-border); font-size: 14px;
}
.cn-dropdown-head a { font-size: 13px; font-weight: 500; }
.cn-modern .cn-dropdown-list { max-height: 380px; overflow-y: auto; margin: 0; padding: 4px 0; list-style: none; }
.cn-dropdown-foot { display: block; padding: 12px 16px; text-align: center; font-size: 14px; font-weight: 600; border-top: 1px solid var(--cn-border); }
.cn-dropdown-menu { width: 260px; padding-bottom: 6px; }
.cn-modern .cn-dropdown-menu > a { display: flex; align-items: center; gap: 12px; padding: 10px 16px; color: var(--cn-text-2); font-size: 14px; font-weight: 500; }
.cn-modern .cn-dropdown-menu > a:hover { background: var(--cn-bg); color: var(--cn-text); }
.cn-dropdown-menu .cn-icon { width: 18px; height: 18px; color: var(--cn-muted); }

/* lists filled by existing AJAX (notifications, messages, requests, suggestions) */
.cn-modern .cn-dropdown-list:empty::before,
.cn-modern .cn-js-list:empty::before {
    content: attr(data-empty); display: block; padding: 12px 16px; color: var(--cn-muted); font-size: 14px;
}
.cn-modern .cn-js-list:empty::before { padding: 4px 0 8px; }
.cn-modern .cn-dropdown-list > li,
.cn-modern .cn-js-list > li {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 16px; margin: 0; border: 0; background: transparent;
}
.cn-modern .cn-js-list > li { padding: 8px 0; }
.cn-modern .cn-dropdown-list > li:hover { background: var(--cn-bg); }
.cn-modern .cn-dropdown-list > li.un-read,
.cn-modern .cn-dropdown-list > li.message-unread { background: var(--cn-soft); }
.cn-modern .cn-dropdown-list .author-thumb,
.cn-modern .cn-js-list .author-thumb { flex: 0 0 auto; margin: 0; }
.cn-modern .cn-dropdown-list .author-thumb img,
.cn-modern .cn-js-list .author-thumb img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.cn-modern .cn-dropdown-list .notification-event,
.cn-modern .cn-js-list .notification-event { flex: 1 1 auto; min-width: 0; padding: 0; font-size: 14px; color: var(--cn-text-2); }
.cn-modern .cn-js-list .notification-friend,
.cn-modern .cn-dropdown-list .notification-friend,
.cn-modern .cn-dropdown-list .h6 { display: block; color: var(--cn-text); font-size: 14px; font-weight: 600; margin: 0; }
.cn-modern .cn-js-list .chat-message-item,
.cn-modern .cn-dropdown-list .chat-message-item { display: block; color: var(--cn-muted); font-size: 13px; }
.cn-modern .cn-js-list .notification-icon,
.cn-modern .cn-dropdown-list .notification-icon { position: static; flex: 0 0 auto; margin: 0; }
.cn-modern .cn-js-list .accept-request {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; border-radius: 10px; padding: 0;
    background: var(--cn-soft); color: var(--cn-primary-strong); fill: var(--cn-primary-strong);
}
.cn-modern .cn-js-list .accept-request:hover { background: var(--cn-primary-strong); fill: #fff; color: #fff; }
.cn-modern .cn-js-list .accept-request svg { width: 18px; height: 18px; margin: 0; }
.cn-modern .cn-js-list .icon-add { display: inline-flex; background: none; padding: 0; margin: 0; }

/* ---------------------------------------------------------------- home: dashboard */
.cn-welcome {
    padding: 28px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #eaf6ff 0%, #f2fbff 45%, #e5fbf6 100%);
    border-color: #d7e9fa;
}
.cn-welcome-date { margin: 0 0 4px; color: var(--cn-primary-dark); font-size: 13px; font-weight: 600; text-transform: capitalize; }
.cn-modern .cn-welcome h1 { margin: 0; color: var(--cn-text); font-size: 28px; font-weight: 700; line-height: 1.25; letter-spacing: -.01em; }
.cn-welcome-sub { margin: 6px 0 0; color: var(--cn-text-2); }

.cn-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 22px; }
.cn-modern .cn-stat {
    display: flex; flex-direction: column; gap: 2px;
    padding: 16px; border-radius: 14px;
    background: rgba(255, 255, 255, .9); border: 1px solid rgba(228, 235, 243, .9);
    color: var(--cn-text);
    transition: transform .15s, box-shadow .15s;
}
.cn-modern a.cn-stat:hover { color: var(--cn-text); transform: translateY(-2px); box-shadow: var(--cn-shadow); }
.cn-stat-icon {
    width: 40px; height: 40px; border-radius: 12px; margin-bottom: 10px;
    display: inline-flex; align-items: center; justify-content: center;
}
.cn-stat-blue .cn-stat-icon { background: var(--cn-soft); color: var(--cn-primary-strong); }
.cn-stat-teal .cn-stat-icon { background: var(--cn-soft-teal); color: var(--cn-teal-strong); }
.cn-stat-soft .cn-stat-icon { background: #fff4e8; color: var(--cn-orange); }
.cn-stat-value { font-size: 26px; font-weight: 700; line-height: 1.1; }
.cn-stat-soon { font-size: 16px; color: var(--cn-muted); line-height: 1.6; }
.cn-stat-label { color: var(--cn-text-2); font-size: 14px; }
.cn-stat-label b { color: var(--cn-teal-strong); font-weight: 600; }

.cn-composer { display: flex; align-items: center; gap: 12px; padding: 14px 16px; margin-bottom: 28px; }
.cn-composer .cn-avatar { width: 44px; height: 44px; }
.cn-composer-input {
    flex: 1 1 auto; min-width: 0; height: 48px; padding: 0 18px;
    border: 1px solid var(--cn-border); border-radius: 999px; background: var(--cn-bg);
    color: var(--cn-muted); font-size: 15px; text-align: left; cursor: pointer;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cn-composer-input:hover { background: var(--cn-soft); border-color: #cfe5fa; }
.cn-composer-photo { color: var(--cn-teal-strong); }

.cn-section-head { display: flex; align-items: center; justify-content: space-between; margin: 0 4px 12px; }
.cn-modern .cn-section-head h2 { margin: 0; font-size: 17px; font-weight: 700; color: var(--cn-text); }

/* ---------------------------------------------------------------- home: existing posts restyled */
.cn-modern .cn-feed .ui-block {
    background: var(--cn-surface);
    border: 1px solid var(--cn-border);
    border-radius: var(--cn-radius);
    box-shadow: var(--cn-shadow);
    margin-bottom: 20px;
}
.cn-modern .cn-feed .post { padding: 24px; }
.cn-modern .cn-feed .post__author img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.cn-modern .cn-feed .post__author-name { color: var(--cn-text); font-size: 15px; font-weight: 600; }
.cn-modern .cn-feed .post__date, .cn-modern .cn-feed .post__date time { color: var(--cn-muted); font-size: 13px; }
.cn-modern .cn-feed .post-title { color: var(--cn-text); font-size: 18px; font-weight: 700; }
.cn-modern .cn-feed .post p, .cn-modern .cn-feed .post { color: var(--cn-text-2); font-size: 15px; line-height: 1.6; }
.cn-modern .cn-feed .post-thumb img { border-radius: 12px; }
.cn-modern .cn-feed .post-additional-info { border-top: 1px solid var(--cn-border); padding-top: 14px; }
.cn-modern .cn-feed .comments-list { background: #f8fafd; border-top: 1px solid var(--cn-border); border-radius: 0 0 var(--cn-radius) var(--cn-radius); }
.cn-modern .cn-feed .comment-form { background: transparent; border-top: 1px solid var(--cn-border); }
.cn-modern .cn-feed .comment-form .form-control,
.cn-modern .cn-feed .comment-form textarea { border-radius: 12px; background: var(--cn-bg); border-color: var(--cn-border); }
.cn-modern .cn-feed .btn-primary { background-color: var(--cn-primary-strong); border-color: var(--cn-primary-strong); border-radius: 10px; }
.cn-modern .cn-feed .control-block-button .btn-control { box-shadow: var(--cn-shadow); }

.cn-load-more {
    display: block; width: max-content; margin: 8px auto 0; padding: 10px 22px;
    border-radius: 999px; background: var(--cn-surface); border: 1px solid var(--cn-border);
    color: var(--cn-text-2); font-weight: 600; font-size: 14px; box-shadow: var(--cn-shadow);
}
.cn-modern .cn-load-more:hover { color: var(--cn-primary-dark); }
.cn-load-more.loading { opacity: .6; pointer-events: none; }
.cn-load-more.last-page, .cn-load-more.hidden-xs-up { display: none; }

/* ---------------------------------------------------------------- right sidebar cards */
.cn-side-card { padding: 18px 18px 14px; margin-bottom: 20px; }
.cn-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.cn-modern .cn-card-head h2 { margin: 0; font-size: 16px; font-weight: 700; color: var(--cn-text); }
.cn-card-subhead { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--cn-border); }
.cn-modern .cn-card-subhead h2 { font-size: 14px; color: var(--cn-text-2); }
.cn-link { font-size: 13px; font-weight: 600; }
.cn-modern .cn-list { list-style: none; margin: 0; padding: 0; }
.cn-modern .cn-list-item { display: flex; align-items: center; gap: 12px; padding: 8px; margin: 0 -8px; border-radius: 12px; color: var(--cn-text); }
.cn-modern .cn-list-item:hover { background: var(--cn-bg); color: var(--cn-text); }
.cn-list-text { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.cn-list-text strong { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cn-list-text span { font-size: 13px; color: var(--cn-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cn-list-chevron { width: 16px; height: 16px; color: #b3bdca; }
.cn-date-chip {
    flex: 0 0 auto; width: 46px; height: 46px; border-radius: 12px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: var(--cn-soft); color: var(--cn-primary-dark);
    font-size: 11px; font-weight: 600; text-transform: uppercase; line-height: 1.1;
}
.cn-date-chip b { font-size: 17px; }
.cn-date-chip.is-due { background: var(--cn-soft-teal); color: var(--cn-teal-strong); }

.cn-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 14px 8px 8px; color: var(--cn-muted); }
.cn-empty > .cn-icon { width: 28px; height: 28px; color: #b3c7dc; }
.cn-empty p { margin: 0; font-size: 14px; }
.cn-feed-empty { padding: 32px 24px; margin-bottom: 20px; }

/* ---------------------------------------------------------------- modal + sheet */
.cn-modal { position: fixed; inset: 0; z-index: 1050; display: flex; align-items: center; justify-content: center; padding: 16px; }
.cn-modal-backdrop { position: absolute; inset: 0; background: rgba(16, 32, 56, .45); opacity: 0; transition: opacity .18s; }
.cn-modal-dialog {
    position: relative; width: 100%; max-width: 580px; max-height: calc(100vh - 32px); overflow-y: auto;
    background: var(--cn-surface); border-radius: 20px; box-shadow: var(--cn-shadow-lg);
    opacity: 0; transform: translateY(12px) scale(.98); transition: opacity .18s, transform .18s;
}
.cn-modal.is-open .cn-modal-backdrop { opacity: 1; }
.cn-modal.is-open .cn-modal-dialog { opacity: 1; transform: none; }
body.cn-modal-open { overflow: hidden; }
.cn-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 12px 24px; border-bottom: 1px solid var(--cn-border); }
.cn-modern .cn-modal-head h2 { margin: 0; font-size: 18px; font-weight: 700; color: var(--cn-text); }
.cn-modal-body { padding: 20px 24px 8px; }
.cn-modal-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 24px 20px; }

.cn-composer-author { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.cn-composer-author .cn-avatar { width: 46px; height: 46px; }
.cn-composer-author strong { display: block; font-size: 15px; }
.cn-privacy {
    display: inline-flex; align-items: center; gap: 4px; margin: 2px 0 0;
    padding: 2px 8px 2px 10px; border-radius: 999px; background: var(--cn-bg); color: var(--cn-text-2);
}
.cn-privacy .cn-icon { width: 14px; height: 14px; }
.cn-modern .cn-privacy select {
    border: 0; background: transparent; color: var(--cn-text-2); font-size: 13px; font-weight: 500;
    height: auto; padding: 2px 0; margin: 0; cursor: pointer; width: auto;
}
.cn-modern .cn-input, .cn-modern .cn-textarea {
    display: block; width: 100%; margin: 0 0 12px;
    border: 1px solid var(--cn-border); border-radius: 12px; background: var(--cn-surface);
    color: var(--cn-text); font-size: 15px; font-family: inherit; box-shadow: none;
}
.cn-modern .cn-input { height: 46px; padding: 0 14px; }
.cn-modern .cn-textarea { min-height: 140px; padding: 12px 14px; resize: vertical; line-height: 1.5; }
.cn-modern .cn-input:focus, .cn-modern .cn-textarea:focus { outline: none; border-color: var(--cn-primary); box-shadow: 0 0 0 4px rgba(56, 169, 255, .15); }
.cn-modern .cn-input::placeholder, .cn-modern .cn-textarea::placeholder { color: #9aa5b5; }
.cn-photo-preview { position: relative; margin: 4px 0 12px; border-radius: 12px; overflow: hidden; border: 1px solid var(--cn-border); background: var(--cn-bg); }
.cn-photo-preview img { display: block; max-width: 100%; max-height: 280px; margin: 0 auto; }
.cn-photo-remove { position: absolute; top: 8px; right: 8px; width: 36px; height: 36px; background: rgba(255, 255, 255, .92); }
.cn-progress { height: 6px; border-radius: 999px; background: var(--cn-bg); overflow: hidden; margin-bottom: 12px; }
.cn-progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--cn-primary), var(--cn-teal)); transition: width .2s; }
.cn-form-error { margin-bottom: 12px; padding: 10px 12px; border-radius: 10px; background: #fff1f0; color: #b42318; font-size: 14px; }
.cn-modal-foot .cn-btn-primary { min-width: 120px; }

/* mobile "More" sheet */
.cn-sheet { align-items: flex-end; padding: 0; }
.cn-sheet .cn-modal-dialog { max-width: 640px; border-radius: 24px 24px 0 0; padding: 8px 16px calc(20px + env(safe-area-inset-bottom)); transform: translateY(40px); }
.cn-sheet-handle { width: 40px; height: 4px; border-radius: 999px; background: #d3dbe5; margin: 4px auto 16px; }
.cn-sheet-user { display: flex; align-items: center; gap: 12px; padding: 0 4px 16px; border-bottom: 1px solid var(--cn-border); margin-bottom: 12px; color: inherit; text-decoration: none; }
a.cn-sheet-user:hover, a.cn-sheet-user:focus { color: inherit; text-decoration: none; }
.cn-sheet-user strong { display: block; }
.cn-sheet-user span { font-size: 13px; color: var(--cn-muted); }
.cn-sheet-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.cn-modern .cn-sheet-item {
    position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
    min-height: 84px; padding: 12px 6px; border-radius: 14px; background: var(--cn-bg);
    color: var(--cn-text-2); font-size: 13px; font-weight: 500; text-align: center;
}
.cn-modern .cn-sheet-item:hover { background: var(--cn-soft); color: var(--cn-primary-dark); }
.cn-sheet-item .cn-icon { width: 22px; height: 22px; }
.cn-sheet-item.is-disabled { color: #a3adbb; }
.cn-sheet-item .cn-soon { position: absolute; top: 6px; right: 6px; margin: 0; background: #fff; }

/* bottom navigation (mobile only) */
.cn-bottom-nav { display: none; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1279px) {
    .cn-content { grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; padding: 20px 24px 48px; }
    .cn-topbar { padding: 0 24px; }
}

@media (max-width: 1099px) {
    /* tablet: right sidebar moves below the feed as a two-column card grid */
    .cn-content { grid-template-columns: minmax(0, 1fr); max-width: 760px; }
    .cn-right-col { position: static; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
}

@media (max-width: 991px) {
    .cn-modern { --cn-topbar-h: 60px; }
    .cn-sidebar { display: none; }
    .cn-main { margin-left: 0; }
    .cn-topbar { padding: 0 12px 0 16px; gap: 8px; background: rgba(255, 255, 255, .94); }
    .cn-modern .cn-topbar-brand { display: flex; padding: 0; }
    .cn-topbar-brand .cn-brand-logo { width: 36px; height: 36px; border-radius: 10px; }
    .cn-topbar-brand .cn-brand-name { font-size: 18px; }
    .cn-search { display: none; }
    .cn-add-post-btn { display: none; }
    .cn-mobile-search-btn { display: inline-flex; }
    .cn-icon-btn { width: 40px; height: 40px; }
    .cn-topbar.is-searching .cn-search {
        display: block; position: absolute; left: 0; right: 0; top: 100%;
        max-width: none; padding: 8px 12px 10px; background: #fff; border-bottom: 1px solid var(--cn-border);
    }
    .cn-topbar.is-searching .cn-search .cn-icon { left: 28px; }
    .cn-dropdown { position: static; }
    .cn-dropdown-panel { right: 12px; left: 12px; width: auto; max-width: none; }

    .cn-content { padding: 16px 16px calc(96px + env(safe-area-inset-bottom)); }

    .cn-bottom-nav {
        display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
        height: calc(64px + env(safe-area-inset-bottom)); padding: 0 8px env(safe-area-inset-bottom);
        align-items: center; justify-content: space-around;
        background: rgba(255, 255, 255, .97); border-top: 1px solid var(--cn-border);
        box-shadow: 0 -4px 20px rgba(16, 42, 77, .06);
    }
    .cn-modern .cn-bottom-item {
        flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: 2px;
        padding: 6px 0; border: 0; background: none; cursor: pointer;
        color: var(--cn-muted); font-size: 11px; font-weight: 600;
    }
    .cn-modern .cn-bottom-item:hover, .cn-modern .cn-bottom-item.is-active { color: var(--cn-primary-strong); }
    .cn-bottom-item .cn-icon { width: 22px; height: 22px; }
    .cn-bottom-add {
        flex: 0 0 auto; width: 54px; height: 54px; margin-top: -26px; border: 4px solid var(--cn-bg); border-radius: 18px;
        display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
        background: linear-gradient(135deg, var(--cn-primary) 0%, var(--cn-primary-strong) 100%); color: #fff;
        box-shadow: 0 8px 18px rgba(23, 132, 224, .35);
    }
    .cn-bottom-add .cn-icon { width: 24px; height: 24px; }
}

@media (max-width: 767px) {
    .cn-right-col { grid-template-columns: minmax(0, 1fr); }
    .cn-welcome { padding: 20px; }
    .cn-modern .cn-welcome h1 { font-size: 22px; }
    .cn-stats { gap: 10px; margin-top: 18px; }
    .cn-stat { padding: 12px; }
    .cn-stat-icon { width: 34px; height: 34px; margin-bottom: 6px; }
    .cn-stat-icon .cn-icon { width: 18px; height: 18px; }
    .cn-stat-value { font-size: 22px; }
    .cn-stat-label { font-size: 12px; line-height: 1.3; }
    .cn-modern .cn-feed .post { padding: 16px; }
    .cn-modal { padding: 0; align-items: flex-end; }
    .cn-modal-dialog { max-width: none; max-height: 92vh; border-radius: 20px 20px 0 0; }
    .cn-modal-foot { padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
}

@media (max-width: 380px) {
    .cn-content { padding-left: 12px; padding-right: 12px; }
    .cn-topbar-brand .cn-brand-name { display: none; }
    .cn-stat-label b { display: block; }
}

@media (prefers-reduced-motion: reduce) {
    .cn-modern *, .cn-modern *::before, .cn-modern *::after { transition: none !important; }
}

/* =========================================================================
   Phase 2: child-health area (My Children, child profile, tracking, check-ups)
   ========================================================================= */
.cn-modern .cn-content.cn-content-wide { grid-template-columns: minmax(0, 1fr); max-width: 1200px; display: block; }
.cn-muted { color: var(--cn-muted); }
.cn-ok { color: var(--cn-teal-strong); font-weight: 600; }
.cn-bad { color: #d92d20; font-weight: 600; }

/* page head (My Children) */
.cn-page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 4px 0 20px; }
.cn-modern .cn-page-head h1 { margin: 0; font-size: 26px; font-weight: 700; color: var(--cn-text); letter-spacing: -.01em; }
.cn-page-head p { margin: 4px 0 0; color: var(--cn-text-2); }
.cn-section-head-spaced { margin-top: 32px; }

/* child cards */
.cn-cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.cn-child-card { display: flex; flex-direction: column; gap: 14px; padding: 20px; }
.cn-child-card-top { display: flex; align-items: center; gap: 14px; }
.cn-avatar-lg { width: 64px; height: 64px; }
.cn-child-card-name { flex: 1 1 auto; min-width: 0; }
.cn-modern .cn-child-card-name h3 { margin: 0; font-size: 18px; font-weight: 700; }
.cn-modern .cn-child-card-name h3 a { color: var(--cn-text); }
.cn-modern .cn-child-card-name h3 a:hover { color: var(--cn-primary-dark); }
.cn-child-card-name span { color: var(--cn-muted); font-size: 14px; }
.cn-child-card-facts { margin: 0; display: grid; gap: 10px; padding: 14px; border-radius: 12px; background: var(--cn-bg); }
.cn-child-card-facts dt { font-size: 12px; font-weight: 600; color: var(--cn-muted); text-transform: uppercase; letter-spacing: .03em; }
.cn-child-card-facts dd { margin: 2px 0 0; font-size: 14px; font-weight: 600; color: var(--cn-text); }
.cn-child-card-facts small { font-weight: 400; color: var(--cn-muted); margin-left: 4px; }
.cn-child-card-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: auto; }
.cn-child-card-actions .cn-btn { padding: 0 8px; }
.cn-members { display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--cn-muted); }
.cn-members img { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #fff; margin-right: -10px; object-fit: cover; }
.cn-members span { margin-left: 16px; }
.cn-add-card {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 260px;
    border: 2px dashed #cfe0f1; background: transparent; box-shadow: none; color: var(--cn-text-2); cursor: pointer; font-family: inherit;
}
.cn-add-card:hover { background: var(--cn-soft); border-color: var(--cn-primary); }
.cn-add-card-icon { width: 52px; height: 52px; border-radius: 16px; display: inline-flex; align-items: center; justify-content: center; background: var(--cn-soft); color: var(--cn-primary-strong); }
.cn-add-card strong { font-size: 16px; color: var(--cn-text); }
.cn-add-card span:last-child { font-size: 13px; color: var(--cn-muted); }
.cn-empty-hero { padding: 48px 24px; }
.cn-modern .cn-empty-hero h2 { margin: 4px 0 0; font-size: 20px; color: var(--cn-text); }
.cn-empty-hero > .cn-icon { width: 40px; height: 40px; }
.cn-info-card { margin-top: 28px; padding: 0; overflow: hidden; }
.cn-info-card summary { display: flex; align-items: center; gap: 10px; padding: 16px 20px; cursor: pointer; font-weight: 600; list-style: none; }
.cn-info-card summary::-webkit-details-marker { display: none; }
.cn-info-card summary .cn-icon { color: var(--cn-teal-strong); }
.cn-info-card ul { margin: 0; padding: 0 20px 18px 40px; color: var(--cn-text-2); font-size: 14px; }
.cn-info-card li { margin-bottom: 6px; }

/* chips + statuses */
.cn-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cn-chip {
    display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px; border-radius: 999px;
    background: var(--cn-bg); color: var(--cn-text-2); font-size: 13px; font-weight: 500; white-space: nowrap;
}
.cn-chip .cn-icon { width: 14px; height: 14px; }
.cn-chip-blue { background: var(--cn-soft); color: var(--cn-primary-dark); font-weight: 600; }
.cn-status {
    display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; flex: 0 0 auto;
    font-size: 12px; font-weight: 600; white-space: nowrap; vertical-align: middle;
}
.cn-status-completed { background: #e3fbf3; color: #067a5f; }
.cn-status-due { background: #fff1e6; color: #b54708; }
.cn-status-overdue { background: #fee4e2; color: #b42318; }
.cn-status-upcoming { background: var(--cn-soft); color: var(--cn-primary-dark); }
.cn-date-chip.cn-chip-completed { background: #e3fbf3; color: #067a5f; }
.cn-date-chip.cn-chip-due { background: #fff1e6; color: #b54708; }
.cn-date-chip.cn-chip-overdue { background: #fee4e2; color: #b42318; }

/* child header + tabs */
.cn-child-header { display: flex; align-items: center; gap: 24px; padding: 24px; margin-bottom: 16px; background: linear-gradient(135deg, #eaf6ff 0%, #ffffff 55%, #e9fbf7 100%); }
.cn-child-photo { position: relative; flex: 0 0 auto; }
.cn-child-photo #profilePhotoPreview { width: 112px; height: 112px; border-radius: 28px; object-fit: cover; border: 4px solid #fff; box-shadow: var(--cn-shadow); background: var(--cn-soft); }
.cn-child-photo #profilePhotoPreviewLoading { position: absolute; top: 50%; left: 50%; width: 32px; height: 32px; transform: translate(-50%, -50%); }
.cn-child-photo-btn {
    position: absolute; right: -6px; bottom: -6px; width: 36px; height: 36px; border-radius: 12px; border: 3px solid #fff;
    display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
    background: var(--cn-primary-strong); color: #fff; box-shadow: var(--cn-shadow);
}
.cn-child-photo-btn .cn-icon { width: 16px; height: 16px; }
.cn-child-info { flex: 1 1 auto; min-width: 0; }
.cn-modern .cn-child-info h1 { margin: 0 0 8px; font-size: 26px; font-weight: 700; color: var(--cn-text); letter-spacing: -.01em; }
.cn-child-meta { display: flex; flex-wrap: wrap; gap: 6px 28px; margin: 12px 0 0; }
.cn-child-meta dt { font-size: 12px; font-weight: 600; color: var(--cn-muted); text-transform: uppercase; letter-spacing: .03em; }
.cn-child-meta dd { margin: 0; font-size: 14px; font-weight: 500; }
.cn-child-actions { align-self: flex-start; }

.cn-tabs {
    display: flex; gap: 4px; margin: 0 0 20px; padding: 6px;
    background: var(--cn-surface); border: 1px solid var(--cn-border); border-radius: 14px; box-shadow: var(--cn-shadow);
    overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.cn-tabs::-webkit-scrollbar { display: none; }
.cn-modern .cn-tab {
    display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto; height: 40px; padding: 0 14px; border-radius: 10px;
    color: var(--cn-text-2); font-size: 14px; font-weight: 500; white-space: nowrap;
}
.cn-tab .cn-icon { width: 17px; height: 17px; }
.cn-modern .cn-tab:hover { background: var(--cn-bg); color: var(--cn-text); }
.cn-modern .cn-tab.is-active { background: var(--cn-primary-strong); color: #fff; font-weight: 600; }

/* generic grids, tiles, panels */
.cn-grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.cn-grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.cn-modern .cn-tile { display: flex; flex-direction: column; gap: 4px; padding: 18px; color: var(--cn-text); min-width: 0; }
.cn-modern a.cn-tile:hover { color: var(--cn-text); box-shadow: var(--cn-shadow-lg); }
.cn-tile-icon { width: 38px; height: 38px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; margin-bottom: 8px; }
.cn-tone-blue { background: var(--cn-soft); color: var(--cn-primary-strong); }
.cn-tone-teal { background: var(--cn-soft-teal); color: var(--cn-teal-strong); }
.cn-tone-orange { background: #fff4e8; color: var(--cn-orange); }
.cn-tone-purple { background: #f1ecfb; color: var(--cn-purple); }
.cn-tone-pink { background: #fdeef4; color: #c23c74; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .cn-tone-pink { background: #2b1622; color: #f1a7c6; } }
.cn-tile-label { font-size: 13px; font-weight: 600; color: var(--cn-muted); }
.cn-tile-value { font-size: 20px; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.cn-tile-value small { font-size: 13px; font-weight: 600; color: var(--cn-muted); }
.cn-tile-value-sm { font-size: 16px; }
.cn-tile-value .cn-status { margin-left: 4px; }
.cn-tile-sub { font-size: 13px; color: var(--cn-text-2); }
.cn-panel { padding: 20px; margin-bottom: 20px; }
.cn-note { margin: 8px 0 0; font-size: 13px; color: var(--cn-muted); }
.cn-list-static { margin: 0; }
.cn-progress-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; font-size: 13px; color: var(--cn-text-2); white-space: nowrap; }
.cn-progress-lg { flex: 1 1 auto; height: 8px; margin: 0; }
.cn-list-item .cn-status { margin-left: auto; }

.cn-timeline { list-style: none; margin: 0; padding: 0; }
.cn-timeline li { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--cn-border); font-size: 14px; }
.cn-timeline li:last-child { border-bottom: 0; }
.cn-modern .cn-timeline a { flex: 1 1 auto; color: var(--cn-text); font-weight: 500; }
.cn-timeline time { color: var(--cn-muted); font-size: 13px; white-space: nowrap; }
.cn-timeline-icon { width: 32px; height: 32px; border-radius: 10px; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; background: var(--cn-bg); color: var(--cn-primary-strong); }
.cn-timeline-icon .cn-icon { width: 16px; height: 16px; }

.cn-photo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.cn-photo-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; display: block; }
.cn-moments { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.cn-moment { position: relative; display: block; border-radius: 12px; overflow: hidden; }
.cn-moment img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.cn-moment span { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 8px 6px; font-size: 12px; font-weight: 600; color: #fff; background: linear-gradient(transparent, rgba(0, 0, 0, .55)); }

.cn-kv { display: grid; gap: 12px; }
.cn-kv > div { display: flex; justify-content: space-between; gap: 16px; font-size: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--cn-border); }
.cn-kv > div:last-child { border-bottom: 0; padding-bottom: 0; }
.cn-kv span { color: var(--cn-muted); }
.cn-kv strong { text-align: right; font-weight: 600; }
.cn-measures { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.cn-measures > div { padding: 12px; border-radius: 12px; background: var(--cn-bg); }
.cn-measures span { display: block; font-size: 12px; font-weight: 600; color: var(--cn-muted); }
.cn-measures strong { font-size: 20px; }
.cn-measures small { font-size: 12px; color: var(--cn-muted); }
.cn-history { display: grid; gap: 14px; }
.cn-history-block { padding: 14px; border-radius: 12px; background: var(--cn-bg); }
.cn-modern .cn-history-block h3 { margin: 0 0 8px; font-size: 15px; font-weight: 700; color: var(--cn-text); }
.cn-history-block h3 small { font-size: 12px; font-weight: 500; color: var(--cn-muted); margin-left: 6px; }
.cn-history-block dl { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 6px 12px; margin: 0; font-size: 14px; }
.cn-history-block dt { color: var(--cn-muted); font-weight: 500; }
.cn-history-block dd { margin: 0; }

/* section title used inside child sections */
.cn-section-title { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 4px 0 16px; }
.cn-modern .cn-section-title h2 { margin: 0; font-size: 20px; font-weight: 700; color: var(--cn-text); }
.cn-section-title p { margin: 2px 0 0; color: var(--cn-text-2); font-size: 14px; }

/* check-up list */
.cn-status-summary .cn-tile { align-items: flex-start; }
.cn-status-summary .cn-tile-value { font-size: 26px; margin-top: 6px; }
.cn-checks { padding: 6px; }
.cn-check-row { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 12px; }
.cn-check-row + .cn-check-row { border-top: 1px solid var(--cn-border); border-radius: 0 0 12px 12px; }
.cn-check-row.is-link { cursor: pointer; }
.cn-check-row.is-link:hover { background: var(--cn-bg); }
.cn-check-main { flex: 1 1 auto; min-width: 0; }
.cn-check-name { display: flex; align-items: center; gap: 8px; }
.cn-check-name strong { font-size: 15px; }
.cn-check-meta { display: block; font-size: 13px; color: var(--cn-muted); }
.cn-info-btn {
    width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--cn-border); background: #fff; cursor: pointer;
    font: 600 12px/1 Georgia, serif; color: var(--cn-primary-strong); padding: 0;
}
.cn-row-completed .cn-check-name strong { color: var(--cn-text-2); }

/* form fields (Add child modal) */
.cn-field { display: block; margin: 0 0 14px; border: 0; padding: 0; }
.cn-field > span, .cn-field > legend { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--cn-text-2); }
.cn-modern .cn-field .cn-input { margin: 0; }
.cn-modern select.cn-input { appearance: auto; padding-right: 10px; }
.cn-segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cn-segmented label { margin: 0; cursor: pointer; }
.cn-segmented input { position: absolute; opacity: 0; pointer-events: none; }
.cn-segmented span {
    display: flex; align-items: center; justify-content: center; height: 46px; border-radius: 12px;
    border: 1px solid var(--cn-border); font-weight: 600; color: var(--cn-text-2); background: #fff;
}
.cn-segmented input:checked + span { border-color: var(--cn-primary-strong); background: var(--cn-soft); color: var(--cn-primary-dark); box-shadow: 0 0 0 3px rgba(56, 169, 255, .15); }
.cn-segmented input:focus-visible + span { outline: 3px solid rgba(56, 169, 255, .45); }

/* existing (Olympus/Bootstrap) markup inside the child sections */
.cn-modern :is(.cn-child, .cn-legacy) .container { max-width: none; padding: 0; }
.cn-modern :is(.cn-child, .cn-legacy) .row { margin-left: -10px; margin-right: -10px; }
.cn-modern :is(.cn-child, .cn-legacy) .row > [class*="col"] { padding-left: 10px; padding-right: 10px; }
.cn-modern :is(.cn-child, .cn-legacy) .ui-block {
    background: var(--cn-surface); border: 1px solid var(--cn-border); border-radius: var(--cn-radius);
    box-shadow: var(--cn-shadow); margin-bottom: 20px;
}
.cn-modern :is(.cn-child, .cn-legacy) .ui-block-title { border-bottom: 1px solid var(--cn-border); padding: 16px 20px; }
.cn-modern :is(.cn-child, .cn-legacy) .ui-block-title .title, .cn-modern :is(.cn-child, .cn-legacy) .ui-block-title .h6 { font-size: 16px; font-weight: 700; color: var(--cn-text); }
.cn-modern :is(.cn-child, .cn-legacy) .ui-block-content { padding: 18px 20px; }
.cn-modern :is(.cn-child, .cn-legacy) .table { color: var(--cn-text-2); font-size: 14px; margin-bottom: 0; }
.cn-modern :is(.cn-child, .cn-legacy) .table thead th { border-bottom: 1px solid var(--cn-border); color: var(--cn-muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.cn-modern :is(.cn-child, .cn-legacy) .table td, .cn-modern :is(.cn-child, .cn-legacy) .table th { border-color: var(--cn-border); vertical-align: middle; }
.cn-modern :is(.cn-child, .cn-legacy) .table-striped tbody tr:nth-of-type(odd) { background: #f8fafd; }
.cn-modern :is(.cn-child, .cn-legacy) .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.cn-modern :is(.cn-child, .cn-legacy) .btn-primary, .cn-modern .modal .btn-primary { background-color: var(--cn-primary-strong); border-color: var(--cn-primary-strong); border-radius: 10px; }
.cn-modern :is(.cn-child, .cn-legacy) .btn-primary:hover, .cn-modern .modal .btn-primary:hover { background-color: var(--cn-primary-dark); border-color: var(--cn-primary-dark); }
.cn-modern :is(.cn-child, .cn-legacy) .btn-secondary { border-radius: 10px; }
.cn-modern :is(.cn-child, .cn-legacy) .form-control { border-radius: 10px; border-color: var(--cn-border); }
.cn-modern :is(.cn-child, .cn-legacy) .alert { border-radius: 12px; }
.cn-modern :is(.cn-child, .cn-legacy) .nav-tabs { flex-wrap: nowrap; overflow-x: auto; border-radius: 12px; }
.cn-modern :is(.cn-child, .cn-legacy) .chart-js { position: relative; width: 100%; }
.cn-modern :is(.cn-child, .cn-legacy) canvas { max-width: 100%; }
.cn-modern .cn-section-growth #btn-add-record { display: none !important; }
.cn-modern :is(.cn-child, .cn-legacy) .no-past-events { padding: 24px; text-align: center; color: var(--cn-muted); }

/* existing Bootstrap modals (growth records, photos) */
.cn-modern .modal-content { border: 0; border-radius: 20px; box-shadow: var(--cn-shadow-lg); overflow: hidden; }
.cn-modern .modal-header { border-bottom: 1px solid var(--cn-border); }
.cn-modern .modal-backdrop.show { opacity: .45; background: #102038; }

/* ---------------------------------------------------------------- responsive (Phase 2) */
@media (max-width: 1099px) {
    .cn-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cn-grid-2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 767px) {
    .cn-page-head { flex-direction: column; align-items: stretch; }
    .cn-page-head .cn-btn { width: 100%; }
    .cn-modern .cn-page-head h1 { font-size: 22px; }
    .cn-cards-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
    .cn-add-card { min-height: 120px; }
    .cn-child-header { flex-wrap: wrap; gap: 16px; padding: 18px; }
    .cn-child-photo #profilePhotoPreview { width: 80px; height: 80px; border-radius: 22px; }
    .cn-modern .cn-child-info h1 { font-size: 21px; }
    .cn-child-actions { width: 100%; }
    .cn-child-actions .cn-btn { width: 100%; }
    .cn-child-meta { gap: 6px 20px; }
    .cn-tabs { margin-left: -16px; margin-right: -16px; border-radius: 0; border-left: 0; border-right: 0; }
    .cn-grid-4 { gap: 10px; }
    .cn-modern .cn-tile { padding: 14px; }
    .cn-tile-value { font-size: 17px; }
    .cn-section-title { flex-wrap: wrap; }
    .cn-section-title .cn-btn { width: 100%; }
    .cn-check-row { gap: 10px; padding: 12px 8px; }
    .cn-check-row .cn-list-chevron { display: none; }
    .cn-history-block dl { grid-template-columns: minmax(0, 1fr); gap: 0; }
    .cn-history-block dd { margin-bottom: 8px; }
    .cn-measures strong { font-size: 17px; }
    .cn-modern :is(.cn-child, .cn-legacy) .ui-block-title { padding: 14px 16px; }
    .cn-modern :is(.cn-child, .cn-legacy) .ui-block-content { padding: 14px 16px; }
    /* existing Bootstrap modals become bottom sheets */
    .cn-modern .modal-dialog { margin: 0; position: absolute; left: 0; right: 0; bottom: 0; max-width: none; }
    .cn-modern .modal-content { border-radius: 20px 20px 0 0; padding-bottom: env(safe-area-inset-bottom); }
}
@media (max-width: 380px) {
    .cn-grid-4 { grid-template-columns: minmax(0, 1fr); }
    .cn-child-card-actions { grid-template-columns: minmax(0, 1fr); }
}

/* =========================================================================
   Phase 3: social area (posts, comments, profiles, groups, messages, search)
   and the shared shell for pages built from the classic includes (.cn-legacy)
   ========================================================================= */
.cn-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.cn-avatar-sm { width: 34px; height: 34px; }
.cn-modern .cn-dropdown-menu > a.cn-danger, .cn-modern .cn-dropdown-menu > a.cn-danger .cn-icon { color: #d92d20; }

/* ---------------------------------------------------------------- post card */
.cn-post { position: relative; padding: 20px 20px 0; margin-bottom: 20px; }
.cn-post-head { display: flex; align-items: flex-start; gap: 12px; }
.cn-post-head .cn-avatar { width: 44px; height: 44px; }
.cn-post-meta { flex: 1 1 auto; min-width: 0; }
.cn-post-author { font-size: 15px; line-height: 1.35; color: var(--cn-text); overflow-wrap: anywhere; }
.cn-modern .cn-post-author a { color: var(--cn-text); font-weight: 600; }
.cn-modern .cn-post-author a:hover { color: var(--cn-primary-dark); }
.cn-post-author .cn-muted { font-weight: 400; }
.cn-post-arrow { width: 14px; height: 14px; margin: 0 2px; color: var(--cn-muted); }
.cn-post-sub { display: flex; align-items: center; gap: 6px; margin-top: 2px; color: var(--cn-muted); font-size: 13px; }
.cn-modern .cn-post-sub a { color: var(--cn-muted); }
.cn-modern .cn-post-sub a:hover { color: var(--cn-primary-dark); }
.cn-post-privacy { display: inline-flex; }
.cn-post-privacy .cn-icon { width: 14px; height: 14px; }
.cn-post-menu { margin: -6px -8px 0 0; }
.cn-post-menu .cn-icon-btn { width: 38px; height: 38px; }
.cn-post-menu .cn-dropdown-menu { width: 230px; top: calc(100% + 2px); padding-top: 6px; }
.cn-post-notify:empty { display: none; }
.cn-post-notify { margin-top: 12px; }
.cn-post-notify .alert { margin: 0; border-radius: 12px; font-size: 14px; }
.cn-modern .cn-post-title { margin: 14px 0 0; font-size: 18px; font-weight: 700; color: var(--cn-text); line-height: 1.35; overflow-wrap: anywhere; }
.cn-post-body { margin-top: 10px; color: var(--cn-text-2); font-size: 15px; line-height: 1.6; overflow-wrap: anywhere; }
.cn-post-body:empty { display: none; }
.cn-post-body img { vertical-align: text-bottom; }
.cn-post-edit { margin-top: 14px; }
.cn-modern .cn-post-edit .cn-textarea { min-height: 110px; }
.cn-post-edit-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cn-modern .cn-post-edit-foot .cn-input { width: auto; flex: 1 1 160px; height: 36px; margin: 0; padding: 0 10px; font-size: 14px; border-radius: 10px; }
.cn-post-media { display: block; margin: 14px -20px 0; background: var(--cn-bg); }
.cn-post-media img { display: block; width: 100%; max-height: 560px; object-fit: contain; }
.cn-post-shared { margin-top: 14px; padding: 16px; border: 1px solid var(--cn-border); border-radius: var(--cn-radius-sm); background: #fbfcfe; }
.cn-post-shared .cn-avatar { width: 36px; height: 36px; }
.cn-post-shared .cn-post-media { margin: 12px -16px -16px; border-radius: 0 0 var(--cn-radius-sm) var(--cn-radius-sm); overflow: hidden; }
.cn-post-stats { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0 10px; color: var(--cn-muted); font-size: 13px; }
.cn-post-likers { display: flex; align-items: center; gap: 8px; min-width: 0; }
.cn-likes-str a { font-weight: 600; }
.cn-facepile { display: inline-flex; flex: 0 0 auto; }
.cn-facepile img { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; border: 2px solid #fff; margin-left: -6px; background: var(--cn-soft); }
.cn-facepile a:first-child img { margin-left: 0; }
.cn-post-counts { display: flex; gap: 12px; flex: 0 0 auto; }
.cn-modern .cn-post-counts a { color: var(--cn-muted); }
.cn-modern .cn-post-counts a:hover { color: var(--cn-primary-dark); }
.cn-post-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding: 4px 0; border-top: 1px solid var(--cn-border); border-bottom: 1px solid var(--cn-border); }
.cn-modern .cn-post-action {
    display: flex; align-items: center; justify-content: center; gap: 8px; height: 42px; border-radius: 10px;
    color: var(--cn-text-2); font-size: 14px; font-weight: 600; transition: background-color .15s, color .15s;
}
.cn-modern .cn-post-action:hover { background: var(--cn-bg); color: var(--cn-text); }
.cn-post-action .cn-icon { width: 19px; height: 19px; }
.cn-post-action-num { color: var(--cn-muted); font-weight: 500; }
.cn-modern .cn-post-action.is-liked { color: #e5484d; }
.cn-post-action.is-liked .cn-icon { fill: currentColor; }
.cn-post-action.is-liked .cn-post-action-num { color: inherit; }

/* comments */
.cn-comments { padding: 12px 0 16px; }
.cn-comment-list { list-style: none; margin: 0; padding: 0; }
.cn-comment { display: flex; gap: 10px; margin-bottom: 12px; }
.cn-comment-main { flex: 1 1 auto; min-width: 0; }
.cn-comment-bubble { display: inline-block; max-width: 100%; padding: 8px 14px; border-radius: 16px; background: var(--cn-bg); }
.cn-comment-bubble:has(.cn-comment-edit[style*="block"]) { display: block; }
.cn-modern .cn-comment-author { display: block; color: var(--cn-text); font-size: 13px; font-weight: 600; }
.cn-comment-bubble p { margin: 2px 0 0; color: var(--cn-text-2); font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.cn-comment-edit { margin-top: 6px; }
.cn-modern .cn-comment-edit .cn-textarea { min-height: 70px; margin-bottom: 8px; font-size: 14px; }
.cn-comment-edit-foot { display: flex; justify-content: flex-end; gap: 8px; }
.cn-comment-sub { display: flex; gap: 14px; padding: 4px 14px 0; font-size: 12px; color: var(--cn-muted); }
.cn-modern .cn-comment-sub a { color: var(--cn-muted); font-weight: 600; }
.cn-modern .cn-comment-sub a:hover { color: var(--cn-primary-dark); }
.cn-modern .cn-more-comments { display: inline-block; margin: 0 0 12px 44px; font-size: 13px; font-weight: 600; }
.cn-comment-form { display: flex; align-items: flex-end; gap: 10px; }
.cn-modern .cn-comment-input {
    flex: 1 1 auto; height: 40px; min-height: 40px; max-height: 160px; margin: 0; padding: 9px 14px;
    border-radius: 20px; background: var(--cn-bg); resize: none; font-size: 14px; line-height: 1.5;
}
.cn-modern .cn-comment-input:focus { background: #fff; }
.cn-comment-send { width: 40px; height: 40px; flex: 0 0 auto; color: var(--cn-primary-strong); }
.cn-comment-loading:empty { display: none; }
.cn-comment-loading, [id^="CommentLoading_"] p { margin: 6px 0 0 44px; font-size: 13px; color: var(--cn-muted); }
[id^="CommentLoading_"] img, .cn-post-notify img { width: 18px; height: 18px; }

/* ---------------------------------------------------------------- classic pages inside the modern shell */
.cn-legacy .header-spacer, .cn-legacy .header-spacer-small { display: none; }
.cn-legacy > .main-header { display: none; }
.cn-modern .cn-legacy .ui-block-title .title { margin: 0; }
.cn-modern .cn-legacy .ui-block-title { display: flex; align-items: center; gap: 12px; }
.cn-modern .cn-legacy .ui-block-title .more { margin-left: auto; }
.cn-modern .cn-legacy h1, .cn-modern .cn-legacy h2, .cn-modern .cn-legacy h3, .cn-modern .cn-legacy h4,
.cn-modern .cn-legacy h5, .cn-modern .cn-legacy h6 { font-family: inherit; color: var(--cn-text); }
.cn-modern .cn-legacy p, .cn-modern .cn-legacy li, .cn-modern .cn-legacy td { font-family: inherit; }

/* Olympus floating-label form fields */
.cn-modern .cn-legacy .form-group { margin-bottom: 16px; }
.cn-modern .cn-legacy .form-group.label-floating, .cn-modern .cn-legacy .form-group.label-static { position: relative; padding-top: 0; }
.cn-modern .cn-legacy .form-group.label-floating .control-label, .cn-modern .cn-legacy .form-group.label-static .control-label,
.cn-modern .cn-legacy .form-group.label-floating.is-focused .control-label, .cn-modern .cn-legacy .form-group.label-floating:not(.is-empty) .control-label {
    position: static; display: block; transform: none; top: auto; left: auto; margin: 0 0 6px; padding: 0;
    color: var(--cn-text-2); font-size: 13px; font-weight: 600; line-height: 1.3; pointer-events: auto;
}
.cn-modern .cn-legacy .form-control, .cn-modern .cn-legacy .bootstrap-select > .dropdown-toggle,
.cn-modern .cn-legacy input[type=datetimepicker] {
    min-height: 46px; height: auto; padding: 10px 14px; border: 1px solid var(--cn-border); border-radius: 12px;
    background: var(--cn-surface); color: var(--cn-text); font-family: inherit; font-size: 15px; line-height: 1.5; box-shadow: none;
}
.cn-modern .cn-legacy input[type=datetimepicker] { width: 100%; }
.cn-modern .cn-legacy textarea.form-control { min-height: 110px; }
.cn-modern .cn-legacy .form-control:focus, .cn-modern .cn-legacy input[type=datetimepicker]:focus { outline: none; border-color: var(--cn-primary); box-shadow: 0 0 0 4px rgba(56, 169, 255, .15); }
.cn-modern .cn-legacy .form-group .material-input { display: none; }
.cn-modern .cn-legacy .date-time-picker .input-group-addon { top: auto; bottom: 12px; right: 12px; height: auto; }
.cn-modern .cn-legacy .bootstrap-select > .dropdown-toggle { padding-right: 32px; }
.cn-modern .cn-legacy .bootstrap-select > .dropdown-toggle .filter-option { color: var(--cn-text); }
.cn-modern .cn-legacy .bootstrap-select .dropdown-menu { border: 1px solid var(--cn-border); border-radius: 12px; box-shadow: var(--cn-shadow-lg); }
.cn-modern .cn-legacy .form-group.with-icon .form-control { padding-left: 46px; }
.cn-modern .cn-legacy .form-group.with-icon > svg, .cn-modern .cn-legacy .form-group.with-icon > i { top: 13px; left: 14px; height: 20px; width: 20px; border: 0; padding: 0; }
.cn-modern .cn-legacy .btn { font-family: inherit; font-weight: 600; border-radius: 12px; box-shadow: none; }
.cn-modern .cn-legacy .btn-lg { padding: 13px 20px; font-size: 15px; }
.cn-modern .cn-legacy .btn-primary { background-color: var(--cn-primary-strong); border-color: var(--cn-primary-strong); }
.cn-modern .cn-legacy .btn-primary:hover { background-color: var(--cn-primary-dark); border-color: var(--cn-primary-dark); }
.cn-modern .cn-legacy .btn-secondary, .cn-modern .cn-legacy .btn-grey { background: var(--cn-bg); border: 1px solid var(--cn-border); color: var(--cn-text-2); }
.cn-modern .cn-legacy .btn-danger, .cn-modern .cn-legacy .btn-red { background: #fff1f0; border: 1px solid #ffd6d2; color: #d92d20; }
.cn-modern .cn-legacy .full-width { width: 100%; }
.cn-modern .cn-legacy .checkbox label, .cn-modern .cn-legacy .togglebutton label { color: var(--cn-text-2); font-size: 14px; }
.cn-modern .cn-legacy .description-toggle { border-color: var(--cn-border); }

/* settings navigation (app/includes/profile-settings.php) */
.cn-settings-nav { position: sticky; top: calc(var(--cn-topbar-h) + 16px); padding: 10px; margin-bottom: 20px; }
.cn-settings-group + .cn-settings-group { margin-top: 6px; padding-top: 8px; border-top: 1px solid var(--cn-border); }
.cn-modern .cn-settings-group h2 { margin: 6px 10px 6px; font-size: 12px; font-weight: 700; color: var(--cn-muted); text-transform: uppercase; letter-spacing: .04em; }
.cn-modern .cn-settings-link {
    display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px;
    color: var(--cn-text-2); font-size: 14px; font-weight: 500; line-height: 1.3;
}
.cn-settings-link span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cn-settings-link .cn-icon { width: 18px; height: 18px; color: var(--cn-muted); }
.cn-modern .cn-settings-link:hover { background: var(--cn-bg); color: var(--cn-text); }
.cn-modern .cn-settings-link.is-active { background: var(--cn-soft); color: var(--cn-primary-dark); font-weight: 600; }
.cn-settings-link.is-active .cn-icon { color: var(--cn-primary-strong); }

@media (max-width: 991px) {
    /* the settings menu becomes a horizontal, scrollable row above the form */
    .cn-settings-nav { position: static; display: flex; gap: 6px; overflow-x: auto; padding: 8px; margin-bottom: 16px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
    .cn-settings-nav::-webkit-scrollbar { display: none; }
    .cn-settings-group { display: flex; gap: 6px; flex: 0 0 auto; }
    .cn-settings-group + .cn-settings-group { margin: 0; padding: 0 0 0 6px; border-top: 0; border-left: 1px solid var(--cn-border); }
    .cn-modern .cn-settings-group h2 { display: none; }
    .cn-modern .cn-settings-link { flex: 0 0 auto; white-space: nowrap; max-width: 220px; }
}
@media (max-width: 767px) {
    .cn-post { padding: 16px 16px 0; margin-bottom: 14px; border-radius: 14px; }
    .cn-post-media { margin-left: -16px; margin-right: -16px; }
    .cn-post-action span:not(.cn-post-action-num) { font-size: 13px; }
    .cn-post-stats { flex-wrap: wrap; row-gap: 4px; }
    .cn-modern .cn-legacy .form-control { font-size: 16px; } /* avoids iOS zoom on focus */
}
.cn-modern .cn-legacy .bootstrap-select.form-control { border: 0; padding: 0; min-height: 0; background: none; box-shadow: none; }

/* ---------------------------------------------------------------- profile (app/includes/user-profile-header.php) */
.cn-profile-head { overflow: hidden; margin-bottom: 20px; }
.cn-profile-cover {
    position: relative; height: 160px; background-size: cover; background-position: center;
    background-color: #dff1ff; background-image: linear-gradient(120deg, #cfeaff 0%, #e8f6ff 45%, #d7faf3 100%);
}
.cn-profile-cover #coverPhotoPreviewLoading { position: absolute; top: 50%; left: 50%; width: 32px; height: 32px; transform: translate(-50%, -50%); }
.cn-profile-main { display: flex; align-items: flex-end; gap: 20px; padding: 0 24px 18px; margin-top: -48px; }
.cn-profile-photo { position: relative; flex: 0 0 auto; }
.cn-profile-photo #profilePhotoPreview { display: block; width: 120px; height: 120px; border-radius: 50%; object-fit: cover; border: 5px solid #fff; box-shadow: var(--cn-shadow); background: var(--cn-soft); }
.cn-profile-photo #profilePhotoPreviewLoading { position: absolute; top: 50%; left: 50%; width: 32px; height: 32px; transform: translate(-50%, -50%); }
.cn-profile-photo .cn-child-photo-btn { right: 2px; bottom: 4px; border-radius: 50%; }
.cn-profile-info { flex: 1 1 auto; min-width: 0; padding-bottom: 4px; }
.cn-modern .cn-profile-info h1 { margin: 0; font-size: 26px; font-weight: 700; color: var(--cn-text); letter-spacing: -.01em; overflow-wrap: anywhere; }
.cn-profile-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin-top: 4px; color: var(--cn-muted); font-size: 14px; }
.cn-profile-sub > span { display: inline-flex; align-items: center; gap: 5px; }
.cn-profile-sub .cn-icon { width: 15px; height: 15px; }
.cn-profile-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-bottom: 4px; }
.cn-profile-tabs { margin: 0; border: 0; border-top: 1px solid var(--cn-border); border-radius: 0; box-shadow: none; padding: 6px 16px; }
.cn-tab-count { font-weight: 600; opacity: .7; }
.cn-toggle-btn { min-width: 128px; }
.cn-toggle-state { display: inline-flex; align-items: center; gap: 8px; margin: 0; }
.cn-modern .cn-toggle-state::after { content: none; display: none; }
.cn-toggle-state b { font-weight: 600; }
.cn-toggle-state.icon-minus .cn-when-off, .cn-toggle-state:not(.icon-minus) .cn-when-on { display: none; }
.cn-modern .cn-btn-primary.cn-toggle-btn:has(.icon-minus) { background: var(--cn-soft); color: var(--cn-primary-dark); box-shadow: none; }
.cn-star-btn .icon-minus .cn-icon { fill: #ffb800; color: #ffb800; }
.cn-star-btn { min-width: 0; }

.cn-profile-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.cn-profile-layout .cn-right-col { position: static; }
.cn-back-link { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 14px; font-weight: 600; font-size: 14px; }
.cn-back-link .cn-icon { width: 18px; height: 18px; }
.cn-intro-about { margin: 0 0 12px; color: var(--cn-text-2); font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; }
.cn-intro-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.cn-intro-list li { display: flex; gap: 10px; align-items: flex-start; color: var(--cn-text-2); font-size: 14px; }
.cn-intro-list .cn-icon { width: 18px; height: 18px; color: var(--cn-muted); margin-top: 1px; }
.cn-intro-list span { min-width: 0; overflow-wrap: anywhere; }
.cn-side-empty { margin: 0; font-size: 14px; }
.cn-people-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 8px; }
.cn-modern .cn-people-grid a { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--cn-text-2); font-size: 12px; font-weight: 500; text-align: center; min-width: 0; }
.cn-people-grid a span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cn-people-grid .cn-avatar { width: 52px; height: 52px; }

@media (max-width: 1099px) {
    .cn-profile-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 767px) {
    .cn-profile-cover { height: 110px; }
    .cn-profile-main { flex-direction: column; align-items: flex-start; gap: 10px; padding: 0 16px 14px; margin-top: -44px; }
    .cn-profile-photo #profilePhotoPreview { width: 92px; height: 92px; border-width: 4px; }
    .cn-modern .cn-profile-info h1 { font-size: 21px; }
    .cn-profile-actions { width: 100%; }
    .cn-profile-actions .cn-btn { flex: 1 1 0; min-width: 0; }
    .cn-profile-tabs { padding: 6px 8px; }
}

/* ---------------------------------------------------------------- people cards (followers, following, stars, search) */
.cn-people-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; margin-bottom: 8px; }
.cn-person { display: flex; flex-direction: column; align-items: stretch; padding: 20px 16px 16px; text-align: center; }
.cn-modern .cn-person-top { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--cn-text); }
.cn-person-top .cn-avatar { width: 72px; height: 72px; margin-bottom: 6px; }
.cn-person-name { font-size: 16px; font-weight: 700; overflow-wrap: anywhere; }
.cn-person-sub { color: var(--cn-muted); font-size: 13px; overflow-wrap: anywhere; }
.cn-person-top .cn-chip { margin-top: 6px; }
.cn-person-note { margin: 8px 0 0; color: var(--cn-teal-strong); font-size: 13px; font-weight: 600; }
.cn-person-stats { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 12px; margin: 12px 0 14px; color: var(--cn-muted); font-size: 12px; }
.cn-person-stats b { color: var(--cn-text); font-weight: 700; }
.cn-person-actions { display: flex; gap: 8px; justify-content: center; margin-top: auto; }
.cn-person-actions .cn-toggle-btn:first-child { flex: 1 1 auto; min-width: 0; }
.cn-btn-icon { width: 36px; padding: 0; flex: 0 0 auto; }
.cn-btn-icon.cn-toggle-btn { min-width: 0; }

/* search results: one column of people rows and posts */
.cn-narrow { max-width: 760px; margin: 0 auto; }
.cn-search-results > .cn-person { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px 16px; text-align: left; padding: 16px 20px; margin-bottom: 14px; }
.cn-modern .cn-search-results .cn-person-top { flex-direction: row; flex: 1 1 260px; min-width: 0; gap: 4px 12px; flex-wrap: wrap; align-items: center; }
.cn-search-results .cn-person-top .cn-avatar { width: 52px; height: 52px; margin: 0; }
.cn-search-results .cn-person-name { flex: 1 1 auto; min-width: 0; }
.cn-search-results .cn-person-sub { flex-basis: 100%; padding-left: 64px; margin-top: -8px; }
.cn-search-results .cn-person-top .cn-chip { margin: 0; }
.cn-search-results .cn-person-note { flex-basis: 100%; order: 3; margin: 0; padding-left: 64px; }
.cn-search-results .cn-person-stats { display: none; }
.cn-search-results .cn-person-actions { margin: 0; flex: 0 0 auto; }

/* ---------------------------------------------------------------- groups */
.cn-group-card { display: flex; flex-direction: column; gap: 14px; padding: 20px; }
.cn-group-card-actions { grid-template-columns: minmax(0, 1fr); }
.cn-modern a.cn-add-card { color: var(--cn-text); text-decoration: none; }
.cn-discover { margin-top: 24px; }
.cn-group-cover { height: 120px; }
.cn-profile-photo #profilePhotoPreview.cn-group-photo { border-radius: 28px; }
.cn-note-card { display: flex; align-items: center; gap: 12px; padding: 14px 18px; margin-bottom: 20px; color: var(--cn-text-2); font-size: 14px; }
.cn-note-card p { margin: 0; }
.cn-note-card .cn-icon { color: var(--cn-muted); }

/* ---------------------------------------------------------------- messages */
.cn-chat { display: grid; grid-template-columns: 320px minmax(0, 1fr); height: calc(100vh - var(--cn-topbar-h) - 170px); min-height: 460px; overflow: hidden; }
.cn-chat-list { border-right: 1px solid var(--cn-border); display: flex; flex-direction: column; min-height: 0; }
.cn-chat-list-head, .cn-chat-head { display: flex; align-items: center; gap: 8px; min-height: 60px; padding: 0 18px; border-bottom: 1px solid var(--cn-border); }
.cn-modern .cn-chat-list-head h2, .cn-modern .cn-chat-head h2 { margin: 0; font-size: 16px; font-weight: 700; color: var(--cn-text); }
.cn-modern .cn-chat-contacts { flex: 1 1 auto; overflow-y: auto; margin: 0; padding: 6px; list-style: none; color: var(--cn-muted); font-size: 14px; }
.cn-modern .cn-chat-contacts > li { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 12px; margin: 0; border: 0; }
.cn-modern .cn-chat-contacts > li:hover { background: var(--cn-bg); }
.cn-modern .cn-chat-contacts > li.message-unread { background: var(--cn-soft); }
.cn-modern .cn-chat .author-thumb { flex: 0 0 auto; margin: 0; }
.cn-modern .cn-chat .author-thumb img { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; }
.cn-modern .cn-chat .notification-event { flex: 1 1 auto; min-width: 0; padding: 0; }
.cn-modern .cn-chat .notification-friend { display: block; color: var(--cn-text); font-size: 14px; font-weight: 600; }
.cn-modern .cn-chat-contacts .chat-message-item { display: block; color: var(--cn-muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cn-modern .cn-chat .notification-date { display: block; color: var(--cn-muted); font-size: 12px; }
.cn-modern .cn-chat-contacts .notification-icon { display: none; }
.cn-chat-pane { position: relative; display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.cn-chat-field { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.cn-chat-field[style*="none"] { display: none !important; }
.cn-chat-field:not([style*="none"]) ~ .cn-chat-placeholder { display: none; }
.cn-chat-placeholder { margin: auto; padding: 24px; }
.cn-chat-back { display: none; }
.cn-chat-scroll { flex: 1 1 auto; overflow-y: auto; padding: 16px 18px; background: #fbfcfe; }
.cn-modern .cn-chat-scroll ul { list-style: none; margin: 0; padding: 0; }
.cn-modern .chat-message-field > li { display: flex; align-items: flex-end; gap: 8px; margin: 0 0 10px; padding: 0; border: 0; background: none; }
.cn-modern .chat-message-field .author-thumb img { width: 30px; height: 30px; }
.cn-modern .chat-message-field .notification-event { display: flex; flex-direction: column; align-items: flex-start; max-width: 75%; flex: 0 1 auto; }
.cn-modern .chat-message-field .notification-friend { display: none; }
.cn-modern .chat-message-field .chat-message-item { order: -1; display: block; min-width: 0 !important; padding: 9px 14px; border-radius: 16px 16px 16px 4px; background: #fff; border: 1px solid var(--cn-border); color: var(--cn-text); font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.cn-modern .chat-message-field .notification-date { margin-top: 3px; font-size: 11px; }
.cn-modern .chat-message-field > li.is-mine { flex-direction: row-reverse; }
.cn-modern .chat-message-field > li.is-mine .author-thumb { display: none; }
.cn-modern .chat-message-field > li.is-mine .notification-event { align-items: flex-end; }
.cn-modern .chat-message-field > li.is-mine .chat-message-item { background: var(--cn-primary-strong); border-color: var(--cn-primary-strong); color: #fff; border-radius: 16px 16px 4px 16px; }
.cn-chat-form { display: flex; align-items: flex-end; gap: 10px; padding: 12px 14px; border-top: 1px solid var(--cn-border); background: #fff; }
.cn-chat-send { height: 40px; flex: 0 0 auto; }

/* notifications page */
.cn-notifications-card .cn-js-list > li { padding: 12px 8px; border-radius: 12px; }
.cn-modern .cn-notifications-card .cn-js-list > li.un-read { background: var(--cn-soft); }
.cn-modern .cn-js-list .notification-link { color: var(--cn-primary-strong); }
.cn-modern .cn-js-list .notification-date { display: block; color: var(--cn-muted); font-size: 12px; }
.cn-modern .cn-notifications-card .notification-icon svg { width: 18px; height: 18px; fill: var(--cn-muted); }

@media (max-width: 767px) {
    .cn-people-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .cn-person { padding: 16px 10px 12px; }
    .cn-person-top .cn-avatar { width: 60px; height: 60px; }
    .cn-person-stats { gap: 2px 8px; }
    .cn-search-results > .cn-person { padding: 14px; }
    .cn-search-results .cn-person-sub, .cn-search-results .cn-person-note { padding-left: 64px; }
    .cn-search-results .cn-person-actions { width: 100%; }
    .cn-chat { grid-template-columns: minmax(0, 1fr); height: calc(100vh - 64px - 64px - 150px); min-height: 420px; }
    .cn-chat-list { border-right: 0; }
    .cn-chat-pane { display: none; }
    .cn-chat.is-chat-open .cn-chat-list { display: none; }
    .cn-chat.is-chat-open .cn-chat-pane { display: flex; }
    .cn-chat-back { display: inline-flex; width: 36px; height: 36px; margin-left: -10px; }
    .cn-chat-send span { display: none; }
}
@media (max-width: 380px) {
    .cn-people-cards { grid-template-columns: minmax(0, 1fr); }
}

/* =========================================================================
   Phase 4: account pages, medical page settings, doctors, login, errors
   ========================================================================= */
.cn-modern .cn-legacy .form-group.with-icon::after { display: none; }
.cn-modern .cn-legacy .form-group.with-icon > i, .cn-modern .cn-legacy .form-group.with-icon > svg {
    position: absolute; left: 15px; top: auto; bottom: 14px; margin: 0; width: 18px; height: 18px; line-height: 18px; font-size: 17px; text-align: center;
}
.cn-modern .cn-legacy .form-group.with-icon .form-control, .cn-modern .cn-legacy .label-floating.with-icon input { padding-left: 46px; }
.cn-modern .cn-legacy .date-time-picker { position: relative; }
.cn-modern .cn-legacy .date-time-picker .input-group-addon { position: absolute; top: auto; bottom: 0; right: 0; width: 46px; height: 46px; display: flex; align-items: center; justify-content: center; background: none; border: 0; padding: 0; }
.cn-modern .cn-legacy .date-time-picker .input-group-addon svg { width: 18px; height: 18px; fill: var(--cn-muted); }
.cn-modern .cn-legacy .selectize-control .selectize-input { min-height: 46px; padding: 10px 14px; border: 1px solid var(--cn-border); border-radius: 12px; box-shadow: none; background: #fff; font-size: 15px; }
.cn-modern .cn-legacy .selectize-control.multi .selectize-input > div { background: var(--cn-soft); color: var(--cn-primary-dark); border-radius: 8px; padding: 2px 8px; border: 0; }
.cn-modern .cn-legacy .selectize-dropdown { border: 1px solid var(--cn-border); border-radius: 12px; box-shadow: var(--cn-shadow-lg); }
.cn-modern .cn-legacy .form-group > label:not(.control-label) { display: block; margin: 0 0 6px; color: var(--cn-text-2); font-size: 13px; font-weight: 600; }

.cn-page-summary { display: flex; align-items: center; gap: 14px; padding: 16px 20px; margin-bottom: 20px; }
.cn-page-summary-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.cn-page-summary-text strong { font-size: 17px; color: var(--cn-text); }
.cn-page-summary-text span { font-size: 14px; color: var(--cn-muted); }
.cn-member-list { list-style: none; margin: 0 0 8px; padding: 0; }
.cn-member-list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--cn-border); }
.cn-member-list li:last-child { border-bottom: 0; }
.cn-member-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.cn-modern .cn-member-text a { color: var(--cn-text); font-weight: 600; font-size: 15px; }
.cn-member-text span, .cn-member-rel { color: var(--cn-muted); font-size: 13px; }
.cn-member-rel { min-width: 90px; text-align: right; }
.cn-modern .cn-danger-btn { color: #d92d20; }
.cn-modern .cn-danger-btn:hover { background: #fff1f0; color: #b42318; }
.cn-modern .cn-subtitle { margin: 18px 0 12px; font-size: 15px; font-weight: 700; color: var(--cn-text); }
.cn-add-member { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr) auto; gap: 12px; align-items: end; }
.cn-modern .cn-add-member .form-group { margin: 0; }
.cn-modern .cn-add-member .btn { height: 46px; margin: 0; padding: 0 22px; }
.cn-danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 20px; margin-bottom: 20px; border-color: #ffd6d2; }
.cn-danger-zone strong { color: var(--cn-text); }
.cn-danger-zone p { margin: 2px 0 0; color: var(--cn-muted); font-size: 14px; }
.cn-modern .cn-btn-danger { background: #fff1f0; color: #d92d20; border-color: #ffd6d2; }
.cn-modern .cn-btn-danger:hover { background: #d92d20; color: #fff; }

@media (max-width: 767px) {
    .cn-add-member { grid-template-columns: minmax(0, 1fr); }
    .cn-member-list li { flex-wrap: wrap; }
    .cn-member-rel { min-width: 0; text-align: left; }
    .cn-danger-zone { flex-direction: column; align-items: stretch; }
    .cn-page-summary { flex-wrap: wrap; }
    .cn-page-summary .cn-btn { width: 100%; }
}
@media (min-width: 768px) { .cn-add-member-2 { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) auto; } }

/* ---------------------------------------------------------------- login / register (app/login-signup.php) and 404 */
.cn-auth { min-height: 100vh; margin: 0; background: radial-gradient(1200px 600px at 0% 0%, #dff1ff 0%, transparent 60%), radial-gradient(900px 500px at 100% 100%, #dcfaf4 0%, transparent 55%), var(--cn-bg); }
.cn-auth-wrap { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 48px; max-width: 1180px; min-height: 100vh; margin: 0 auto; padding: 48px 32px; align-items: center; }
.cn-auth-brand { display: inline-flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.cn-auth-brand .cn-brand-logo { display: inline-flex; width: 44px; height: 44px; border-radius: 12px; overflow: hidden; }
.cn-auth-brand .cn-brand-logo img { width: 100%; height: 100%; object-fit: cover; }
.cn-modern .cn-auth-brand .cn-brand-name { font-size: 22px; font-weight: 700; letter-spacing: .02em; color: var(--cn-text); }
.cn-auth-brand-sm { margin: 0 auto 18px; display: flex; justify-content: center; }
.cn-modern .cn-auth-hero h1 { margin: 0 0 14px; font-size: 40px; line-height: 1.15; font-weight: 700; letter-spacing: -.02em; color: var(--cn-text); }
.cn-auth-hero > p { margin: 0 0 24px; max-width: 480px; color: var(--cn-text-2); font-size: 17px; line-height: 1.6; }
.cn-auth-points { list-style: none; margin: 0 0 28px; padding: 0; display: grid; gap: 12px; }
.cn-auth-points li { display: flex; align-items: center; gap: 12px; color: var(--cn-text); font-weight: 500; }
.cn-auth-points .cn-icon { width: 38px; height: 38px; padding: 9px; border-radius: 12px; background: #fff; color: var(--cn-primary-strong); box-shadow: var(--cn-shadow); }
.cn-modern .cn-auth-hero-btn { background: #fff; color: var(--cn-primary-dark); border-color: var(--cn-border); box-shadow: var(--cn-shadow); }
.cn-auth-main { width: 100%; max-width: 460px; justify-self: end; }
.cn-auth-card { padding: 8px 28px 28px; }
.cn-modern .cn-auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 16px 0 20px; padding: 4px; border: 0; border-radius: 12px; background: var(--cn-bg); }
.cn-modern .cn-auth-tabs .nav-item { margin: 0; }
.cn-modern .cn-auth-tabs .nav-link { display: block; height: 40px; line-height: 40px; padding: 0; border: 0; border-radius: 10px; text-align: center; color: var(--cn-text-2); font-weight: 600; font-size: 15px; background: none; }
.cn-modern .cn-auth-tabs .nav-link.active { background: #fff; color: var(--cn-primary-dark); box-shadow: 0 1px 3px rgba(16, 42, 77, .1); }
.cn-modern .cn-auth-title { margin: 0 0 16px; font-size: 20px; font-weight: 700; color: var(--cn-text); }
.cn-auth .cn-field { display: block; margin: 0 0 12px; }
.cn-auth .cn-field > span { display: block; margin-bottom: 6px; color: var(--cn-text-2); font-size: 13px; font-weight: 600; }
.cn-modern.cn-auth .cn-input { margin: 0; font-size: 16px; }
.cn-auth-row { gap: 12px; }
.cn-check { display: flex; align-items: flex-start; gap: 10px; margin: 4px 0 16px; color: var(--cn-text-2); font-size: 14px; cursor: pointer; }
.cn-check input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--cn-primary-strong); flex: 0 0 auto; }
.cn-auth-submit { width: 100%; height: 48px; }
.cn-auth #login_msg:not(:empty), .cn-auth #signup_msg:not(:empty) { margin-bottom: 12px; font-size: 14px; }
.cn-auth .alert { border-radius: 12px; margin: 0; }
.cn-auth-or { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--cn-muted); font-size: 13px; }
.cn-auth-or::before, .cn-auth-or::after { content: ''; flex: 1 1 auto; height: 1px; background: var(--cn-border); }
.cn-auth-social { width: 100%; margin-bottom: 10px; }
.cn-auth-social i { width: 18px; }
.cn-auth-note { margin: 10px 0 0; text-align: center; color: var(--cn-muted); font-size: 14px; }
.cn-auth-langs { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 16px; margin: 18px 0 0; font-size: 14px; }
.cn-modern .cn-auth-langs a { color: var(--cn-muted); }
.cn-modern .cn-auth-langs a[aria-current] { color: var(--cn-primary-dark); font-weight: 600; }
.cn-error { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 16px; text-align: center; }
.cn-error-card { max-width: 480px; padding: 36px 32px; }
.cn-error-code { display: block; font-size: 64px; font-weight: 700; line-height: 1; letter-spacing: -.03em; background: linear-gradient(135deg, var(--cn-primary) 0%, var(--cn-teal) 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.cn-modern .cn-error-card h1 { margin: 12px 0 8px; font-size: 24px; font-weight: 700; color: var(--cn-text); }
.cn-error-card p { margin: 0 0 22px; color: var(--cn-text-2); }
.cn-error-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
@media (max-width: 991px) {
    .cn-auth-wrap { grid-template-columns: minmax(0, 1fr); gap: 24px; padding: 28px 16px 40px; min-height: 0; }
    .cn-auth-hero { text-align: left; }
    .cn-modern .cn-auth-hero h1 { font-size: 28px; }
    .cn-auth-hero > p { font-size: 15px; margin-bottom: 16px; }
    .cn-auth-points { display: none; }
    .cn-auth-main { justify-self: stretch; max-width: none; }
    .cn-auth-brand { margin-bottom: 16px; }
}
@media (max-width: 480px) {
    .cn-auth-card { padding: 4px 16px 20px; }
    .cn-auth-row { grid-template-columns: minmax(0, 1fr); gap: 0; }
}
/* neutralize the Olympus login card (side tab column, fixed height) and its hidden checkboxes */
.cn-modern .cn-check input[type=checkbox] { display: inline-block; }
.cn-auth .registration-login-form { padding: 8px 28px 28px; min-height: 0; margin: 0; border-radius: var(--cn-radius); overflow: visible; }
.cn-modern.cn-auth .registration-login-form .nav-tabs { position: static; float: none; height: auto; width: auto; bottom: auto; }
.cn-modern.cn-auth .registration-login-form .nav-item { display: block; height: auto; width: auto; float: none; }
.cn-modern.cn-auth .registration-login-form .nav-link { display: block; height: 40px; border: 0; }
.cn-modern.cn-auth .registration-login-form .nav-link:not(.active) { background: none; }
.cn-auth .registration-login-form .content { padding: 0; }
.cn-auth .registration-login-form p { font-size: 14px; }
.cn-auth .tab-content { overflow: visible; }
.cn-auth a, .cn-auth button { text-decoration: none; }
.cn-auth { font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif; }
.cn-auth *, .cn-auth *::before, .cn-auth *::after { box-sizing: border-box; }
@media (max-width: 480px) { .cn-auth .registration-login-form { padding: 4px 16px 20px; } }

/* child area: vaccines overview, medical history, photos (Phase 4) */
.cn-vaccine-overview { margin: 16px 0 0; gap: 16px; }
.cn-vaccine-overview .cn-side-card { margin-bottom: 0; }
.cn-vaccine-overview .cn-progress-lg { margin: 6px 0 10px; }
.cn-vaccine-list { margin-top: 16px; }
.cn-modern .cn-vaccine-row { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px solid var(--cn-border); }
.cn-vaccine-row:last-child { border-bottom: 0; }
.cn-vaccine-row strong { font-size: 14px; color: var(--cn-text); }
.cn-vaccine-row .cn-chips { margin: 0; gap: 6px; }
.cn-vaccine-row .cn-status { display: inline-flex; align-items: center; gap: 4px; }
.cn-vaccine-row .cn-status .cn-icon { width: 13px; height: 13px; }
.cn-modern .cn-section-history .social-menu-tabs {
    display: flex; gap: 4px; flex-wrap: nowrap; overflow-x: auto; margin: 0 0 16px; padding: 6px; border: 1px solid var(--cn-border);
    border-radius: 14px; background: var(--cn-surface); box-shadow: var(--cn-shadow); scrollbar-width: none;
}
.cn-modern .cn-section-history .social-menu-tabs .nav-item { margin: 0; flex: 0 0 auto; }
.cn-modern .cn-section-history .social-menu-tabs .nav-link { height: 40px; line-height: 40px; padding: 0 16px; border: 0; border-radius: 10px; color: var(--cn-text-2); font-weight: 500; font-size: 14px; background: none; }
.cn-modern .cn-section-history .social-menu-tabs .nav-link.active { background: var(--cn-primary-strong); color: #fff; font-weight: 600; }
.cn-modern .cn-section-history .ui-block-title .align-right img { max-height: 44px; margin: -10px 0 !important; }
.cn-modern .cn-section-history .ui-block .ui-block { box-shadow: none; border-radius: 12px; margin-bottom: 14px; }
.cn-modern .cn-section-history .ui-block .ui-block .ui-block-title { padding: 10px 14px; }
.cn-modern .cn-section-history .list-group-item { border-color: var(--cn-border); font-size: 14px; }
.cn-modern .cn-section-history .list-group-item.text-success { color: var(--cn-muted) !important; font-style: italic; }
.cn-modern .cn-section-history .ui-block-title .btn { height: 32px; padding: 0 12px; line-height: 32px; font-size: 13px; margin: 0; }
.cn-modern .cn-section-history .form-control[readonly], .cn-modern .cn-section-history .form-control:disabled { background: var(--cn-bg); }

/* photo gallery */
.cn-photo-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.cn-photo-card { margin: 0; overflow: hidden; }
.cn-photo-card-img { display: block; background: var(--cn-bg); }
.cn-photo-card-img img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform .2s; }
.cn-photo-card-img:hover img { transform: scale(1.03); }
.cn-photo-card figcaption { display: flex; align-items: center; gap: 8px; padding: 10px 8px 10px 14px; }
.cn-photo-card-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cn-photo-card-text strong { font-size: 14px; color: var(--cn-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cn-photo-card-text > span { font-size: 12px; color: var(--cn-muted); }
.cn-photo-card-text .cn-chip { font-size: 11px; padding: 1px 8px; }
.cn-photo-card .cn-icon-btn { width: 36px; height: 36px; flex: 0 0 auto; }
@media (max-width: 767px) { .cn-photo-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }

/* doctors directory filter, coming-soon page */
.cn-filter { position: relative; display: block; max-width: 420px; margin: 0 0 18px; }
.cn-filter .cn-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--cn-muted); width: 18px; height: 18px; }
.cn-modern .cn-filter .cn-input { margin: 0; padding-left: 42px; }
.cn-soon-hero { padding: 48px 24px; }
.cn-soon-hero .cn-soon { display: inline-block; margin: 0 0 8px; }
.cn-soon-hero p { max-width: 520px; margin-left: auto; margin-right: auto; }
.cn-person[hidden] { display: none; }
.cn-soon-hero .cn-error-actions { margin-top: 18px; }
.cn-auth-forgot { margin: -6px 0 14px; text-align: right; font-size: 14px; }
.cn-reset-card { width: 100%; max-width: 440px; text-align: left; }
.cn-reset-card h1, .cn-reset-card > p { text-align: center; }
.cn-reset-card .cn-auth-note a { display: inline-flex; align-items: center; gap: 6px; }
.cn-reset-card .cn-auth-note .cn-icon { width: 16px; height: 16px; }
.cn-reset-card .cn-auth-note { margin-top: 18px; }

/* Shared calm status chips (dashboard tiles, Check Up, Vaccinations) */
.cn-vstat{display:inline-flex;align-items:center;gap:.3rem;border-radius:999px;padding:.2rem .55rem;font-size:.78rem;font-weight:700;white-space:nowrap;vertical-align:middle}
.cn-vstat-done{background:#e3fbf3;color:#067a5f}
.cn-vstat-due{background:#e8f0ff;color:#1d4ed8}
.cn-vstat-soon{background:#eef2f7;color:#475569}
.cn-vstat-check{background:#fff4e5;color:#b54708}
.cn-vstat-optional{background:#eef2f7;color:#475569}
.cn-vstat-notyet{background:#f3eefc;color:#6b4ea8}

/* Full-bleed tab bar: at <=380px the content gutter is 12px (not 16px), so the tab bar's
   negative margin must match it or the page scrolls ~4px horizontally. Placed last so it wins
   over the earlier <=767px -16px rule regardless of equal media specificity. */
@media (max-width: 380px) {
    .cn-tabs { margin-left: -12px; margin-right: -12px; }
}

/* =========================================================================
   XD PROTOTYPE FIDELITY  —  restores the original CENNA Baby Space look
   (turquoise + navy + royal-blue), the brand logo, turquoise avatar rings,
   gentle hover enlargement of child/profile images, pill primary buttons,
   soft card hover-lift and the pale-cyan canvas. Scoped to .cn-modern.
   ========================================================================= */

/* --- brand logo (original asset reused) ------------------------------- */
.cn-modern .cn-brand-logo,
.cn-modern .cn-topbar-brand .cn-brand-logo {
    width: auto; height: 34px; border-radius: 0;
    background: none; box-shadow: none;
}
.cn-modern .cn-brand-logo img { width: auto; height: 34px; }
.cn-modern .cn-brand .cn-brand-name,
.cn-modern .cn-topbar-brand .cn-brand-name { display: none; } /* wordmark is part of the logo image */

/* --- navy headings / section titles ----------------------------------- */
.cn-modern .cn-section-head h2,
.cn-modern .cn-card-head h2,
.cn-modern .cn-child-card-name h3,
.cn-modern .cn-child-card-name h3 a,
.cn-modern .cn-page-title,
.cn-modern .cn-hero-title,
.cn-modern h1.cn-title, .cn-modern h2.cn-title {
    color: var(--cn-navy);
}
.cn-modern .cn-child-card-name h3 a:hover { color: var(--cn-primary-dark); }

/* "View All" / section links read navy-bold like the prototype */
.cn-modern .cn-section-head .cn-link,
.cn-modern .cn-card-head .cn-link { color: var(--cn-navy); font-weight: 700; }
.cn-modern .cn-section-head .cn-link:hover,
.cn-modern .cn-card-head .cn-link:hover { color: var(--cn-royal); }

/* right-rail category labels (People / Doctors / Groups) in turquoise */
.cn-modern .cn-card-subhead h2,
.cn-modern .cn-rail-label { color: var(--cn-teal-strong); font-weight: 700; }

/* stat numbers in turquoise, as in the prototype stat cards */
.cn-modern .cn-stat-value { color: var(--cn-primary-strong); }

/* --- active navigation: navy text on a soft turquoise pill ------------ */
.cn-modern .cn-nav-item.is-active { background: var(--cn-soft); color: var(--cn-navy); font-weight: 700; }
.cn-modern .cn-nav-item.is-active .cn-icon { color: var(--cn-primary-strong); }

/* --- turquoise avatar ring (prototype look) --------------------------- */
.cn-modern .cn-avatar {
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px var(--cn-teal);
}

/* --- gentle hover enlargement of child / profile images --------------- */
.cn-modern .cn-avatar,
.cn-modern .cn-child-avatar img,
.cn-modern .cn-people-grid .cn-avatar,
.cn-modern .cn-child-card-top .cn-avatar {
    transition: transform .25s ease, box-shadow .25s ease;
    will-change: transform;
}
.cn-modern a:hover > .cn-avatar,
.cn-modern .cn-list-item:hover .cn-avatar,
.cn-modern .cn-people-grid a:hover .cn-avatar,
.cn-modern .cn-child-card:hover .cn-child-card-top .cn-avatar,
.cn-modern .cn-child-chip:hover .cn-avatar,
.cn-modern .cn-sidebar-child:hover .cn-avatar {
    transform: scale(1.09);
    box-shadow: 0 0 0 2px var(--cn-primary-strong), 0 8px 18px rgba(15, 176, 194, .28);
}

/* --- pill primary buttons (Add Post, Follow, Create …) ---------------- */
.cn-modern .cn-btn-primary,
.cn-modern .cn-add-post-btn { border-radius: 999px; }
.cn-modern .cn-btn-soft { color: var(--cn-primary-dark); }
.cn-modern .cn-btn-soft:hover { background: #d2eff4; color: var(--cn-primary-dark); }

/* --- soft card hover-lift --------------------------------------------- */
.cn-modern .cn-card { transition: transform .2s ease, box-shadow .2s ease; }
.cn-modern .cn-feed-col .cn-card:hover,
.cn-modern .cn-side-card:hover { transform: translateY(-2px); box-shadow: var(--cn-shadow-lg); }
/* keep the big composer / hero cards calm (no lift) */
.cn-modern .cn-hero-card:hover,
.cn-modern .cn-composer:hover { transform: none; box-shadow: var(--cn-shadow); }

/* --- pale-cyan canvas + subtle centre gradient ------------------------ */
.cn-modern { background: var(--cn-bg); }
.cn-modern .cn-topbar { background: rgba(233, 243, 244, .9); }
.cn-modern .cn-feed-col > .cn-hero-card,
.cn-modern .cn-profile-hero {
    background: linear-gradient(180deg, #eaf8fb 0%, #ffffff 72%);
}

/* login / auth brand logo (original CENNA Baby Space mark) */
.cn-modern .cn-auth-logo, body .cn-auth-logo { height: 72px; width: auto; display: block; }
.cn-auth-brand-sm .cn-auth-logo { height: 40px; }
