/* Core containers */
.ptk-auth-container,.ptk-profile{max-width:1080px;margin:24px auto;padding:0 16px}
.ptk-card{background:#111;border:1px solid #2a2a2a;border-radius:16px;padding:20px;margin-bottom:18px;color:#fff;box-sizing:border-box}
.ptk-btn{display:inline-flex;align-items:center;justify-content:center;min-height:42px;padding:10px 18px;border:0;border-radius:10px;text-decoration:none;cursor:pointer;background:#c49a3d;color:#111;font-weight:700}
.ptk-btn-secondary{background:#2a2a2a;color:#fff}
.ptk-form-row{margin-bottom:16px}.ptk-form-row label{display:block;margin-bottom:6px;font-weight:600}
.ptk-form-row input,.ptk-form-row textarea,.ptk-form-row select{width:100%;padding:11px 12px;border:1px solid #333;border-radius:10px;background:#1b1b1b;color:#fff;box-sizing:border-box}
.ptk-form-row-inline{display:flex;align-items:center;gap:8px}
.ptk-alert{margin-bottom:16px;padding:12px 14px;border-radius:10px;font-weight:600}.ptk-alert-success{background:#0d3d25;color:#d8ffe6}.ptk-alert-error{background:#511616;color:#ffdede}.ptk-alert-warning{background:#5a4511;color:#fff1ca}
.ptk-auth-tabs{display:flex;gap:8px;margin-bottom:18px;flex-wrap:wrap}.ptk-auth-tab{padding:10px 14px;border:1px solid #333;border-radius:10px;background:#1b1b1b;color:#fff;cursor:pointer}.ptk-auth-tab.is-active{background:#c49a3d;color:#111;border-color:#c49a3d}.ptk-auth-panel{display:none}.ptk-auth-panel.is-active{display:block}
.ptk-social-login-placeholder{margin-top:14px;padding:12px;border:1px dashed #555;border-radius:10px;color:#d6d6d6;font-size:14px}
.ptk-profile-header{overflow:hidden}.ptk-profile-cover{width:100%;min-height:160px;border-radius:14px;background:linear-gradient(135deg,#1f1f1f,#2b2b2b);margin-bottom:16px;overflow:hidden}.ptk-profile-cover img{width:100%;height:240px;object-fit:cover;display:block}
.ptk-profile-summary{display:flex;gap:18px;align-items:flex-start;flex-wrap:wrap}.ptk-profile-avatar img{width:110px;height:110px;object-fit:cover;border-radius:999px;border:3px solid #c49a3d}.ptk-profile-meta h2{margin:0 0 8px}.ptk-profile-badge{margin-bottom:8px}
.ptk-badge{display:inline-flex;align-items:center;min-height:28px;padding:4px 10px;border-radius:999px;font-size:13px;font-weight:700}.ptk-badge-free{background:#343434;color:#fff}.ptk-badge-vip{background:#c49a3d;color:#111}.ptk-badge-trusted{background:#1f7a53;color:#fff}
.ptk-profile-tabs{display:flex;gap:10px;flex-wrap:wrap;margin-bottom:20px}.ptk-profile-tab{display:inline-flex;text-decoration:none;padding:10px 14px;border-radius:10px;background:#1a1a1a;border:1px solid #333;color:#fff}.ptk-profile-tab.is-active{background:#c49a3d;color:#111;border-color:#c49a3d}
.ptk-social-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:14px}.ptk-list{display:grid;gap:12px}.ptk-notification.is-unread{border-color:#c49a3d}.ptk-favorite-toggle.is-active{background:#1f7a53;color:#fff}
.ptk-media-field{display:grid;gap:12px}.ptk-media-preview{min-height:120px;border:1px dashed #444;border-radius:12px;background:#171717;display:flex;align-items:center;justify-content:center;overflow:hidden;padding:10px}.ptk-media-preview img{max-width:100%;max-height:220px;display:block;border-radius:10px}.ptk-media-placeholder{color:#bdbdbd;font-size:14px}.ptk-media-actions{display:flex;gap:10px;flex-wrap:wrap}
.ptk-dashboard-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:14px;margin-bottom:18px}.ptk-stat-card{background:#171717;border:1px solid #2f2f2f;border-radius:14px;padding:18px}.ptk-stat-label{font-size:14px;color:#d2d2d2;margin-bottom:10px}.ptk-stat-value{font-size:30px;font-weight:800;line-height:1}.ptk-dashboard-sections{display:grid;grid-template-columns:1fr 1fr;gap:18px}.ptk-quick-links{display:flex;gap:10px;flex-wrap:wrap}
@media (max-width:860px){.ptk-dashboard-sections{grid-template-columns:1fr}} @media (max-width:640px){.ptk-profile-summary{align-items:flex-start;flex-direction:column}}


.ptk-post-status-card {
    border-color: #343434;
}

.ptk-post-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.ptk-post-main {
    flex: 1 1 240px;
}

.ptk-post-main a,
.ptk-post-main span {
    color: #fff;
    text-decoration: none;
    font-weight: 600;
}

.ptk-status-badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
}

.ptk-status-pending {
    background: #5a4511;
    color: #fff1ca;
}

.ptk-status-draft {
    background: #343434;
    color: #ffffff;
}

.ptk-status-publish {
    background: #0d3d25;
    color: #d8ffe6;
}


.ptk-profile-header {
    position: relative;
}

.ptk-profile-header-tools {
    width: 100%;
    display: flex;
    justify-content: flex-end;
    margin-bottom: 10px;
}

.ptk-notification-bell-wrap {
    position: relative;
    display: inline-block;
}

.ptk-notification-bell {
    position: relative;
    min-width: 46px;
    min-height: 46px;
    border: 1px solid #333;
    border-radius: 999px;
    background: #1b1b1b;
    color: #fff;
    cursor: pointer;
}

.ptk-bell-icon {
    font-size: 18px;
    line-height: 1;
}

.ptk-bell-count {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    background: #c0392b;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ptk-notification-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 340px;
    max-width: calc(100vw - 40px);
    background: #111;
    border: 1px solid #2f2f2f;
    border-radius: 14px;
    box-shadow: 0 14px 40px rgba(0,0,0,.35);
    z-index: 9999;
    overflow: hidden;
}

.ptk-notification-dropdown-head,
.ptk-notification-dropdown-foot {
    padding: 14px 16px;
    background: #171717;
    border-bottom: 1px solid #2a2a2a;
}

.ptk-notification-dropdown-foot {
    border-top: 1px solid #2a2a2a;
    border-bottom: 0;
}

.ptk-notification-dropdown-foot a {
    color: #fff;
    text-decoration: none;
}

.ptk-notification-dropdown-list {
    max-height: 360px;
    overflow-y: auto;
}

.ptk-notification-item {
    padding: 14px 16px;
    border-bottom: 1px solid #232323;
}

.ptk-notification-item.is-unread {
    background: #16120a;
}

.ptk-notification-item-title {
    font-weight: 700;
    margin-bottom: 6px;
}

.ptk-notification-item-message {
    color: #dedede;
    font-size: 14px;
    margin-bottom: 8px;
}

.ptk-notification-item-link {
    color: #fff;
    font-size: 14px;
    text-decoration: underline;
}

.ptk-notification-empty {
    padding: 18px 16px;
    color: #ddd;
}


.ptk-dream-history-card {
    display: grid;
    gap: 8px;
}

.ptk-dream-history-head {
    color: #f0d28b;
}

.ptk-dream-history-dream {
    color: #ffffff;
    line-height: 1.6;
}

.ptk-dream-history-result {
    color: #e8e8e8;
    line-height: 1.7;
}


.ptk-logout-btn { white-space: nowrap; }

.ptk-dream-history-group {
    display: grid;
    gap: 12px;
    margin-bottom: 22px;
}
.ptk-dream-history-group-title {
    margin: 0;
    font-size: 20px;
    color: #f0d28b;
}
.ptk-dream-history-card.is-starred {
    border-color: #c49a3d;
}
.ptk-dream-history-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.ptk-dream-history-date {
    color: #d6d6d6;
    font-size: 14px;
}
.ptk-dream-history-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.ptk-history-star-btn,
.ptk-history-delete-btn {
    min-height: 34px;
    padding: 6px 10px;
    border-radius: 10px;
    border: 1px solid #333;
    background: #1b1b1b;
    color: #fff;
    cursor: pointer;
}
.ptk-history-delete-btn { border-color: #5a2a2a; }

.ptk-dream-history-card {
    display: grid;
    gap: 8px;
}
.ptk-dream-history-head { color: #f0d28b; }
.ptk-dream-history-dream,
.ptk-dream-history-result { line-height: 1.65; }
.ptk-dream-history-saved-numbers {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.ptk-saved-number-chip {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #1f7a53;
    color: #fff;
    font-weight: 700;
}

/* ===== BASE TAB ===== */
.ptk-profile-tabs a.ptk-profile-tab {
    display: inline-flex;
    align-items: center;
}

/* ===== WRAPPER ===== */
.ptk-profile-tabs a.ptk-profile-tab .ptk-chat-badge-target {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    position: relative;
    white-space: nowrap;
}

/* ===== BADGE NUMBER: แสดงตลอดเมื่อมี unread ===== */
.ptk-profile-tabs a.ptk-profile-tab .ptk-chat-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 6px;
    border-radius: 999px;
    background: #e11d48;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    margin-left: 2px;
    flex: 0 0 auto;
}

/* ===== DOT RED ===== */
.ptk-profile-tabs a.ptk-profile-tab .ptk-chat-badge-target::after {
    content: "";
    width: 8px;
    height: 8px;
    background: #ff1a1a;
    border-radius: 50%;
    position: absolute;
    top: 1px;
    right: -6px;
    box-shadow: 0 0 6px rgba(255, 0, 0, 0.6);
}

/* ===== NO UNREAD ===== */
.ptk-profile-tabs a.ptk-profile-tab .ptk-chat-badge-target[data-unread-count="0"] .ptk-chat-badge {
    display: none;
}

.ptk-profile-tabs a.ptk-profile-tab .ptk-chat-badge-target[data-unread-count="0"]::after {
    display: none;
}

/* ===== DOT PULSE เบาๆ ===== */
@keyframes ptk-dot-pulse {
    0%   { transform: scale(1); opacity: 1; }
    50%  { transform: scale(1.3); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
}

/* ===== BADGE BREATHING ===== */
@keyframes ptk-badge-breath {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.08); }
    100% { transform: scale(1); }
}

/* ===== ใช้กับ DOT ===== */
.ptk-profile-tabs a.ptk-profile-tab 
.ptk-chat-badge-target:not([data-unread-count="0"])::after {
    animation: ptk-dot-pulse 1.6s infinite ease-in-out;
}

/* ===== ใช้กับ BADGE ===== */
.ptk-profile-tabs a.ptk-profile-tab 
.ptk-chat-badge-target:not([data-unread-count="0"]) 
.ptk-chat-badge {
    animation: ptk-badge-breath 2.2s infinite ease-in-out;
}

.ptk-profile-logout {
    margin-top: 25px;
    text-align: left;
}

.ptk-profile-logout .ptk-btn {
    background: #111;
    border: 1px solid #333;
    color: #fff;
    padding: 10px 16px;
    border-radius: 8px;
}

.ptk-profile-logout .ptk-btn:hover {
    background: #e11d48;
}