/* ============================================================
   Connect Q&A — cnt_style.css
   Brand colour #00D2C2 (teal)
   ============================================================ */

/* ----- 0. CSS Variables (Figma-aligned) ----- */
:root {
    --cnt-brand: #00D2C2;
    --cnt-brand-dark: #00B8AA;
    --cnt-brand-gradient: linear-gradient(135deg, #00D2C2, #00B8AA);
    --cnt-text: #3F4342;
    --cnt-text-light: #878B8A;
    --cnt-text-disabled: #ABAFAE;
    --cnt-text-dimmed: #D5D8D7;
    --cnt-bg: #F5F7F7;
    --cnt-card-bg: #fff;
    --cnt-border: #D5D8D7;
    --cnt-border-light: #EBEBEB;
    --cnt-danger: #e74c3c;
    --cnt-success: #00A500;
    --cnt-liked-color: #EF007F;
    --cnt-adviser-color: #02AED5;
    --cnt-adviser-bg: #E1F5FA;
    --cnt-radius: 12px;
    --cnt-radius-sm: 8px;
    --cnt-shadow: 0 4px 4px rgba(171, 175, 174, 0.25);
    --cnt-shadow-lg: 0 4px 20px rgba(0, 0, 0, 0.10);
    --cnt-transition: 0.2s ease;
}

/* ----- 1. Reset & Page Wrapper ----- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI',
                 Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--cnt-text);
    background: var(--cnt-bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.cnt-wrapper {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 16px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.cnt-main {
    flex: 1;
}

.cnt-main-content {
    padding: 0 16px;
    max-width: 960px;
    margin: 10px auto auto;
}

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

img {
    max-width: 100%;
    height: auto;
}

/* ----- 2. Header ----- */
.cnt-header-wrap {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--cnt-card-bg);
    border-bottom: 1px solid var(--cnt-border);
}

.cnt-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    max-width: 960px;
    margin: 0 auto;
    width: 100%;
}

.cnt-page-wrapper {
    max-width: 720px;
    margin: 0 auto;
    padding-top: 16px;
    min-height: 100vh;
}

.cnt-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cnt-logo {
    display: flex;
    align-items: center;
}

.cnt-logo img {
    height: 28px;
    width: auto;
}

/* Nav tabs: Connect / Journal */
.cnt-section-nav {
    display: flex;
    gap: 16px;
    margin-left: 8px;
}

.cnt-section-nav a {
    font-size: 20px;
    font-weight: 400;
    color: var(--cnt-text-disabled);
    padding: 4px 0;
    border-bottom: 2px solid transparent;
    transition: color var(--cnt-transition), border-color var(--cnt-transition);
}

.cnt-section-nav a:hover {
    color: var(--cnt-text);
}

.cnt-section-nav a.active {
    color: var(--cnt-brand);
    font-weight: 600;
    border-bottom-color: var(--cnt-brand);
}

/* Right side */
.cnt-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Header search form */
.cnt-search-form {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--cnt-card-bg);
    border: 1px solid #D7D7D7;
    border-radius: 200px;
    padding: 10px 16px;
    margin-bottom: 16px;
    transition: border-color var(--cnt-transition);
}

.cnt-search-form:focus-within {
    border-color: var(--cnt-brand);
}

.cnt-search-form input {
    border: none;
    outline: none;
    background: transparent;
    font-size: 14px;
    flex: 1;
    color: var(--cnt-text);
}

.cnt-search-form input::placeholder {
    color: var(--cnt-text-light);
}

.cnt-search-form button {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.cnt-search-form button img {
    width: 16px;
    height: 16px;
    opacity: 0.5;
}

/* Header nav icons */
.cnt-header-nav {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}

.cnt-header-profile-link {
    display: flex;
    align-items: center;
}

.cnt-header-profile-link img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color var(--cnt-transition);
}

.cnt-header-profile-link img:hover {
    border-color: var(--cnt-brand);
}

.cnt-header-notification {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    position: relative;
}

.cnt-header-notification img {
    width: 22px;
    height: 22px;
    opacity: 0.6;
    cursor: pointer;
    transition: opacity var(--cnt-transition);
}

.cnt-header-notification img:hover {
    opacity: 1;
}

.cnt-login-link {
    font-size: 14px;
    font-weight: 600;
    color: var(--cnt-brand);
    white-space: nowrap;
    transition: opacity var(--cnt-transition);
}

.cnt-login-link:hover {
    opacity: 0.8;
}

/* ----- 3. CTA Button (Figma: teal gradient, full-width, top) ----- */
.cnt-cta-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 20px;
    background: var(--cnt-brand-gradient);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 28px;
    cursor: pointer;
    margin-bottom: 16px;
    transition: opacity var(--cnt-transition), box-shadow var(--cnt-transition);
    box-shadow: 0 2px 12px rgba(0, 210, 194, 0.25);
}

.cnt-cta-btn:hover {
    opacity: 0.92;
    box-shadow: 0 4px 16px rgba(0, 210, 194, 0.35);
}

.cnt-cta-btn .cnt-cta-icon {
    font-size: 16px;
}

/* ----- 4. (Header search only — inner search consolidated to header) ----- */

/* ----- 5. Category Tabs ----- */
.cnt-category-tabs {
    display: flex;
    gap: 8px;
    padding: 16px 0 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.cnt-category-tabs::-webkit-scrollbar {
    display: none;
}

.cnt-cat-tab {
    flex-shrink: 0;
    padding: 12px 28px;
    font-size: 16px;
    font-weight: 400;
    border-radius: 100px;
    border: none;
    color: var(--cnt-text-light);
    background: var(--cnt-card-bg);
    cursor: pointer;
    transition: all var(--cnt-transition);
    white-space: nowrap;
}

.cnt-cat-tab:hover {
    border-color: var(--cnt-brand);
    color: var(--cnt-brand);
}

.cnt-cat-tab.active {
    background: var(--cnt-brand);
    color: #fff;
    border-color: var(--cnt-brand);
}

/* ----- 6. Write Placeholder ----- */
.cnt-write-placeholder {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--cnt-card-bg);
    border-radius: var(--cnt-radius);
    padding: 20px;
    cursor: pointer;
    margin-bottom: 16px;
    box-shadow: var(--cnt-shadow);
    transition: box-shadow var(--cnt-transition);
}

.cnt-write-placeholder:hover {
    box-shadow: var(--cnt-shadow-lg);
}

.cnt-write-placeholder img,
.cnt-write-placeholder-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.cnt-write-placeholder span {
    color: var(--cnt-text-dimmed);
    font-size: 24px;
    font-weight: 400;
}

/* ----- 7. Post Card ----- */
.cnt-post-card {
    background: var(--cnt-card-bg);
    border-radius: var(--cnt-radius);
    box-shadow: var(--cnt-shadow);
    padding: 20px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: box-shadow var(--cnt-transition);
}

.cnt-post-card:hover {
    box-shadow: var(--cnt-shadow-lg);
}

/* Post header: profile + name + date + category */
.cnt-post-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
}

.cnt-author-img {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    cursor: pointer;
}

.cnt-post-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.cnt-author-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--cnt-brand);
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.3;
}

/* Adviser badge — Figma: pill bg #E1F5FA, text #02AED5 */
.cnt-adviser-badge {
    display: inline-block;
    font-size: 8px;
    font-weight: 600;
    color: var(--cnt-adviser-color);
    background: var(--cnt-adviser-bg);
    padding: 2px 8px;
    border-radius: 12px;
    vertical-align: middle;
    margin-left: 6px;
}

/* Adviser name uses blue instead of teal */
.cnt-author-name.adviser {
    color: var(--cnt-adviser-color);
}

.cnt-author-name:hover {
    text-decoration: underline;
}

.cnt-post-date {
    font-size: 12px;
    color: var(--cnt-text-light);
}

.cnt-post-dot {
    font-size: 12px;
    color: var(--cnt-text-light);
}

.cnt-post-info {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--cnt-text-light);
}

.cnt-post-info .cnt-dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--cnt-text-light);
}

.cnt-post-category {
    font-size: 11px;
    font-weight: 500;
    color: var(--cnt-brand);
    background: rgba(0, 210, 194, 0.08);
    padding: 2px 8px;
    border-radius: 10px;
}

/* Post body */
.cnt-post-body-link {
    display: block;
    color: inherit;
}

.cnt-post-body {
    font-size: 18px;
    line-height: 1.7;
    color: var(--cnt-text);
    margin-bottom: 10px;
    word-break: break-word;
}

.cnt-post-body.truncated {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Post images grid — matches get_qna_list.php classes */
.cnt-post-images {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
    border-radius: var(--cnt-radius-sm);
    overflow: hidden;
    margin-bottom: 10px;
}

.cnt-post-images.cnt-img-count-1 {
    grid-template-columns: 1fr;
}

.cnt-post-images.cnt-img-count-3 {
    grid-template-columns: 1fr 1fr;
}

.cnt-img-item {
    position: relative;
    padding-top: 100%;
    overflow: hidden;
}

.cnt-post-images.cnt-img-count-1 .cnt-img-item {
    padding-top: 56%;
}

.cnt-img-item img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--cnt-radius);
    border: 1px solid #DBDBDB;
}

.cnt-img-item.cnt-img-more::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
    font-weight: 700;
}

/* Post footer: like + comment counts */
.cnt-post-footer {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-top: 10px;
}

.cnt-like-btn,
.cnt-comment-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: var(--cnt-text-light);
    padding: 4px 0;
    transition: color var(--cnt-transition);
}

.cnt-like-btn:hover,
.cnt-comment-btn:hover {
    color: var(--cnt-text);
}

.cnt-like-btn .cnt-icon,
.cnt-comment-link .cnt-icon,
.cnt-comment-count-display .cnt-icon {
    width: 24px;
    height: 24px;
    transition: opacity var(--cnt-transition);
    flex-shrink: 0;
}

/* Heart toggle: empty by default, filled when liked */
.cnt-like-btn .cnt-icon-heart-filled {
    display: none;
}

.cnt-like-btn .cnt-icon-heart-empty {
    display: inline;
    opacity: 0.5;
}

.cnt-like-btn.liked .cnt-icon-heart-filled {
    display: inline;
    opacity: 1;
}

.cnt-like-btn.liked .cnt-icon-heart-empty {
    display: none;
}

.cnt-like-btn.liked {
    color: var(--cnt-liked-color);
}

.cnt-comment-link {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: var(--cnt-text-light);
}

.cnt-comment-link .cnt-icon {
    opacity: 0.5;
}

.cnt-img-extra {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    z-index: 2;
}

/* ----- 8. Post Detail (get_qna_details.php) ----- */
.cnt-detail-post {
    background: var(--cnt-card-bg);
    border-radius: var(--cnt-radius);
    box-shadow: var(--cnt-shadow);
    padding: 20px;
    margin-bottom: 4px;
}

.cnt-detail-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
}

.cnt-detail-header .cnt-author-img {
    width: 44px;
    height: 44px;
}

.cnt-detail-body {
    font-size: 15px;
    line-height: 1.7;
    color: var(--cnt-text);
    margin-bottom: 12px;
    word-break: break-word;
}

.cnt-detail-body p {
    margin: 0;
}

.cnt-detail-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 6px;
    border-radius: var(--cnt-radius-sm);
    overflow: hidden;
    margin-bottom: 12px;
}

.cnt-detail-img {
    border-radius: var(--cnt-radius-sm);
    overflow: hidden;
}

.cnt-detail-img img {
    width: 100%;
    height: auto;
    display: block;
    cursor: pointer;
}

.cnt-detail-footer {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-top: 10px;
}

.cnt-comment-count-display {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: var(--cnt-text-light);
}

.cnt-comment-count-display .cnt-icon {
    width: 24px;
    height: 24px;
    opacity: 0.5;
}

/* ----- 9. Comments Section ----- */
.cnt-comments-section {
    background: var(--cnt-card-bg);
    border-radius: var(--cnt-radius);
    box-shadow: var(--cnt-shadow);
    padding: 8px 20px;
    margin-bottom: 16px;
}

.cnt-comment-item {
    padding: 14px 0;
    border-bottom: 1px solid var(--cnt-border);
}

.cnt-comment-item:last-child {
    border-bottom: none;
}

.cnt-comment-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.cnt-comment-header .cnt-author-img {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.cnt-comment-meta {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.cnt-comment-meta .cnt-author-name {
    font-size: 13px;
}

.cnt-comment-meta .cnt-post-date {
    font-size: 11px;
}

.cnt-comment-body {
    font-size: 14px;
    color: var(--cnt-text);
    line-height: 1.6;
    margin-bottom: 8px;
    word-break: break-word;
    padding-left: 44px;
}

.cnt-comment-body .cnt-mention {
    color: var(--cnt-brand);
    font-weight: 600;
}

.cnt-comment-footer {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-left: 44px;
}

.cnt-comment-action {
    background: none;
    border: none;
    font-size: 14px;
    color: var(--cnt-text-light);
    cursor: pointer;
    padding: 2px 4px;
    margin-left: auto;
    transition: color var(--cnt-transition);
}

.cnt-comment-action:hover {
    color: var(--cnt-text);
}

.cnt-reply-toggle {
    font-size: 12px;
    color: var(--cnt-text-light);
    cursor: pointer;
    transition: color var(--cnt-transition);
}

.cnt-reply-toggle:hover {
    color: var(--cnt-brand);
}

/* Reply (indented) */
.cnt-reply-item {
    padding: 10px 0 10px 44px;
    border-bottom: 1px solid var(--cnt-border);
}

.cnt-reply-item:last-child {
    border-bottom: none;
}

.cnt-reply-item .cnt-author-img {
    width: 28px;
    height: 28px;
}

.cnt-reply-item .cnt-comment-body {
    padding-left: 38px;
}

.cnt-reply-item .cnt-comment-footer {
    padding-left: 38px;
}

/* Reply form */
.cnt-reply-form {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 8px 0 4px 44px;
}

.cnt-reply-form.open {
    display: flex;
}

.cnt-reply-input {
    flex: 1;
    border: 1px solid var(--cnt-border);
    border-radius: 24px;
    padding: 8px 14px;
    font-size: 13px;
    outline: none;
    transition: border-color var(--cnt-transition);
}

.cnt-reply-input:focus {
    border-color: var(--cnt-brand);
}

.cnt-reply-send {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--cnt-brand);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #fff;
    font-size: 14px;
    transition: background var(--cnt-transition);
}

.cnt-reply-send:hover {
    background: var(--cnt-brand-dark);
}

/* ----- 10. Comment Input (bottom bar) ----- */
.cnt-comment-input-wrap {
    position: sticky;
    bottom: 0;
    background: var(--cnt-card-bg);
    border-top: 1px solid var(--cnt-border);
    padding: 10px;
    z-index: 10;
}

.cnt-comment-input-wrap form {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cnt-comment-input-wrap input {
    flex: 1;
    border: 1px solid var(--cnt-border);
    border-radius: 24px;
    padding: 10px 16px;
    font-size: 14px;
    outline: none;
    transition: border-color var(--cnt-transition);
}

.cnt-comment-input-wrap input::placeholder {
    color: var(--cnt-text-light);
}

.cnt-comment-input-wrap input:focus {
    border-color: var(--cnt-brand);
}

.cnt-comment-send {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--cnt-brand);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #fff;
    font-size: 16px;
    transition: background var(--cnt-transition), transform var(--cnt-transition);
}

.cnt-comment-send:hover {
    background: var(--cnt-brand-dark);
    transform: scale(1.05);
}

/* ----- 11. 3-Dot Menu ----- */
.cnt-dots-wrapper {
    position: relative;
    margin-left: auto;
    flex-shrink: 0;
}

.cnt-dots-trigger {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    font-size: 20px;
    color: var(--cnt-text-light);
    letter-spacing: 2px;
    line-height: 1;
    transition: color var(--cnt-transition);
}

.cnt-dots-trigger:hover {
    color: var(--cnt-text);
}

.cnt-dots-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 50;
    min-width: 160px;
    background: var(--cnt-card-bg);
    border-radius: var(--cnt-radius);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    border: 1px solid #EBEBEB;
    overflow: hidden;
}

.cnt-dots-menu.open {
    display: block;
}

.cnt-dots-menu a,
.cnt-dots-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    font-size: 14px;
    color: var(--cnt-text);
    cursor: pointer;
    transition: background var(--cnt-transition);
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.cnt-dots-menu a:hover,
.cnt-dots-menu-item:hover {
    background: var(--cnt-bg);
}

.cnt-dots-menu a.cnt-menu-danger,
.cnt-dots-menu-item.danger {
    color: var(--cnt-danger);
}

/* ----- 12. Modals ----- */

/* Shared overlay */
.cnt-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 200;
    align-items: center;
    justify-content: center;
}

.cnt-modal-overlay.open {
    display: flex;
}

/* Write modal — centered floating card */
#cnt-write-modal.open {
    justify-content: center;
    align-items: center;
}

.cnt-modal-card {
    background: var(--cnt-card-bg);
    border-radius: var(--cnt-radius);
    width: 90%;
    max-width: 540px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    padding: 24px;
    box-shadow: var(--cnt-shadow-lg);
}

.cnt-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 22px;
    color: var(--cnt-text-light);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background var(--cnt-transition), color var(--cnt-transition);
}

.cnt-modal-close:hover {
    background: var(--cnt-bg);
    color: var(--cnt-text);
}

.cnt-modal-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
    padding-right: 32px;
}

/* Write Modal */
.cnt-write-modal .cnt-write-category-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--cnt-border);
    border-radius: var(--cnt-radius-sm);
    font-size: 14px;
    margin-bottom: 12px;
    outline: none;
    transition: border-color var(--cnt-transition);
}

.cnt-write-modal .cnt-write-category-select:focus {
    border-color: var(--cnt-brand);
}

.cnt-write-modal .cnt-write-textarea {
    width: 100%;
    min-height: 160px;
    padding: 12px;
    border: 1px solid var(--cnt-border);
    border-radius: var(--cnt-radius-sm);
    font-size: 14px;
    resize: vertical;
    outline: none;
    font-family: inherit;
    line-height: 1.6;
    transition: border-color var(--cnt-transition);
}

.cnt-write-modal .cnt-write-textarea:focus {
    border-color: var(--cnt-brand);
}

.cnt-write-modal .cnt-write-image-row {
    display: flex;
    gap: 8px;
    margin: 12px 0;
    flex-wrap: wrap;
}

.cnt-write-modal .cnt-write-img-thumb {
    width: 72px;
    height: 72px;
    border-radius: var(--cnt-radius-sm);
    object-fit: cover;
    border: 1px solid var(--cnt-border);
}

.cnt-write-modal .cnt-write-img-add {
    width: 72px;
    height: 72px;
    border-radius: var(--cnt-radius-sm);
    border: 2px dashed var(--cnt-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--cnt-text-light);
    cursor: pointer;
    transition: border-color var(--cnt-transition), color var(--cnt-transition);
}

.cnt-write-modal .cnt-write-img-add:hover {
    border-color: var(--cnt-brand);
    color: var(--cnt-brand);
}

.cnt-write-modal .cnt-write-submit {
    width: 100%;
    padding: 12px;
    background: var(--cnt-brand-gradient);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: var(--cnt-radius-sm);
    cursor: pointer;
    margin-top: 12px;
    transition: opacity var(--cnt-transition);
}

.cnt-write-modal .cnt-write-submit:hover {
    opacity: 0.92;
}

.cnt-write-modal .cnt-write-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ----- Write Page (cnt_qna_writex.php) ----- */
.cnt-write-page {
    display: flex;
    justify-content: center;
    padding: 20px 0;
}

.cnt-write-card {
    background: var(--cnt-card-bg);
    border-radius: var(--cnt-radius);
    box-shadow: var(--cnt-shadow-lg);
    width: 100%;
    max-width: 560px;
    padding: 24px;
    position: relative;
}

.cnt-write-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.cnt-write-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--cnt-text);
}

.cnt-write-header .cnt-modal-close {
    font-size: 24px;
    color: var(--cnt-text-light);
    position: absolute;
    top: 16px;
    right: 20px;
}

/* Category buttons */
.cnt-write-categories {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.cnt-write-cat-btn {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid var(--cnt-border);
    border-radius: 20px;
    background: var(--cnt-card-bg);
    color: var(--cnt-text-light);
    cursor: pointer;
    transition: all var(--cnt-transition);
}

.cnt-write-cat-btn:hover {
    border-color: var(--cnt-brand);
    color: var(--cnt-brand);
}

.cnt-write-cat-btn.active {
    background: var(--cnt-brand);
    color: #fff;
    border-color: var(--cnt-brand);
}

/* Textarea */
.cnt-write-card textarea {
    width: 100%;
    min-height: 160px;
    padding: 12px;
    border: 1px solid var(--cnt-border);
    border-radius: var(--cnt-radius-sm);
    font-size: 14px;
    font-family: inherit;
    line-height: 1.6;
    resize: vertical;
    outline: none;
    transition: border-color var(--cnt-transition);
}

.cnt-write-card textarea:focus {
    border-color: var(--cnt-brand);
}

/* Attachment section */
.cnt-write-attachment {
    margin-top: 16px;
    border: 1px solid var(--cnt-border);
    border-radius: var(--cnt-radius-sm);
    padding: 12px;
}

.cnt-write-attach-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.cnt-attach-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--cnt-text);
}

.cnt-attach-limit {
    font-size: 12px;
    color: var(--cnt-text-light);
}

/* Upload progress bar */
.cnt-upload-progress {
    height: 4px;
    background: var(--cnt-border);
    border-radius: 2px;
    margin-bottom: 12px;
    overflow: hidden;
}

.cnt-upload-progress-bar {
    height: 100%;
    background: var(--cnt-brand);
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* Image thumbnails */
.cnt-write-images {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.cnt-write-images.dragover {
    background: rgba(0, 210, 194, 0.05);
    border-radius: var(--cnt-radius-sm);
}

.cnt-write-img-thumb {
    width: 72px;
    height: 72px;
    border-radius: var(--cnt-radius-sm);
    overflow: hidden;
    position: relative;
    border: 1px solid var(--cnt-border);
}

.cnt-write-img-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cnt-write-img-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 14px;
    line-height: 20px;
    text-align: center;
    cursor: pointer;
    padding: 0;
}

.cnt-write-img-add {
    width: 72px;
    height: 72px;
    border-radius: var(--cnt-radius-sm);
    border: 2px dashed var(--cnt-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--cnt-text-light);
    cursor: pointer;
    transition: border-color var(--cnt-transition), color var(--cnt-transition);
}

.cnt-write-img-add:hover {
    border-color: var(--cnt-brand);
    color: var(--cnt-brand);
}

/* Submit button */
.cnt-write-submit {
    width: 100%;
    padding: 12px;
    background: var(--cnt-brand-gradient);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: var(--cnt-radius-sm);
    cursor: pointer;
    margin-top: 16px;
    transition: opacity var(--cnt-transition);
}

.cnt-write-submit:hover {
    opacity: 0.92;
}

.cnt-write-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Write Modal Card — Figma 471: centered floating card */
.cnt-write-modal-card {
    max-width: 420px;
    width: 92%;
    border-radius: 16px;
    max-height: 85vh;
    height: auto;
    position: relative;
    right: auto;
    top: auto;
    padding: 24px 24px 20px;
    overflow-y: auto;
    animation: cnt-write-fadein 0.2s ease-out;
}

@keyframes cnt-write-fadein {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

.cnt-write-modal-card .cnt-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 10;
    width: 28px;
    height: 28px;
    font-size: 20px;
    color: #888;
    background: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cnt-write-modal-card .cnt-modal-close:hover {
    background: #f0f0f0;
    color: #333;
}

.cnt-write-modal-card .cnt-modal-title {
    font-size: 16px;
    font-weight: 600;
    color: #3F4342;
    margin: 0 0 16px;
    padding-right: 32px;
    text-align: center;
}

.cnt-write-modal-card .cnt-write-categories {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 14px;
}

.cnt-write-modal-card textarea {
    width: 100%;
    min-height: 100px;
    padding: 12px;
    border: 1px solid var(--cnt-border);
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    line-height: 1.6;
    resize: vertical;
    outline: none;
    transition: border-color var(--cnt-transition);
}

.cnt-write-modal-card textarea:focus {
    border-color: var(--cnt-brand);
}

/* Image previews — Figma: large stacked, full-width, rounded */
.cnt-write-modal-card .cnt-write-images {
    flex-direction: column;
    gap: 10px;
}

.cnt-write-modal-card .cnt-write-img-thumb {
    width: 100%;
    height: auto;
    max-height: 200px;
    border-radius: 10px;
}

.cnt-write-modal-card .cnt-write-img-thumb img {
    width: 100%;
    height: auto;
    max-height: 200px;
    object-fit: cover;
    border-radius: 10px;
}

.cnt-write-modal-card .cnt-write-img-add {
    width: 64px;
    height: 64px;
    align-self: flex-start;
}

.cnt-write-modal-card .cnt-write-attachment {
    margin-top: 10px;
    border-radius: 10px;
}

.cnt-write-modal-card .cnt-write-submit {
    margin-top: 12px;
    border-radius: 20px;
    padding: 13px;
    font-size: 15px;
}

.cnt-attach-size-display {
    color: var(--cnt-brand);
    font-weight: 500;
}

/* Report Modal */
.cnt-report-modal textarea {
    width: 100%;
    min-height: 100px;
    padding: 12px;
    border: 1px solid var(--cnt-border);
    border-radius: var(--cnt-radius-sm);
    font-size: 14px;
    resize: vertical;
    outline: none;
    font-family: inherit;
    margin-bottom: 12px;
    transition: border-color var(--cnt-transition);
}

.cnt-report-modal textarea:focus {
    border-color: var(--cnt-brand);
}

/* Group modal submit buttons (Create / Save / Post) */
.cnt-modal-submit {
    padding: 10px 28px;
    background: var(--cnt-brand, #00D2C2);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: opacity 0.2s;
    min-width: 100px;
}
.cnt-modal-submit:hover {
    opacity: 0.88;
}

.cnt-report-submit {
    width: 100%;
    padding: 12px;
    background: var(--cnt-danger);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: var(--cnt-radius-sm);
    cursor: pointer;
    transition: opacity var(--cnt-transition);
}

.cnt-report-submit:hover {
    opacity: 0.92;
}

.cnt-report-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Login Overlay */
/* Login overlay — always visible on login page (no .open toggle needed) */
.cnt-login-overlay {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    padding: 20px 0;
}

.cnt-login-modal {
    background: var(--cnt-card-bg);
    border-radius: var(--cnt-radius);
    width: 90%;
    max-width: 400px;
    padding: 32px 24px;
    text-align: center;
    position: relative;
    box-shadow: var(--cnt-shadow-lg);
}

.cnt-login-modal .cnt-modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 24px;
    color: var(--cnt-text-light);
    background: none;
    border: none;
    cursor: pointer;
}

.cnt-login-logo {
    font-size: 28px;
    font-weight: 700;
    color: var(--cnt-brand);
    margin-bottom: 20px;
}

.cnt-login-error {
    background: #fdecea;
    color: var(--cnt-danger);
    padding: 10px 14px;
    border-radius: var(--cnt-radius-sm);
    font-size: 13px;
    margin-bottom: 16px;
}

.cnt-login-modal label {
    display: block;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: var(--cnt-text);
    margin-bottom: 4px;
    margin-top: 12px;
}

.cnt-login-modal input[type="email"],
.cnt-login-modal input[type="password"],
.cnt-login-modal input[type="text"] {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--cnt-border);
    border-radius: var(--cnt-radius-sm);
    font-size: 14px;
    outline: none;
    transition: border-color var(--cnt-transition);
}

.cnt-login-modal input:focus {
    border-color: var(--cnt-brand);
}

.cnt-password-wrap {
    position: relative;
}

.cnt-password-wrap input {
    padding-right: 40px;
}

.cnt-pw-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 16px;
    color: var(--cnt-text-light);
    cursor: pointer;
}

.cnt-login-btn {
    width: 100%;
    padding: 12px;
    background: var(--cnt-brand-gradient);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: var(--cnt-radius-sm);
    cursor: pointer;
    margin-top: 16px;
    transition: opacity var(--cnt-transition);
}

.cnt-login-btn:hover {
    opacity: 0.92;
}

.cnt-google-login-btn {
    width: 100%;
    padding: 10px;
    background: #fff;
    border: 1px solid var(--cnt-border);
    border-radius: var(--cnt-radius-sm);
    font-size: 14px;
    color: var(--cnt-text);
    cursor: not-allowed;
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    opacity: 0.5;
}

.cnt-google-login-btn img {
    width: 18px;
    height: 18px;
}

.cnt-signup-notice {
    font-size: 12px;
    color: var(--cnt-text-light);
    margin-top: 16px;
}

.cnt-get-app {
    font-size: 13px;
    font-weight: 600;
    color: var(--cnt-text);
    margin-top: 8px;
}

.cnt-app-badges {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
}

.cnt-app-badges img {
    height: 36px;
    width: auto;
}

/* ----- 13. Profile Panel ----- */
/* (Main profile panel styles are in Section 22 below — Figma floating card) */

/* ----- 14. Notification Dropdown ----- */
.cnt-notification-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 320px;
    max-height: 400px;
    overflow-y: auto;
    background: var(--cnt-card-bg);
    border-radius: var(--cnt-radius);
    box-shadow: var(--cnt-shadow-lg);
    border: 1px solid var(--cnt-border);
    z-index: 1000;
}

.cnt-notification-dropdown.open {
    display: block;
}

.cnt-notification-header {
    padding: 14px 16px;
    font-size: 15px;
    font-weight: 700;
    border-bottom: 1px solid var(--cnt-border);
    width: 100%;
    box-sizing: border-box;
}

.cnt-notification-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--cnt-border);
    cursor: pointer;
    transition: background var(--cnt-transition);
}

.cnt-notification-item:last-child {
    border-bottom: none;
}

.cnt-notification-item:hover {
    background: var(--cnt-bg);
}

.cnt-notification-item.unread {
    background: rgba(0, 210, 194, 0.04);
}

.cnt-notification-item .cnt-noti-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.cnt-notification-item .cnt-noti-text {
    font-size: 13px;
    color: var(--cnt-text);
    line-height: 1.4;
}

.cnt-notification-item .cnt-noti-time {
    font-size: 11px;
    color: var(--cnt-text-light);
}

.cnt-notification-empty {
    padding: 32px 16px;
    text-align: center;
    font-size: 14px;
    color: var(--cnt-text-light);
}

/* ----- 15. Footer ----- */
.cnt-footer {
    background: var(--cnt-card-bg);
    border-top: 1px solid var(--cnt-border);
    padding: 24px 16px;
    margin-top: 32px;
    font-size: 12px;
    color: var(--cnt-text-light);
}

.cnt-footer-inner {
    max-width: 960px;
    margin: 0 auto;
}

.cnt-company-info {
    margin-bottom: 12px;
    line-height: 1.8;
}

.cnt-company-name {
    font-weight: 600;
    color: var(--cnt-text);
    margin-bottom: 2px;
}

.cnt-footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    border-top: 1px solid var(--cnt-border);
}

.cnt-copyright {
    font-size: 11px;
    color: #bbb;
}

.cnt-footer-nav {
    display: flex;
    gap: 16px;
}

.cnt-footer-nav a {
    font-size: 12px;
    color: var(--cnt-text-light);
    transition: color var(--cnt-transition);
}

.cnt-footer-nav a:hover {
    color: var(--cnt-text);
}

/* ----- 16. Responsive ----- */

/* Tablet landscape */
@media (max-width: 992px) {
    .cnt-wrapper {
        max-width: 100%;
    }

    .cnt-notification-dropdown {
        width: 300px;
    }
}

/* Tablet portrait / large phone */
@media (max-width: 743px) {
    .cnt-wrapper {
        max-width: 100%;
        padding: 0 12px;
    }

    .cnt-header-top {
        padding: 8px 0;
    }

    .cnt-nav-tabs {
        gap: 14px;
        margin-left: 12px;
    }

    .cnt-nav-tab {
        font-size: 14px;
    }

    .cnt-post-detail {
        padding: 16px;
    }

    .cnt-post-detail .cnt-author-img {
        width: 42px;
        height: 42px;
    }

    .cnt-notification-dropdown {
        position: fixed;
        top: 56px;
        right: 0;
        left: 0;
        width: 100%;
        max-height: calc(100vh - 56px);
        border-radius: 0;
    }

    .cnt-modal-card {
        width: 95%;
        padding: 20px 16px;
    }

}

/* Phone */
@media (max-width: 599px) {
    .cnt-header-top {
        padding: 6px 0;
    }

    .cnt-logo {
        height: 24px;
    }

    .cnt-nav-tabs {
        gap: 10px;
        margin-left: 8px;
    }

    .cnt-nav-tab {
        font-size: 13px;
    }

    .cnt-post-card {
        padding: 14px;
        border-radius: var(--cnt-radius-sm);
    }

    .cnt-post-header .cnt-author-img {
        width: 34px;
        height: 34px;
    }

    .cnt-author-name {
        font-size: 13px;
    }

    .cnt-post-body {
        font-size: 13px;
    }

    .cnt-post-detail {
        padding: 14px;
        border-radius: var(--cnt-radius-sm);
    }

    .cnt-post-detail .cnt-author-img {
        width: 38px;
        height: 38px;
    }

    .cnt-comment-item {
        gap: 8px;
    }

    .cnt-comment-avatar {
        width: 30px;
        height: 30px;
    }

    .cnt-reply-item {
        padding-left: 38px;
    }

    .cnt-reply-item .cnt-comment-avatar {
        width: 24px;
        height: 24px;
    }

    .cnt-write-placeholder img {
        width: 32px;
        height: 32px;
    }

    .cnt-modal-card {
        width: 100%;
        max-width: 100%;
        border-radius: var(--cnt-radius) var(--cnt-radius) 0 0;
        max-height: 85vh;
        position: fixed;
        bottom: 0;
    }

    .cnt-modal-overlay.open {
        align-items: flex-end;
    }

    /* Write modal stays centered on mobile too */
    .cnt-write-modal-card {
        position: relative;
        bottom: auto;
        width: 95%;
        max-height: 90vh;
        border-radius: 16px;
    }

    #cnt-write-modal.open {
        align-items: center;
        justify-content: center;
    }

    .cnt-login-card {
        width: 100%;
        border-radius: var(--cnt-radius) var(--cnt-radius) 0 0;
        position: fixed;
        bottom: 0;
    }

    .cnt-login-overlay.open {
        align-items: flex-end;
    }

    .cnt-cta-btn {
        padding: 12px 16px;
        font-size: 14px;
        margin-bottom: 12px;
    }

    .cnt-category-tabs {
        gap: 6px;
        padding: 6px 0 12px;
    }

    .cnt-cat-tab {
        padding: 5px 12px;
        font-size: 12px;
    }

    .cnt-footer {
        padding: 16px 0;
    }
}

/* ----- 17. Utility ----- */
.cnt-no-posts {
    text-align: center;
    padding: 48px 16px;
    color: var(--cnt-text-light);
    font-size: 15px;
}

.cnt-no-posts img {
    width: 80px;
    opacity: 0.3;
    margin-bottom: 12px;
}

/* Loading spinner */
.cnt-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 0;
}

.cnt-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--cnt-border);
    border-top-color: var(--cnt-brand);
    border-radius: 50%;
    animation: cnt-spin 0.7s linear infinite;
}

@keyframes cnt-spin {
    to { transform: rotate(360deg); }
}

/* Fade-in for dynamic content */
.cnt-fade-in {
    animation: cnt-fadein 0.3s ease;
}

@keyframes cnt-fadein {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Skeleton placeholder */
.cnt-skeleton {
    background: linear-gradient(90deg, #eee 25%, #f5f5f5 50%, #eee 75%);
    background-size: 200% 100%;
    animation: cnt-shimmer 1.5s infinite;
    border-radius: var(--cnt-radius-sm);
}

@keyframes cnt-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.cnt-skeleton-card {
    height: 160px;
    margin-bottom: 12px;
}

.cnt-skeleton-line {
    height: 14px;
    margin-bottom: 8px;
}

.cnt-skeleton-line.short {
    width: 60%;
}

.cnt-skeleton-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

/* Infinite scroll sentinel */
.cnt-scroll-sentinel {
    height: 1px;
}

/* Visibility helpers */
.cnt-hidden {
    display: none !important;
}

.cnt-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Truncate text */
.cnt-ellipsis {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ----- 18. Notification Badge ----- */
/* (cnt-header-notification position:relative is in Section 2 above) */

.cnt-notf-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--cnt-danger);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    line-height: 16px;
    border-radius: 8px;
    text-align: center;
    padding: 0 4px;
}

/* ----- 19. (Consolidated into Section 14 above) ----- */

/* ----- 20. Profile Page ----- */
.cnt-profile-page {
    padding-top: 16px;
}

.cnt-profile-card {
    background: var(--cnt-card-bg);
    border-radius: var(--cnt-radius);
    box-shadow: var(--cnt-shadow);
    padding: 24px;
    margin-bottom: 16px;
}

.cnt-profile-header {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.cnt-profile-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.cnt-profile-info {
    flex: 1;
    min-width: 0;
}

.cnt-profile-name {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
}

.cnt-profile-bio {
    font-size: 14px;
    color: var(--cnt-text-light);
    margin-bottom: 8px;
}

.cnt-profile-stat {
    font-size: 13px;
    color: var(--cnt-brand);
    font-weight: 600;
}

/* ----- 21. Search Result Title ----- */
.cnt-search-result-title {
    font-size: 16px;
    font-weight: 600;
    padding: 12px 0 8px;
    color: var(--cnt-text);
}

@media (max-width: 599px) {
    .cnt-notification-dropdown {
        width: 100%;
        right: -8px;
        top: 44px;
    }

    .cnt-profile-avatar {
        width: 56px;
        height: 56px;
    }

    .cnt-profile-name {
        font-size: 17px;
    }
}


/* ============================================================
   Profile Panel (Figma 07, 09, 10 — floating card overlay)
   ============================================================ */

/* Backdrop */
.cnt-profile-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1100;
    background: rgba(0,0,0,0.15);
}
.cnt-profile-backdrop.open {
    display: block;
}

/* Panel */
.cnt-profile-panel {
    display: none;
    position: fixed;
    top: 70px;
    left: 50px;
    width: 300px;
    max-height: calc(100vh - 90px);
    overflow-y: auto;
    z-index: 1110;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    padding: 0;
    animation: cnt-profile-slidein 0.25s ease-out;
}
.cnt-profile-panel.open {
    display: block;
}
@keyframes cnt-profile-slidein {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.cnt-profile-panel-inner {
    padding: 20px 20px 16px;
}

/* Close button */
.cnt-profile-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: none;
    border: none;
    font-size: 22px;
    color: #999;
    cursor: pointer;
    line-height: 1;
    z-index: 2;
}
.cnt-profile-close:hover {
    color: #333;
}

/* Header section: info + avatar */
.cnt-profile-header-section {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}
.cnt-profile-info-col {
    flex: 1;
    min-width: 0;
}
.cnt-profile-display-name {
    font-size: 20px;
    font-weight: 700;
    color: #00D2C2;
    margin: 0 0 6px;
    line-height: 1.2;
}
/* Meta items — Figma: 18px/400 #3F4342 (scaled to 13px for panel) */
.cnt-profile-meta-item {
    font-size: 13px;
    color: #3F4342;
    margin: 3px 0;
    display: flex;
    align-items: flex-start;
    gap: 5px;
    line-height: 1.4;
}
.cnt-profile-icon {
    font-size: 13px;
    width: 18px;
    text-align: center;
    flex-shrink: 0;
    color: #8D8D8D;
}

/* Avatar */
.cnt-profile-avatar-col {
    flex-shrink: 0;
}
.cnt-profile-avatar-wrap {
    position: relative;
    width: 80px;
    height: 80px;
}
.cnt-profile-avatar-img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #eee;
}
.cnt-profile-camera {
    position: absolute;
    bottom: 0;
    right: 0;
    background: #00D2C2;
    color: #fff;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    border: 2px solid #fff;
    cursor: pointer;
}

/* Action buttons */
.cnt-profile-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

/* Meeting button — Figma: full-width, #D7D7D7 border, radius 25 */
.cnt-profile-meeting-btn {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 140px;
    padding: 9px 20px;
    border: 1.5px solid #D7D7D7;
    border-radius: 25px;
    background: #fff;
    color: #00D2C2;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.cnt-profile-meeting-btn:hover {
    border-color: #00D2C2;
    background: #f0fffe;
}
.cnt-profile-meeting-btn .cnt-meeting-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border: 2px solid #00D2C2;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
}

/* Meeting actions: Chat + Video Call side by side */
.cnt-profile-meeting-actions {
    display: flex;
    gap: 8px;
    width: 100%;
}
.cnt-profile-meeting-actions .cnt-profile-meeting-btn {
    flex: 1;
    text-decoration: none;
    min-width: 0;
}
.cnt-profile-meeting-btn-video {
    color: #00B8AA !important;
}
.cnt-profile-meeting-btn-video .cnt-meeting-icon {
    border-color: #00B8AA;
}

/* Adviser consult buttons — Figma: white bg, #E0E3E2 stroke, radius 15 */
.cnt-profile-consult-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 14px 8px 10px;
    border: 1px solid #E0E3E2;
    border-radius: 15px;
    background: #fff;
    color: #3F4342;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.cnt-profile-consult-btn:hover {
    border-color: #00D2C2;
    box-shadow: 0 2px 8px rgba(0,210,194,0.12);
}
.cnt-profile-action-icon {
    font-size: 22px;
    color: #00D2C2;
}
/* Figma: price text is teal #02AED5 (Advice) → #00D2C2 (Connect brand) */
.cnt-profile-consult-btn small {
    color: #00D2C2;
    font-weight: 400;
    font-size: 11px;
}

/* Tabs — Figma: active #00D2C2 + teal underline, inactive #878787 */
.cnt-profile-tabs {
    display: flex;
    border-bottom: 2px solid #eee;
    margin-bottom: 12px;
}
.cnt-profile-tab {
    flex: none;
    background: none;
    border: none;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 400;
    color: #878787;
    cursor: pointer;
    border-bottom: 2.5px solid transparent;
    margin-bottom: -2px;
    transition: color 0.15s, border-color 0.15s;
}
.cnt-profile-tab:hover {
    color: #555;
}
.cnt-profile-tab.active {
    color: #00D2C2;
    border-bottom-color: #00D2C2;
    font-weight: 600;
}

/* Tab content */
.cnt-profile-tab-content {
    display: none;
}
.cnt-profile-tab-content.active {
    display: block;
}

/* Sections — Figma: h4 bold #000, p #3F4342 */
.cnt-profile-section {
    margin-bottom: 16px;
}
.cnt-profile-section h4 {
    font-size: 14px;
    font-weight: 700;
    color: #000;
    margin: 0 0 6px;
}
.cnt-profile-section p {
    font-size: 13px;
    color: #3F4342;
    margin: 0;
    line-height: 1.6;
}
.cnt-profile-placeholder {
    color: #00D2C2 !important;
    cursor: pointer;
    font-weight: 500;
}
.cnt-profile-empty {
    color: #bbb !important;
    font-style: italic;
}
.cnt-profile-keywords {
    color: #00D2C2 !important;
    font-weight: 500;
}

/* Reflection list in profile panel */
.cnt-profile-reflection-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.cnt-profile-reflection-item {
    border-bottom: 1px solid #f0f0f0;
}
.cnt-profile-reflection-item:last-child {
    border-bottom: none;
}
.cnt-profile-reflection-link {
    display: block;
    padding: 12px 0;
    text-decoration: none;
    color: inherit;
}
.cnt-profile-reflection-link:hover {
    background: #fafafa;
}
.cnt-profile-reflection-cat {
    font-size: 11px;
    font-weight: 600;
    color: #00D2C2;
}
.cnt-profile-reflection-text {
    font-size: 13px;
    line-height: 1.5;
    color: #333;
    margin: 4px 0 6px;
    word-break: break-word;
}
.cnt-profile-reflection-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: #aaa;
}

/* Bottom actions — Figma: Followers btn outline, Follow btn teal filled */
.cnt-profile-bottom {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}
.cnt-profile-follow-btn {
    width: 100%;
    padding: 10px;
    border: 2px solid #00D2C2;
    border-radius: 8px;
    background: #00D2C2;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.cnt-profile-follow-btn:hover {
    background: #00c0b1;
}
.cnt-profile-follow-btn.following {
    background: #fff;
    color: #00D2C2;
}
.cnt-profile-follow-btn.following:hover {
    background: #f0fffe;
}
.cnt-profile-followers-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 140px;
    padding: 10px 24px;
    border: 2px solid #3F4342;
    border-radius: 8px;
    background: #fff;
    color: #3F4342;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: border-color 0.15s, color 0.15s;
}
.cnt-profile-followers-btn:hover {
    border-color: #00D2C2;
    color: #00D2C2;
}
.cnt-profile-edit-notice {
    font-size: 12px;
    color: #717171;
    text-align: center;
    margin: 0;
    font-weight: 600;
}
.cnt-profile-history-link {
    display: block;
    text-align: center;
    font-size: 13px;
    color: #00D2C2;
    text-decoration: none;
    font-weight: 600;
    padding: 6px 0;
}
.cnt-profile-logout-btn {
    display: block;
    text-align: center;
    font-size: 16px;
    font-weight: 800;
    color: #00D2C2;
    text-decoration: none;
    cursor: pointer;
    padding: 4px 0;
    transition: opacity 0.15s;
}
.cnt-profile-logout-btn:hover {
    opacity: 0.7;
}
.cnt-profile-error {
    padding: 20px;
    text-align: center;
    color: #999;
}

/* ============================================================
   Post Detail Modal (Figma — centered floating card)
   ============================================================ */

/* Backdrop */
.cnt-detail-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 800;
    background: rgba(0, 0, 0, 0.35);
}
.cnt-detail-backdrop.open {
    display: block;
}

/* Modal — centered floating card */
.cnt-detail-panel {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 480px;
    max-width: calc(100% - 32px);
    max-height: 85vh;
    z-index: 810;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    animation: cnt-detail-fadein 0.2s ease-out;
}
.cnt-detail-panel.open {
    display: flex;
    flex-direction: column;
}
@keyframes cnt-detail-fadein {
    from { opacity: 0; transform: translate(-50%, -48%); }
    to   { opacity: 1; transform: translate(-50%, -50%); }
}

/* Close button — top right corner */
.cnt-detail-panel-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    font-size: 22px;
    color: #888;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    z-index: 5;
    transition: background 0.15s, color 0.15s;
}
.cnt-detail-panel-close:hover {
    background: #f0f0f0;
    color: #333;
}

/* Body (scrollable content) */
.cnt-detail-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

/* Inside modal: post detail */
.cnt-detail-panel .cnt-detail-post {
    box-shadow: none;
    border-radius: 0;
    padding: 20px 24px 16px;
    margin-bottom: 0;
    border-bottom: none;
    position: relative;
}

.cnt-detail-panel .cnt-post-header {
    padding-right: 36px;
}

.cnt-detail-panel .cnt-author-img {
    width: 40px;
    height: 40px;
}

.cnt-detail-panel .cnt-author-name {
    font-size: 14px;
}

.cnt-detail-panel .cnt-detail-body {
    font-size: 14px;
    line-height: 1.65;
}

.cnt-detail-panel .cnt-post-date {
    font-size: 11px;
}

.cnt-detail-panel .cnt-detail-images img {
    border-radius: 10px;
}

/* Inside modal: comments */
.cnt-detail-panel .cnt-comments-section {
    box-shadow: none;
    border-radius: 0;
    padding: 4px 24px;
    margin-bottom: 0;
}

.cnt-detail-panel .cnt-comment-item {
    padding: 12px 0;
    border-bottom: 1px solid #f5f5f5;
}

.cnt-detail-panel .cnt-comment-item:last-child {
    border-bottom: none;
}

.cnt-detail-panel .cnt-comment-header .cnt-author-img {
    width: 32px;
    height: 32px;
}

.cnt-detail-panel .cnt-comment-meta .cnt-author-name {
    font-size: 13px;
}

.cnt-detail-panel .cnt-comment-body {
    font-size: 13px;
    padding-left: 42px;
}

.cnt-detail-panel .cnt-comment-footer {
    padding-left: 42px;
    font-size: 12px;
}

.cnt-detail-panel .cnt-reply-item .cnt-author-img {
    width: 28px;
    height: 28px;
}

.cnt-detail-panel .cnt-reply-item .cnt-comment-body {
    padding-left: 38px;
}

.cnt-detail-panel .cnt-reply-item .cnt-comment-footer {
    padding-left: 38px;
}

/* Comment input — bottom sticky, pill style with circular send */
.cnt-detail-panel-footer {
    position: sticky;
    bottom: 0;
    background: #fff;
    border-top: 1px solid #f0f0f0;
    padding: 12px 20px;
    z-index: 2;
}

.cnt-detail-panel-footer form {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cnt-detail-panel-footer input {
    flex: 1;
    border: 1px solid #e0e3e2;
    border-radius: 24px;
    padding: 10px 16px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.15s;
}

.cnt-detail-panel-footer input::placeholder {
    color: #abafae;
}

.cnt-detail-panel-footer input:focus {
    border-color: var(--cnt-brand);
}

.cnt-detail-panel-footer .cnt-comment-send {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--cnt-brand);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: opacity 0.15s;
}

.cnt-detail-panel-footer .cnt-comment-send:hover {
    opacity: 0.85;
}

.cnt-detail-panel-footer .cnt-comment-send svg {
    stroke: #fff;
}

/* Three-dots menu inside detail modal */
.cnt-detail-panel .cnt-dots-wrapper {
    position: absolute;
    top: 16px;
    right: 44px;
    z-index: 4;
}

.cnt-detail-panel .cnt-dots-menu {
    right: 0;
    top: 100%;
    min-width: 150px;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

/* Delete Confirmation Dialog — Figma */
#cnt-delete-confirm-modal {
    z-index: 920;
}

.cnt-delete-confirm-card {
    background: #fff;
    border-radius: 16px;
    padding: 28px 24px 20px;
    max-width: 320px;
    width: 90%;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}

.cnt-delete-confirm-card h3 {
    font-size: 18px;
    font-weight: 700;
    color: #3F4342;
    margin: 0 0 12px;
}

.cnt-delete-confirm-card p {
    font-size: 13px;
    color: #717171;
    line-height: 1.6;
    margin: 0 0 20px;
}

.cnt-delete-confirm-btn {
    display: block;
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 24px;
    background: var(--cnt-brand);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 8px;
    transition: opacity 0.15s;
}

.cnt-delete-confirm-btn:hover {
    opacity: 0.9;
}

.cnt-delete-cancel-btn {
    display: block;
    width: 100%;
    padding: 12px;
    border: 1.5px solid #D7D7D7;
    border-radius: 24px;
    background: #fff;
    color: #3F4342;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.15s;
}

.cnt-delete-cancel-btn:hover {
    border-color: #aaa;
}

/* Modal responsive: full-width on mobile */
@media (max-width: 599px) {
    .cnt-detail-panel {
        width: calc(100% - 16px);
        max-height: 85vh;
    }
}

@media (max-width: 768px) {
    .cnt-detail-panel {
        width: calc(100% - 32px);
        max-width: 480px;
    }
}


/* Responsive */
@media (max-width: 768px) {
    .cnt-profile-panel {
        left: 50%;
        top: 60px;
        transform: translateX(-50%);
        width: calc(100% - 32px);
        max-width: 340px;
    }
    @keyframes cnt-profile-slidein {
        from { opacity: 0; transform: translateX(-50%) translateY(10px); }
        to   { opacity: 1; transform: translateX(-50%) translateY(0); }
    }
}

/* ── Infinite Scroll ── */
.cnt-scroll-sentinel {
    height: 1px;
    width: 100%;
}

.cnt-loading {
    text-align: center;
    padding: 20px 0;
}

.cnt-spinner {
    display: inline-block;
    width: 28px;
    height: 28px;
    border: 3px solid #e0e3e2;
    border-top-color: #00D2C2;
    border-radius: 50%;
    animation: cnt-spin 0.6s linear infinite;
}

@keyframes cnt-spin {
    to { transform: rotate(360deg); }
}

/* ── Image Carousel (shared with Journal) ── */
.post-image-carousel {
    position: relative;
    overflow: hidden;
    margin: 12px 0;
}

.post-image-carousel-track {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scroll-behavior: smooth;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.post-image-carousel-track::-webkit-scrollbar {
    display: none;
}

.post-image-carousel-track img {
    flex: 0 0 calc(50% - 4px);
    max-height: 300px;
    object-fit: cover;
    border-radius: 10px;
}

@media (max-width: 600px) {
    .post-image-carousel-track img {
        flex: 0 0 100%;
    }
}

.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,0.85);
    border: 1px solid #ddd;
    font-size: 16px;
    line-height: 30px;
    text-align: center;
    cursor: pointer;
    z-index: 2;
    color: #333;
    user-select: none;
}

.carousel-arrow:hover {
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.carousel-arrow-left { left: 4px; }
.carousel-arrow-right { right: 4px; }

/* List thumbnails — horizontal scroll row */
.cnt-list-thumbs {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    overflow-x: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.cnt-list-thumbs::-webkit-scrollbar {
    display: none;
}

.cnt-list-thumbs img {
    flex: 0 0 100px;
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
}

/* ── Community Top Tabs (Connect / Group) ── */
.cnt-top-tabs {
    display: flex;
    border-bottom: 1px solid #eee;
    padding: 0 16px;
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 50;
}
.cnt-top-tab {
    flex: 1;
    text-align: center;
    padding: 14px 0;
    font-size: 15px;
    font-weight: 600;
    color: #999;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}
.cnt-top-tab.active {
    color: #333;
    border-bottom-color: #333;
}
.cnt-top-tab:hover {
    color: #555;
}

/* ── Group Cards ── */
.grp-create-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 16px;
    margin: 8px 16px;
    border: 1px dashed #ccc;
    border-radius: 12px;
    cursor: pointer;
    color: #666;
    font-size: 14px;
}
.grp-create-btn:hover { background: #f9f9f9; }

.grp-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
}
.grp-card:hover { background: #fafafa; }

.grp-card-img {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background-size: cover;
    background-position: center;
    background-color: #eee;
    flex-shrink: 0;
}
.grp-card-info h4 {
    margin: 0 0 4px;
    font-size: 15px;
    font-weight: 600;
}
.grp-card-members {
    font-size: 13px;
    color: #999;
}

/* Group Sub Tabs (separate from cnt-cat-tab to avoid cnt_main.js conflict) */
.grp-sub-tab {
    flex-shrink: 0;
    padding: 12px 28px;
    font-size: 16px;
    font-weight: 400;
    border-radius: 100px;
    border: 1px solid #ddd;
    color: #666;
    text-decoration: none;
    transition: all .18s;
    display: inline-block;
}
.grp-sub-tab:hover {
    border-color: var(--cnt-brand);
    color: var(--cnt-brand);
}
.grp-sub-tab.active {
    background: var(--cnt-brand);
    color: #fff;
    border-color: var(--cnt-brand);
}

/* Mobile: 3つのグループサブタブが画面幅に均等に収まるように */
@media (max-width: 599px) {
    .grp-sub-tabs-wrap {
        gap: 6px;
        overflow-x: visible;
    }
    .grp-sub-tabs-wrap .grp-sub-tab {
        flex: 1 1 0;
        min-width: 0;
        padding: 8px 4px;
        font-size: 12px;
        text-align: center;
        white-space: nowrap;
    }
}
