/* =========================================================
   0) TOKENS & RESET
   ========================================================= */
:root {
    --bg: #f3f4f6;
    --card: #fff;
    --line: #e5e7eb;
    --muted: #6b7280;
    --text: #111827;
    --brand: #0f172a;
    --primary: #8ec6df;
    --primary-hover: #7dbad6;
    --contact-top-offset: 120px;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
    height: auto;
}

body {
    margin: 0;
    font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
}

h1 {
    font-size: 42px;
    margin: 0 0 12px;
}

a.link {
    color: #2563eb;
    text-decoration: none;
}

a.link:hover {
    text-decoration: underline;
}

.muted {
    color: var(--muted);
}

/* =========================================================
   1) GLOBAL UI PRIMITIVES
   ========================================================= */

.flash-stack {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.flash {
  min-width: 460px;
  max-width: 540px;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  background: #ffffff;
  color: #111827;
  font-size: 0.9rem;
  box-shadow: 0 10px 20px rgba(0,0,0,0.15);
  border-left: 4px solid #6b7280;
  opacity: 1;
  pointer-events: auto;
}

.flash-ok {
  border-left-color: #22c55e;
  background: #deffe9;      
}

.flash-err {
  border-left-color: #ef4444;   
  background: #ffe5e5;   
}

.label,
.label-sm {
    display: block;
    color: #374151;
}

.label {
    font-size: 14px;
    margin: 14px 0 8px;
}

.label-sm {
    font-size: 14px;
    margin-bottom: 6px;
}

.input,
.input-sm,
textarea,
.textarea,
.contact-input,
.contact-textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    outline: none;
    font-size: 15px;
    font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;

}

.input {
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 16px;
}

.input:focus {
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, .15);
}

.textarea,
textarea {
    resize: vertical;
    font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;

}

.row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 8px 0 24px;
}
.form-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}


.form-row .label {
    margin: 0; 
    font-weight: 600;
}

.form-row .input {
    width: 100%;
}


.btn {
    display: block;
    text-align: center;
    background: var(--primary);
    border: 1px solid #fee2e2;
    border-radius: 10px;
    color: #fff;
    font-weight: 500;
    font-size: 15px;
    padding: 10px 15px; 
    text-decoration: none;
    margin-bottom: 14px;
    cursor: pointer;
}

.btn:hover {
    filter: brightness(.98);
}

.btn-primary {
    display: block;
    text-align: center;
    background: var(--primary);
    border: 1px solid #fee2e2;
    border-radius: 10px;
    color: #fff;
    font-weight: 500;
    font-size: 15px;
    padding: 10px 15px; 
    text-decoration: none;
    margin-bottom: 14px;
    cursor: pointer;
}

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

.btn-danger {
    background: #167f9f;
    border: 1px solid #67C1DC;
    color: #fff;
}

.btn-danger:hover {
    background: #67C1DC;
}

.btn.wide {
    width: 100%;
}

.btn.pill {
    border-radius: 999px;
}

/* AUTH PAGE */

.captcha-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.35);
    backdrop-filter: blur(2px);
    display: none;
    z-index: 40;
  }

  .captcha-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 50;
  }
.captcha-modal.is-open {
    display: flex;
  }
  
.captcha-modal-backdrop.is-open {
    display: block;
  }

.captcha-modal__card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.25);
    padding: 24px 24px 20px;
    max-width: 420px;
    width: 90%;
  }

.captcha-modal__title {
    margin: 0 0 6px;
    font-size: 1.25rem;
    font-weight: 600;
  }

.captcha-question {
    margin: 12px 0 8px;
    font-weight: 500;
  }

.captcha-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 16px;
  }

.captcha-error {
    margin-top: 8px;
    font-size: 0.85rem;
    color: #dc2626;
    display: none;
  }
  
.btn-secondary {
    border-radius: 999px;
    padding: 10px 18px;
    border: 1px solid #d1d5db;
    background: #ffffff;
    font-size: 0.9rem;
    cursor: pointer;
  }

.auth-card .btn {
    width: 100%;
    margin-top: 20px;
}

.auth-wrap {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.auth-left {
    background-image: var(--auth-bg);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.auth-right {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    padding: 64px 48px;
}

.auth-card {
    width: 100%;
    max-width: 520px;
}

.auth-card h1 {
    font-size: 40px;
    line-height: 1.1;
    margin: 0 0 8px;
    font-weight: 800;
}

.password-field {
    position: relative;
    display: flex;
    align-items: center; 
  }
  
.password-toggle {
    position: absolute;
    right: 14px;         
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    font-size: 15px;
    color: #9ca3af; 
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
.password-toggle:hover i {
    color: #6b7280;
  }
  
.password-toggle i {
    pointer-events: none;
  }
  
.eye-icon {
    pointer-events: none;
  }
  
.input-hint {
    font-size: 13px;
    margin-top: 4px;
    color: #6b7280;
  }

.p-muted {
    color: var(--muted);
    margin: 0 0 20px;
    font-size: 14px;
}
.note {
    margin-top: 12px;
    font-size: 0.95rem;
    color: #555;
  }
  .note a {
    color: #7db9d6;
    text-decoration: none;
    font-weight: 500;
  }
  .note a:hover {
    text-decoration: underline;
  }

.auth-card .row {
    margin: 8px 0 16px;
}

.auth-card .link {
    color: #809fb9;
    text-decoration: none;
}

.auth-card .link:hover {
    text-decoration: underline;
}

.auth-card .btn {
    width: 100%;
    margin-top: 14px;
}

@media (max-width: 980px) {
    .auth-wrap {
        grid-template-columns: 1fr;
    }

    .auth-left {
        display: none;
    }

    .auth-right {
        padding: 40px 24px;
    }

    .auth-card h1 {
        font-size: 34px;
    }
}

/* Avatars */
.avatar,
.mini-avatar,
.ai-avatar,
.c-avatar {
    display: inline-block;
    border-radius: 999px;
    object-fit: cover;
    background: #e5e7eb;
}

.avatar {
    width: 28px;
    height: 28px;
    background-size: cover;
    background-position: center;
}

.mini-avatar,
img.mini-avatar {
    width: 24px;
    height: 24px;
}

.ai-avatar {
    width: 32px;
    height: 32px;
}

.c-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
}


img.c-avatar {
    width: 20px !important;
    height: 20px !important;
}


/* Cards */
.card {
    background:#fff;
    border:1px solid transparent;      
    border-radius:14px;
    overflow:hidden;
    transition: box-shadow .18s ease, transform .18s ease, background-color .18s ease;
    will-change: transform;            
    contain: paint;  
}

.card-title-link {
    display: block;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    display: -webkit-box; 
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
}

.card-desc {
    margin-top: 4px;
    font-size: 0.9rem;
    color: var(--muted, #555);
    display: -webkit-box; 
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card:hover {
    box-shadow: 0 10px 28px rgba(0,0,0,.12), 0 2px 8px rgba(0,0,0,.06);
    transform: translateY(-2px); 
}

.card>img,
.card .cover {
    display:block;
    width:100%;
    height:auto;          
    backface-visibility: hidden;
    transform: translateZ(0); 
}

.card-body,
.pad {
    padding: 10px 12px;
}

.page-title {
    font-size: 28px;
    margin: 0;
}

.spacer {
    flex: 1 1 auto;
}

.rule {
    height: 1px;
    background: var(--line);
    margin: 8px 2px;
}

/* =========================================================
   2) LAYOUTS (shells)
   ========================================================= */

/* App shell */
.layout {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 20px;
    margin: 32px 30px 32px 30px;
    padding: 0 10px;
    max-width: none;
    min-height: 100vh;
}

@media(max-width:1000px) {
    .layout {
        grid-template-columns: 1fr;
    }
}

.content {
    min-width: 0;
}

/* Sidebar */
.sidenav {
    position: sticky;
    top: 32px;
    bottom: 32px;
    height: auto;
    padding: 16px;
    background: #fff;
    border-radius: 16px;
    border: 1px solid var(--line);
    max-height: calc(100vh - 64px);
    display: flex;
    flex-direction: column;
}

.nav {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;  
}

.nav-top {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-bottom {
    margin-top: auto;        
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.brand {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 20px;
    letter-spacing: .6px;
    margin-bottom: 16px;
}

.brand-logo {
    height: 60px;
    max-width: 160px;
    object-fit: contain;
}

/* ===== CREATE PAGE (fix scale) ===== */
.create-page {
    max-width: 880px;
    margin: 24px auto 40px;
    padding: 0 16px;
}

.create-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    max-width: 880px;
    margin: 0 auto 14px;
}

.create-form {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .04);
    padding: 16px;
}

.dropzone {
    height: 280px;
}

@media(min-width: 1024px) {
    .dropzone {
        height: 340px;
    }
}

.actions {
    display: grid;
    grid-template-columns: 1fr 220px;
    gap: 16px;
    margin-top: 24px;
}

.actions .btn-ghost {
    justify-self: start;
}

.actions .btn-primary {
    justify-self: end;
}

@media (max-width: 640px) {

    .create-page,
    .create-header {
        max-width: 100%;
    }

    .actions {
        grid-template-columns: 1fr;
    }

    .actions .btn-ghost,
    .actions .btn-primary {
        width: 100%;
    }
}

.create-btn {
    display: block;
    text-align: center;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    padding: 12px 14px;
    border-radius: 12px;
    text-decoration: none;
    margin-bottom: 14px;
}

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

.nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    color: #374151;
    text-decoration: none;
    position: relative;
}

.nav a:hover {
    background: #f3f4f6;
}

.nav a .ico {
    width: 20px;
    text-align: center;
    opacity: .85;
}

.nav a .badge {
    margin-left: auto;
    background: #67C1DC;
    color: #fff;
    border: 1px solid #67C1DC;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 999px;
}

.nav a.active {
    background: #eef6fa;
    font-weight: 600;
}

/* Content header */
.content-top{
    display:flex;
    align-items:center;
    justify-content:space-between; 
    gap:12px;
    margin-bottom:12px;
  }

  .content-top .topbar{
    margin:0;
  }

      .content-top .search-wrap {
        display: flex;
        align-items: center;
        gap: 8px;
        max-width: 420px;
      }
      .content-top .search {
        flex: 1;
      }
      .search-btn.btn-primary {
        display: inline-flex;
        margin: 0;
        padding: 10px 14px;
        font-weight: 500;
      }

.search-wrap {
    flex: 1;
    max-width: 560px;
}

.search {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    outline: none;
    background: #fff;
}

/* === TOPBAR (user avatar + name, top-right) === */
.topbar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin: 8px 0 12px;
  }
  
  .single-wrap > .topbar {
    justify-content: space-between;
  }
  
  .userbox {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
    font-weight: 600;
    cursor: pointer;
  }
  
  .userbox .avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    border: 2px solid #e0e0e0;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
  }
  
  .userbox .username {
    color: #333;
    font-size: 0.95rem;
  }
  
  .userbox:hover .username {
    color: #7db9d6; 
  }
  
  .userbox:hover .avatar {
    box-shadow: 0 0 0 3px rgba(125, 185, 214, 0.25);
    transform: scale(1.04);
  }
/* =========================================================
   3) HOME → FEED, FILTERS, CHIPS
   ========================================================= */
.controls-row {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 12px;
    margin: 10px 0 18px;
}

.pills-wrapper {
  flex: 1;          
  min-width: 0;
}

.pill {
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 12px;
    background: #ffffff;
    color: #374151;      
    text-decoration: none;
    display: inline-block;
    box-shadow: 0 1px 0 rgba(0,0,0,0.02);
}

.pill:hover {
  background: #f3f4f6;        
}

.pill.is-selected {
    background: #e8f0fe;         
    border-color: #93c5fd;
    color: #000000;             
    font-weight: 500;
}

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0 6px;
  max-height: 34px;    
  overflow: hidden;
}

.pills.is-expanded {
  max-height: 500px;         
}

.pill-more {
    border: none;
    background: none;
    padding: 0 2px;
    font-size: 12px;
    cursor: pointer;
    color: #374151;          
}

.pill-more:hover {
    color: #111827;         
    text-decoration: underline;
}


.filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    cursor: pointer;
    color: #374151;
}

.filter-btn .icon {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    display: inline-block;
    line-height: 0;
    transform: translateY(1px);
}

.filter-btn .chev {
    width: 14px;
    height: 14px;
    flex: 0 0 14px;
    display: inline-block;
    line-height: 0;
    opacity: .6;
    transform: translateY(1px);
}

.filter-btn:hover {
    background: #f9fafb;
}

.feed {
    column-width: 320px;
    column-gap: 16px;
}

.feed .card {
    margin: 0 0 16px;      
    break-inside: avoid;   
}

@media (max-width: 700px) {
  .feed {
    column-count: 2;
    column-gap: 12px;
    column-width: auto;   
  }
  .feed .card {
    display: inline-block; 
    width: 100%;
    break-inside: avoid;
  }
}

@media (min-width: 701px) and (max-width: 1000px) {
  .feed { column-count: 3; column-gap: 16px; column-width: auto; }
}

@media (min-width: 1001px) {
  .feed { column-count: 4; column-gap: 16px; column-width: auto; }
}


.author-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.author {
    font-size: 12px;
    color: var(--muted);
}

.card-title {
    font-weight: 600;     
    line-height: 1.25;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.card:hover .card-title{
    font-weight: 600;     
    text-decoration: none; 
  }

.card-desc {
    color: var(--muted);
    font-size: 13px;
    margin-top: 2px;
}

.meta {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 12px;
    margin-top: 8px;
}

.counts {
    display: flex;
    gap: 14px;
    align-items: center;
}

.iconbtn {
    border: none;
    background: none;
    cursor: pointer;
    font: inherit;
    color: inherit;
    padding: 0;
}

.author-row:hover {
    opacity: .85;
    transition: opacity .2s ease;
}


@media (max-width: 700px) {
  .controls-row {
    display: flex;
    flex-direction: column;  
    align-items: flex-start; 
    gap: 10px;
  }

  .controls-row .pills {
    order: 1; 
    width: 100%;
  }

  .controls-row .filter-form {
    order: 2; 
    width: 100%;
    justify-content: flex-start;
  }

  .filter-form select {
    width: 100%;
  }
}

/* =========================================================
   4) FORMS (Create, shared)
   ========================================================= */
.form-card {
    max-width: 800px;
    margin: 22px auto;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 16px;
}

.settings-wrap .form-card {
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
}


.form-row {
    margin: 18px 0;
}

.chips {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.chip {
    padding: 8px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    font-size: 13px;
    color: #374151;
    cursor: pointer;
    box-shadow: 0 1px 0 rgba(0, 0, 0, .02);
}

.chip.is-selected {
    border-color: #cfe6ff;
    background: #eff7ff;
    color: #1f3a63;
    font-weight: 600;
}

.chip.add {
    font-weight: 700;
}

.actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 26px;
}

.file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    border: 0;
}

.dropzone {
    border: 1px dashed var(--line);
    border-radius: 14px;
    height: 210px;
    margin: 14px 0 26px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    color: var(--muted);
}

.dropzone.is-drag {
    background: #f8fbff;
    border-color: #cfe6ff;
}

.dz-empty {
    text-align: center;
    padding: 16px;
}

.dz-icon {
    width: 28px;
    height: 28px;
    color: var(--primary);
    margin: 0 auto 10px;
    display: block;
}

.dz-link {
    background: none;
    border: none;
    color: var(--primary-hover);
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
}

.dz-preview {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 12px;
    background: #fff;
}

.dz-remove {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    line-height: 28px;
    text-align: center;
    border: none;
    border-radius: 999px;
    background: rgba(17, 24, 39, .8);
    color: #fff;
    cursor: pointer;
}

/* =========================================================
   5) PROFILE
   ========================================================= */
.profile-hero {
    display: flex;
    gap: 16px;
    align-items: center;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 18px;
}

.profile-avatar {
    width: 84px;
    height: 84px;
    border-radius: 999px;
    object-fit: cover;
    background: #e5e7eb;
}

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

.profile-name {
    font-size: 22px;
    font-weight: 900;
    letter-spacing: .2px;
}

.profile-email {
    color: var(--muted);
    font-size: 14px;
    margin-top: 2px;
}

.profile-stats {
    display: flex;
    gap: 16px;
    color: #374151;
    margin-top: 8px;
}

.profile-stats b {
    font-weight: 800;
}

.profile-actions {
    margin-top: 10px;
}

.section-title {
    font-size: 16px;
    color: #374151;
    margin: 8px 0 10px;
}

.avatar-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: inherit;
}

.avatar-img {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    object-fit: cover;
    background: #c7d2fe;
}

.profile-actions-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
}

.profile-cover {
    position: relative;
    height: 200px;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 16px;
    background: #f2f3f5;
}

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

.profile-cover .cover-actions {
    position: absolute;
    right: 12px;
    bottom: 12px;
    display: flex;
    gap: 8px;
}

.btn-ghost.small {
    background: rgba(255, 255, 255, .9);
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}


.edit-avatar-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 10px 0 12px;
}

.avatar-preview {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.avatar-note {
    color: var(--muted);
    font-size: 12px;
}



/* =========================================================
   6) ADMIN
   ========================================================= */
.admin-topbar {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 16px;
    align-items: center;
    margin-bottom: 12px;
}

.admin-search {
    display: flex;
    justify-content: center;
}

.admin-subtitle {
    font-size: 14px;
    color: #374151;
    margin: 12px 0;
}

.admin-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.admin-item {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
}

.ai-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.ai-meta {
    min-width: 0
}

.ai-name {
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ai-sub {
    font-size: 12px;
    color: var(--muted);
    display: flex;
    gap: 8px;
}

.ai-center {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-actions {
    display: flex;
    gap: 8px;
    justify-self: end;
}

.status-badge {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: #fff;
}

.status-active {
    color: #166534;
    border-color: #bbf7d0;
    background: #dcfce7;
}

.status-blocked {
    color: #92400e;
    border-color: #fde68a;
    background: #fef3c7;
}

.status-banned {
    color: #991b1b;
    border-color: #fecaca;
    background: #fee2e2;
}

.role-badge {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #eef2ff;
    color: #3730a3;
    border: 1px solid #c7d2fe;
}


@media (max-width: 800px) {
  .content-top { 
    flex-direction: column; 
    align-items: flex-start; 
    gap: 10px;
  }
  .content-top .search-wrap {
    width: 100%;
    max-width: none;       
  }
  .content-top .search-wrap .search {
    width: 100%;
  }
}

@media (max-width: 760px) {
  .admin-item {
    grid-template-columns: 1fr;  
    align-items: start;
    gap: 10px;
  }

  .ai-left {
    gap: 10px;
  }
  .ai-left .ai-avatar,
  .ai-left img.ai-avatar {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    object-fit: cover;
  }
  .ai-meta { min-width: 0; }
  .ai-name { font-size: 0.98rem; }
  .ai-sub { 
    flex-wrap: wrap; 
    row-gap: 4px; 
  }

  .ai-actions {
    order: 2;
    justify-self: stretch;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  .ai-actions .btn-ghost.pill,
  .ai-actions .btn-danger.pill {
    padding: 8px 10px;
    font-size: 13px;
  }

  .ai-center {
    order: 3;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
  }
  .status-badge, .role-badge {
    line-height: 1.2;
    padding: 4px 8px;
  }
}

@media (max-width: 420px) {
  .admin-item { padding: 12px; }
  .ai-actions a, 
  .ai-actions button {
    flex: 1 1 auto;      
  }
}


/* =========================================================
   7) ABOUT / SETTINGS
   ========================================================= */
.about {
    max-width: 800px;
    margin: 2rem auto;
    line-height: 1.6;
}

.about h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.about .lead {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 1.5rem;
}

.about-image {
    display: block;
    width: 100%;
    max-width: 700px;
    border-radius: 12px;
    margin: 1.5rem auto;
}

.about-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .03);
    overflow: hidden;
}

.about-card .pad {
    padding: 18px;
}

.settings-wrap {
    max-width: 800px;      
    margin: 20px auto 40px;
}

.sub {
    color: #6b7280;
    margin-bottom: 16px;
}

.form-grid {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 14px;
    align-items: start;
}

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

.filebar {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 10px;
}

.filebtn {
    display: inline-block;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 8px 12px;
    font-weight: 600;
    cursor: pointer;
}

input[type="file"] {
    display: none;
}

.help {
    color: #6b7280;
    font-size: 12px;
}

.switch {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 8px;
}

.btns {
    display: flex;
    gap: 10px;
    margin-top: 14px;
}

.image-preview-wrapper {
    position: relative;
    display: inline-block;
    border-radius: 12px;
    overflow: hidden;
    margin-right: 3%;
}

.preview {
    display: block;
    width: 100%;
    max-width: 100%;
    object-fit: cover;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, .08);
    transition: transform .2s ease, box-shadow .2s ease;
}

.preview:hover {
    transform: scale(1.01);
    box-shadow: 0 2px 10px rgba(0, 0, 0, .12);
}

.remove-image {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, .6);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 26px;
    height: 26px;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s ease;
}

.remove-image:hover {
    background: rgba(0, 0, 0, .8);
}

/* =========================================================
   8) CONTACT
   ========================================================= */
.contact-shell {
    max-width: 1200px;
    margin: 0 auto;
}

.contact-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 36px;
    align-items: start;
}

.contact-media {
    border-radius: 16px;
    overflow: hidden;
    height: calc(100vh - var(--contact-top-offset));
    min-height: 560px;
    background: #e5e7eb;
}

.contact-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.contact-pane {
    padding-top: 0;
}

.contact-pane h1 {
    font-size: 28px;
    font-weight: 800;
    margin: 0 0 6px;
}

.contact-pane .sub {
    color: #6b7280;
    margin: 0 0 20px;
}

.contact-grid2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 10px;
}

.contact-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 12px;
}

/* =========================================================
   9) GUEST (public) SECTIONS
   ========================================================= */
.guest-feed {
    position: relative;
    padding-bottom: 180px;
}

.guest-gate {
    position: sticky;
    bottom: 0;
    z-index: 2;
    margin-top: -140px;
}

.guest-fade {
    height: 140px;
    pointer-events: none;
    background: linear-gradient(to bottom, rgba(243, 244, 246, 0), rgba(243, 244, 246, 1));
    border-radius: 0 0 16px 16px;
}

.gate-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .06);
    padding: 14px 16px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
}

.gate-star {
    font-size: 20px;
    line-height: 1;
    opacity: .85;
}

.gate-text {
    margin: 0;
    color: #374151;
}

.gate-actions {
    display: flex;
    gap: 10px;
}

/* .gate-actions .btn-primary,
.gate-actions .btn-ghost {
    padding: 10px 14px;
    border-radius: 10px;
    font-weight: 700;
    text-decoration: none
}
 */
body.guest-locked {
    overflow: hidden;
}

.guest-main {
    height: 100vh;
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 20px;
    padding: 32px 30px;
}

.guest-content {
    min-width: 0;
    display: grid;
    grid-template-rows: auto auto 1fr auto;
    gap: 12px;
}

.feed-locked {
    position: relative;
    overflow: hidden;
}

.feed-locked::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 120px;
    pointer-events: none;
    background: linear-gradient(to bottom, rgba(243, 244, 246, 0) 0%, rgba(243, 244, 246, 1) 95%);
}

.guest-cta {
    position: sticky;
    bottom: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 40px 24px 32px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, .5) 25%, rgba(255, 255, 255, .85) 60%, rgba(255, 255, 255, .97) 90%, #fff 100%);
    backdrop-filter: blur(2px) saturate(130%);
    -webkit-backdrop-filter: blur(18px) saturate(130%);
}

.guest-cta::before {
    content: "";
    position: absolute;
    left: -60px;
    right: -60px;
    top: -160px;
    bottom: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, .35) 30%, rgba(255, 255, 255, .8) 70%, #fff 100%);
    filter: blur(18px);
    pointer-events: none;
    z-index: -1;
}

.guest-cta .note-guest {
    color: #374151;
    font-size: 15px;
    font-weight: 500;
    white-space: nowrap;
    margin-right: 10px;
}



/* =========================================================
   10) PICTURE PAGE (comments)
   ========================================================= */
.single-wrap {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    gap: 16px;
    grid-template-columns: minmax(300px, 620px) 1fr;
    align-items: start;
}

.single-wrap .card .pad {
    text-align: left;
}

.subtitle {
    margin: 0;
    font-size: 18px;
    font-weight: 800;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 8px 0 12px;
}

.comment {
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}

.c-head {
    display: flex;
    align-items: flex-start; 
    gap: 8px;
}

.c-head-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;                 
}

.c-time {
    color: var(--muted);
    font-size: 12px;
}

.rate-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}
.rate-modal-backdrop[hidden] { display: none; }
.rate-modal {
  background: #ffffff;
  border-radius: 16px;
  padding: 24px 28px;
  max-width: 360px;
  width: 90%;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.25);
}
.rate-modal h2 {
  margin: 0 0 8px;
  font-size: 1.1rem;
}
.rate-modal p {
  margin: 4px 0;
  font-size: 0.9rem;
  color: #4b5563;
}
.rate-modal small {
  display: block;
  margin-top: 8px;
  font-size: 0.8rem;
  color: #6b7280;
}
.rate-limit-note {
  font-size: 12px;
  color: #6b7280;
  margin: 4px 0 16px;
}
.rate-limit-note strong {
  font-weight: 600;
}

.comment .iconbtn.danger,
.comment .btn-danger {
    display: inline-flex !important;
    margin-bottom: 0 !important;
    padding: 2px 6px !important;
    border-radius: 6px !important;
    align-self: flex-start;
}

.comment .c-body {
  overflow-wrap: break-word; 
  word-break: break-word;      
}


.c-time {
    color: var(--muted);
    font-size: 12px;
}

.c-body {
    margin: 6px 0 4px;
}

.c-actions .link-btn {
    font-size: 12px;
    color: var(--muted);
    background: none;
    border: 0;
    cursor: pointer;
}

.reply-form textarea,
.comment-form textarea {
    width: 100%;
    font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;

}

.comment-form .input {
    margin-bottom: 10px;
}

.form-actions,
.reply-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
}

.c-children {
    margin-left: 16px;
    padding-left: 12px;
    border-left: 2px solid var(--line);
}


.pills {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin: .75rem 0;
}

.pill {
    display: inline-block;
    padding: .35rem .7rem;
    border: 1px solid #e3e8ef;
    border-radius: 999px;
    text-decoration: none;
    cursor: pointer;
}

.pill.is-selected {
    background: #eff7ff;
    border-color: #cfe6ff;
    font-weight: 600;
}

.card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
}

.pad {
    padding: 16px;
}

.cats-table {
    width: 100%;
    border-collapse: collapse;
}

.cats-table th,
.cats-table td {
    padding: .6rem .5rem;
    border-bottom: 1px solid #eef2f7;
    text-align: left;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
}

.badge {
    display: inline-block;
    font-size: 12px;
    line-height: 1;
    padding: 4px 8px;
    border-radius: 999px;
}

.badge-green {
    background: #e8f8ee;
    color: #116a3e;
}

.badge-gray {
    background: #eef2f7;
    color: #475569;
}

.flex-row {
    display: flex;
}

.btn-ghost {
    display: block;
    text-align: center;
    background: #fff;;
    color: #000000;
    border: 1px solid #475569;
    border-radius: 10px;
    font-weight: 500;
    font-size: 15px;
    padding: 10px 15px; 
    text-decoration: none;
    margin-bottom: 14px;
    cursor: pointer;
}

.btn-link {
    font-size: .9rem;
    text-decoration: none;
    padding: 0 .25rem;
}

.btn-danger {
    display: block;
    text-align: center;
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #991b1b;
    border-radius: 10px;
    font-weight: 500;
    font-size: 15px;
    padding: 10px 15px;   
    text-decoration: none;
    margin-bottom: 14px;
    cursor: pointer;
}

.btn-danger:hover {
    background: #fecaca;
}

.cats-table code {
    color: #64748b;
    font-size: 0.85rem;
}

@media (max-width: 900px){
  .single-wrap{
    grid-template-columns: 1fr;  
  }
  .single-wrap .card + .card{
    margin-top: 12px;            
  }
}

@media (max-width: 900px){
  .hamburger{ display:inline-block; }
  .content-top{ flex-wrap:wrap; }
  .top-actions{ order:1; width:100%; justify-content:space-between; }
}


/* Filter dropdown */
.filter-form {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-label {
    font-size: 14px;
    color: #4b5563;
}

.filter-select-wrap {
    position: relative;
}

.filter-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 9px;
    padding: 10px 38px 10px 14px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
}

.filter-select-wrap::after {
    content: "";
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 6px;
    background-repeat: no-repeat;
    background-size: 10px 6px;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
}


/* --- Hot this week --- */
.hot-row {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding: 8px 2px 16px;
    scroll-snap-type: x mandatory;
}

.hot-card {
    flex: 0 0 320px;
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    scroll-snap-align: start;
    box-shadow: 0 4px 18px rgba(0, 0, 0, .08);
    background: #ffffff;
}

.hot-card img {
    display: block;
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.hot-title {
    position: absolute;
    left: 10px;
    bottom: 10px;
    background: rgba(0, 0, 0, .55);
    color: #ffffff;
    font-size: 14px;
    padding: 4px 8px;
    border-radius: 10px;
}

.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 18px 0 10px;
}


.iconbtn.danger {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
    font-size: 0.8rem;
    padding: 2px 6px;
    border-radius: 5px;
    cursor: pointer;
}

.iconbtn.danger:hover {
    background: #fca5a5;
}


/* =========================================================
   11) RESPONSIVE TWEAKS
   ========================================================= */
@media(max-width:1100px) {
    .contact-split {
        grid-template-columns: 1fr;
    }

    .contact-media {
        height: 420px;
    }
}

@media(max-width:1000px) {
    .guest-cta {
        flex-direction: column;
        text-align: center;
        gap: 10px;
        padding: 36px 16px 24px;
    }

    .guest-cta .note-guest {
        white-space: normal;
        margin-right: 0;
    }
}

@media(max-width:640px) {
    .contact-grid2 {
        grid-template-columns: 1fr;
    }
}

/* ===== Rules page polish ===== */
.rules {             
    background: none;
    border: none;
    box-shadow: none;
    color: #1f2937;
  }
  
  .rules .page-header {
    margin-bottom: .75rem;
    border-bottom: 1px solid var(--border, #e6e6e6);
    padding-bottom: .5rem;
  }
  
  .rules .page-title {
    margin: 0;
    line-height: 1.2;
    letter-spacing: -0.01em;
    font-size: 1.75rem;
    font-weight: 700;
    color: #111827;
  }
  
  .rules .meta {
    margin-top: .25rem;
    font-size: .85rem;
    color: #6b7280;
  }
  
  .prose {
    line-height: 1.7;
    font-size: 1rem;
    max-width: 100%;
  }
  
  .prose p {
    margin: .6rem 0;
  }
  
  .prose h2, .prose h3 {
    margin: 1.1rem 0 .4rem;
    line-height: 1.3;
  }
  
  .prose h2 {
    font-size: 1.15rem;
    font-weight: 600;
  }
  
  .prose h3 {
    font-size: 1.05rem;
    color: #374151;
  }
  
  .prose ol, .prose ul {
    padding-left: 1.25rem;
    margin: .5rem 0 .8rem;
  }
  
  .prose li {
    margin: .2rem 0;
  }
  
  .rules .admin-cta {
    margin-top: 1rem;
    border-top: 1px dashed var(--border, #e6e6e6);
    padding-top: .75rem;
  }
  
  @media (min-width: 1200px) {
    .rules {
      margin-left: 3rem;
      margin-right: 3rem;
    }
  }

/* =========================================================
   12) SIDEBAR (responsive)
   ========================================================= */
.content-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:12px;
}

.top-actions{
  display:flex;
  align-items:center;
  gap:8px;
}

.hamburger{
  display:none;
  border:none;
  background:transparent;
  font-size:26px;
  line-height:1;
  cursor:pointer;
  color:hsl(194, 76%, 35%);
}

@media (max-width: 1000px){
  .hamburger{ display:inline-block; }

  .content-top{ flex-wrap:wrap; }

  .top-actions{
    order:1;
    width:100%;
    justify-content:space-between;  
  }

  .search-wrap{
    order:2;
    width:100%;
  }

  .sidenav{
    position:fixed; z-index:1000;
    top:0; left:0; height:100vh; width:280px; max-width:88vw;
    background:#fff; box-shadow:0 10px 30px rgba(0,0,0,.2);
    transform:translateX(-100%);
    transition:transform .25s ease-in-out;
  }
  body.sidebar-open .sidenav{ transform:translateX(0); }

  .layout{ grid-template-columns:1fr; margin-top:56px; }
}

@media (max-width: 1000px) {
  .feed .card .meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;         
  }

  .feed .card .counts {
    gap: 10px;
    font-size: 12px;
  }

  .feed .card .spacer { display: none; }

  .feed .card .btn-ghost,
  .feed .card .btn-danger {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    font-size: 12px;
    line-height: 1.1;
    border-radius: 8px;
    margin-bottom: 0;        
  }

  .feed .card .btn-ghost.pill,
  .feed .card .btn-danger.pill {
    padding: 6px 10px;
    font-size: 12px;
    border-radius: 999px;
  }

  .feed .card .card-body { padding: 8px 10px; }
}

@media (max-width: 1000px) {
  .profile-actions .btn,
  .profile-actions .btn-ghost,
  .profile-actions .btn-primary {
    padding: 8px 10px;
    font-size: 13px;
    border-radius: 8px;
    margin-bottom: 0;
  }
  .profile-actions { gap: 8px; }
}


/* ===== Sidebar Close Button  ===== */
.close-btn {
  display: none;
  position: absolute;
  top: 14px;
  right: 14px;
  background: none;
  border: none;
  color: #0f172a;
  font-size: 26px;
  cursor: pointer;
  z-index: 1100;
  transition: color 0.2s ease;
}

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

@media (max-width: 1000px) {
  .close-btn {
    display: block;
  }

  .sidenav {
    padding-top: 40px; 
  }
}


  .author-row {
      margin-top: 10px;
      display: flex;
      align-items: center;
      gap: 8px
    }

    .author-link {
      display: flex;
      align-items: center;
      gap: 8px;
      text-decoration: none
    }

    .author-avatar {
      width: 26px;
      height: 26px;
      border-radius: 50%;
      object-fit: cover
    }

    .author-name {
      font-size: .9rem;
      color: #333
    }

/* ==== Card images in the feed (index.php) ==== */

.card-cover {
    display: block;
    overflow: hidden;        
    border-radius: 16px 16px 0 0; 
}

.card-cover img {
    display: block;
    width: 100%;
    height: auto;   
    max-height: 520px;          
}

.single-wrap .card img {
    width: auto;
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    display: block;
}

/* Tablets & small laptops */
@media (max-width: 768px) {
  .card-cover img {
    max-height: 420px;     
  }

  .single-wrap .card > img {
    max-height: 500px;
  }
}

/* Phones */
@media (max-width: 480px) {
  .card-cover img {
    max-height: 320px;    
  }

  .single-wrap .card > img {
    max-height: 380px;   
  }
}

/* ==== Single picture view (picture.php) ==== */

.single-wrap .card > img {
    display: block;
    max-height: 600px; 
    width: 100%;
    object-fit: contain; 
}

    .card-title a.card-title-link {
      color: inherit;
      text-decoration: none
    }

    .card-title a.card-title-link:hover {
      text-decoration: none
    }

    .content-top .search-wrap {
      display: flex;
      gap: 8px;
      align-items: center
    }

    .content-top .search-wrap .search {
      flex: 1
    }

    .search-btn.btn-primary {
      display: inline-flex;
      margin: 0;
      padding: 10px 14px
    }

@media (max-width: 1000px){
  .guest-main{
    grid-template-columns: 1fr; 
    gap: 16px;
    padding: 16px;                  
  }
  .sidenav{
    position: fixed;
    z-index: 1000;
    top: 0; left: 0;
    height: 100vh;
    width: 280px; max-width: 88vw;
    background: #fff;
    box-shadow: 0 10px 30px rgba(0,0,0,.2);
    transform: translateX(-100%);
    transition: transform .25s ease-in-out;
    padding-top: 40px;                
  }
  body.sidebar-open .sidenav{ transform: translateX(0); }

  .content-top{ flex-wrap: wrap; gap: 10px; }
  .top-actions{ order: 1; width: 100%; justify-content: space-between; }
  .search-wrap{ order: 2; width: 100%; }

  .hamburger{ display: inline-block; }
}

body.guest-locked .hamburger {
  display: none !important;
  pointer-events: none;
  opacity: 0.4;
}

body.guest-locked .sidenav {
  display: none;
}

body.guest-locked .guest-main {
  grid-template-columns: 1fr !important;
  padding: 20px 30px;
}

@media (max-width: 1000px) {
  body.guest-locked .sidenav {
    display: none; 
  }
}

.guest-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex: 0 0 auto;
}

body.guest-locked .content-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 10px;
}

@media (max-width: 1000px) {
  body.guest-locked .content-top {
    flex-wrap: wrap;
  }
  body.guest-locked .search-wrap {
    order: 2;
    width: 100%;
  }
  body.guest-locked .guest-actions {
    order: 1;
    width: 100%;
    display: flex;
    justify-content: flex-end;
  }
}



@media (max-width: 1000px){
  .feed {
    column-count: 2;
    column-gap: 12px;
    column-width: auto;
  }
  .feed .card { display: inline-block; width: 100%; break-inside: avoid; }
}

.feed-locked { padding-bottom: min(32vh, 220px); }

.feed-locked::after{
  height: min(18vh, 120px);
}

.guest-cta{
  padding: 20px 16px 16px;
  gap: 10px;
}

@media (max-width: 1000px){
  .guest-cta{
    flex-direction: column;
    text-align: center;
  }
  .guest-cta .note-guest{ white-space: normal; margin: 0; }
}

.sidebar-backdrop{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  z-index: 900;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}
body.sidebar-open .sidebar-backdrop{
  opacity: 1;
  pointer-events: auto;
}

.char-hint {
    margin-top: 4px;
    font-size: 0.8rem;
    color: var(--muted, #666);
    text-align: right;
}

.input.at-limit {
    border-color: #e74c3c;
}

.char-hint.at-limit {
    color: #e74c3c;
}

.label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.field-counter {
  font-size: 0.8rem;
  color: var(--muted, #777);
}

.input.at-limit {
  border-color: #ef4444;
}

.field-counter.at-limit {
  color: #ef4444;
  font-weight: 500;
}

.cat-add-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cat-add-row .input {
  flex: 1;
}

.cat-add-btn {
  margin-top: 0; 
  white-space: nowrap; 
}

.cats-table td:last-child {
  text-align: right;
  white-space: nowrap;
  width: 1%;
}

.cats-table form {
  display: inline-flex;
  margin-left: 4px;
}

/* ===== About page polish ===== */

.about {
  max-width: 900px;
  margin: 2.5rem auto 3rem;
}

.about-header {
  text-align: left;
  margin-bottom: 1.75rem;
}

.about-header h1 {
  font-size: 1.75rem;
  margin: 0 0 .35rem;
}

.about-header .lead {
  font-size: .98rem;
  color: #6b7280;
}

/* Hero image */
.about-image-wrap {
  margin-bottom: 1.75rem;
}

.about-image {
  width: 100%;
  display: block;
  border-radius: 16px;
  box-shadow: 0 16px 30px rgba(15,23,42,.18);
}

/* Content card */
.about-card {
  background: #fff;
  border-radius: 18px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 12px 30px rgba(15,23,42,.06);
  padding: 24px 28px;
}

/* Typography inside admin content */
.about-body {
  font-size: .95rem;
  line-height: 1.7;
  color: #374151;
}

/* Section titles (Our Mission, Core Values, etc.) */
.about-body h2 {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  margin: 0 0 .4rem;
}

.about-body h2:not(:first-child) {
  margin-top: 1.8rem;
  padding-top: 1.3rem;
  border-top: 1px dashed #e5e7eb;
}

/* Subheadings like Creativity, Community… */
.about-body h3 {
  font-size: .95rem;
  font-weight: 600;
  margin: 1rem 0 .2rem;
}

/* Paragraph spacing */
.about-body p {
  margin: .15rem 0 .6rem;
}

/* Links */
.about-body a {
  color: #7dbad6;
  font-weight: 500;
  text-decoration: none;
}

.about-body a:hover {
  text-decoration: underline;
}

@media (max-width: 700px) {
  .about {
    margin: 1.5rem 1rem 2.5rem;
  }

  .about-card {
    padding: 18px 16px;
    border-radius: 16px;
  }

  .about-header h1 {
    font-size: 1.5rem;
  }
}

/* --- User settings dropdown --- */
.user-settings {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-menu-toggle {
  border: none;
  background:#8ec6df ;
  cursor: pointer;
  padding: 4px;
  border-radius: 9px;
  color: #fff;
}

.user-menu-toggle:hover {
  background:#3eb1d4;
}

.user-menu {
  position: absolute;
  right: 0;
  top: 120%;
  min-width: 180px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 18px rgba(0,0,0,0.12);
  padding: 10px;
  display: none;
  z-index: 50;
}

.user-menu.open {
  display: block;
}

.user-menu-section + .user-menu-section {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #eee;
}

.user-menu-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  color: #888;
  display: block;
  margin-bottom: 4px;
}

.user-menu-item {
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 4px 4px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}

.user-menu-item:hover {
  background: #f3f4f6;
}

/* --- Font sizes --- */
body.font-small   { font-size: 14px; }
body.font-medium  { font-size: 16px; }
body.font-large   { font-size: 18px; }


/* =======================================================
   TOPBAR — LIGHT MODE
======================================================= */
.topbar-userbox {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin: 8px 0 12px;
  margin-left: auto;
}

.userbox {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #333;             
}

.userbox-name {
  font-weight: 600;
  color: #333;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  border: 2px solid #e0e0e0;
  flex-shrink: 0;
}

/* =======================================================
  TOPBAR — DARK MODE FIX
======================================================= */
body.theme-dark .userbox,
body.theme-dark .userbox-name,
body.theme-dark .topbar-userbox a {
  color: #e5e7eb !important;
}

body.theme-dark .avatar {
  border-color: #334155 !important; 
}


/* ============================
   THEME: LIGHT / DARK
   ============================ */

/* Light theme (default) */
body.theme-light {
  background: #f5f5f5;
  color: #111827;
}

/* Dark theme base */
body.theme-dark {
  background: #020617;      
  color: #e5e7eb;   
  border: #1e293b;
}

/* Main layout areas */
body.theme-dark .layout,
body.theme-dark .content {
  background: #020617;
}

/* ============================
   CARDS & FEED
   ============================ */

body.theme-dark .card,
body.theme-dark .hot-card {
  background: #111b32;        
  color: #e5e7eb;
  border-radius: 16px;
  border: 1px solid #1e293b;
}

body.theme-dark .card-title,
body.theme-dark .card-title a {
  color: #f1f5f9;
}

body.theme-dark .card-desc {
  color: #d1d5db;
}

body.theme-dark .author-name,
body.theme-dark .author-link span {
  color: #e5e7eb;
}

body.theme-dark .counts,
body.theme-dark .counts a,
body.theme-dark .muted,
body.theme-dark .meta span,
body.theme-dark .card .muted {
  color: #cbd5e1;
}

body.theme-dark .hot-card span {
  color: #f1f5f9;
}

/* ============================
   SEARCH, FILTERS & PILLS
   ============================ */

body.theme-dark .search,
body.theme-dark .filter-select {
  background: #020617;
  border: 1px solid #1e293b;
  color: #e5e7eb;
}

body.theme-dark .search::placeholder {
  color: #6b7280;
}

body.theme-dark .filter-select-wrap {
  background: #020617;
  border-radius: 999px;
}

body.theme-dark .pill {
  background: #020617;
  border: 1px solid #1f2937;
  color: #e5e7eb;
}

body.theme-dark .pill.is-selected {
  background: var(--primary);
  border-color: var(--primary);
  color: #e5e7eb;
}

body.theme-dark .filter-label {
  color: #e5e7eb;
}

body.theme-dark option {
  background: #020617;
  color: #e5e7eb;
}

/* ============================
   BUTTONS
   ============================ */

body.theme-dark .btn-primary,
body.theme-dark .search-btn {
  background: var(--primary);
  border-color: var(--primary);
  color: #e5e7eb;
}

body.theme-dark .btn-primary:hover,
body.theme-dark .search-btn:hover {
  background: var(--primary);
}

/* ============================
   FLASH MESSAGES
   ============================ */

body.theme-dark .flash {
  background: #0f172a;
  color: #e5e7eb;
  border: 1px solid #1e293b;
}

body.theme-dark .flash-ok {
  border-left: 4px solid #22c55e;
}

body.theme-dark .flash-err {
  border-left: 4px solid #f97373;
}

/* ============================
   DROPDOWN (DISPLAY SETTINGS)
   ============================ */

body.theme-dark .user-menu {
  background: #111b32;
  border: 1px solid #1e293b;
  color: #e5e7eb;
}

body.theme-dark .user-menu-title,
body.theme-dark .user-menu-item {
  color: #e5e7eb;
}

body.theme-dark .user-menu-item:hover {
  background: #111b32;
}

/* ============================
   SIDENAV (LEFT MENU)
   ============================ */

body.theme-dark .sidenav {
  background: #111b32;
  color: #e5e7eb;
  border: 1px solid #1e293b;

}

/* all text & links */
body.theme-dark .sidenav *,
body.theme-dark .sidenav a,
body.theme-dark .sidenav button {
  color: #e5e7eb;
}

/* nav links normal */
body.theme-dark .sidenav a {
  background: transparent;
}

body.theme-dark .sidenav a:hover,
body.theme-dark .sidenav a.active {
  background: #0b1120;
  color: #ffffff;
}

body.theme-dark .sidenav svg path,
body.theme-dark .sidenav svg line,
body.theme-dark .sidenav svg polyline,
body.theme-dark .sidenav svg circle {
  fill: #e5e7eb !important;
  stroke: #e5e7eb !important;
}

body.theme-dark .sidenav a svg {
  filter: none !important;
  box-shadow: none !important;
}

/* "Create" button at top of sidenav */
body.theme-dark .sidenav .create-btn {
  background: #3eb1d4;
  color: #ffffff;
  border: none;
}

body.theme-dark .sidenav .create-btn:hover {
  filter: brightness(1.1);
}

/* =====================
   TOP-RIGHT USER BOX 
   ====================*/

body.theme-dark .user-settings,
body.theme-dark .user-settings * {
  color: #e5e7eb !important;
}

body.theme-dark .userbox-name,
body.theme-dark .topbar-userbox span {
  color: #e5e7eb !important;
}

body.theme-dark .section-title {
  color: #e5e7eb;
}

/* =========================================
   SETTINGS PAGE – GENERAL LAYOUT
   ========================================= */

.content-top {
  padding: 16px 0 8px;
}

.top-actions{
  display:flex;
  align-items:center;

  gap:8px;
}

/* Avatar + name + blue settings button */
.user-settings {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-settings .topbar {
  margin: 0 !important;
}

/* Dropdown */
.user-menu {
  position: absolute;
  top: 100%;
  right: 0;        
  margin-top: 8px;
  display: none;
  z-index: 20;
}

.user-menu.open {
  display: block;
}

/* =========================================
   SETTINGS PAGE – DARK MODE
   ========================================= */

/* Card wrapper */
body.theme-dark .form-card {
  background: #111b32;
  border: 1px solid #1e293b;
  color: #e5e7eb;
}

/* Titles + subtitles */
body.theme-dark .page-title,
body.theme-dark .section-title {
  color: #e5e7eb !important;
}

body.theme-dark .label,
body.theme-dark .settings-wrap .sub {
  color: #cbd5e1 !important;
}

/* Tables + inputs */
body.theme-dark .input,
body.theme-dark .textarea,
body.theme-dark input.input,
body.theme-dark textarea.input,
body.theme-dark .cats-table,
body.theme-dark .cats-table th,
body.theme-dark .cats-table td {
  background: #020617;
  border-color: #1f2937;
  color: #e5e7eb;
}

body.theme-dark .input::placeholder,
body.theme-dark .textarea::placeholder {
  color: #6b7280 !important;
}

/* Help text */
body.theme-dark .help {
  color: #9ca3af !important;
}

/* File input button */
body.theme-dark .filebar {
  background: transparent !important;
}

body.theme-dark .filebtn {
  background: #0b1120 !important;
  color: #e5e7eb !important;
  border: 1px solid #1e293b !important;
}

body.theme-dark .filebtn:hover {
  background: #1e293b !important;
}

/* Primary buttons inside settings cards */
body.theme-dark .form-card .btn-primary {
  background: var(--primary) !important;
  color: #ffffff !important;
  border: none !important;
}

body.theme-dark .form-card .btn-primary:hover {
  filter: brightness(1.1);
}

.content-spacer {
    flex: 1;
}

/* ===== Rules / About page — Dark mode ===== */

body.theme-dark .about-header h1,
body.theme-dark .about-header .lead {
  color: #e5e7eb;
}

body.theme-dark .about-card {
  background: #111b32;
  border: 1px solid #1e293b;
  color: #e5e7eb;
}

body.theme-dark .about-body {
  color: #e5e7eb;
}

/* links inside rules content */
body.theme-dark .about-body a {
  color: var(--primary);
}

/* Contact page — dark mode */

body.theme-dark .contact-pane h1,
body.theme-dark .contact-pane .sub,
body.theme-dark .contact-label {
  color: #e5e7eb;
}

body.theme-dark .contact-input,
body.theme-dark .contact-textarea {
  background: #020617;
  border: 1px solid #1e293b;
  color: #e5e7eb;
}

body.theme-dark .contact-input::placeholder,
body.theme-dark .contact-textarea::placeholder {
  color: #6b7280;
}

body.theme-dark .contact-media {
  background: #020617;
}

/* About page — dark mode card & text */
body.theme-dark .about-card {
  background: #111b32;
  border: 1px solid #1e293b;
  color: #e5e7eb;
}

body.theme-dark .about-header h1 {
  color: #e5e7eb;
}

body.theme-dark .about-body {
  color: #e5e7eb;
}

/* ============================
   ADMIN PAGE – DARK MODE
   ============================ */

body.theme-dark .admin-subtitle {
  color: #cbd5e1;
}

body.theme-dark .admin-item {
  background: #020617;            
  border: 1px solid #1e293b;
  box-shadow: 0 10px 25px rgba(15,23,42,0.45);
}

body.theme-dark .ai-name {
  color: #e5e7eb;
}

body.theme-dark .ai-sub {
  color: #94a3b8;
}

/* status + role badges */
body.theme-dark .status-badge {
  background: #020617;
  border-color: #1e293b;
  color: #e5e7eb;
}

body.theme-dark .status-active {
  background: #022c22;
  border-color: #16a34a;
  color: #bbf7d0;
}

body.theme-dark .status-blocked {
  background: #451a03;
  border-color: #f97316;
  color: #fed7aa;
}

body.theme-dark .status-banned {
  background: #450a0a;
  border-color: #ef4444;
  color: #fecaca;
}

body.theme-dark .role-badge {
  background: #020617;
  border-color: #1d4ed8;
  color: #bfdbfe;
}

/* ============================
   PROFILE – DARK MODE
   ============================ */

body.theme-dark .profile-cover {
  background: #020617;
}

body.theme-dark .profile-hero {
  background: #111b32;
  border-color: #1e293b;
}

body.theme-dark .profile-name {
  color: #e5e7eb;
}

body.theme-dark .profile-email {
  color: #cbd5e1;
}

body.theme-dark .profile-stats {
  color: #94a3b8;
}

body.theme-dark .profile-cover .btn-ghost.small {
  background: #020617;
  border-color: #1e293b;
  color: #e5e7eb;
}

/* ===========================
   UNIVERSAL INPUT DARK MODE 
   =========================== */

body.theme-dark input,
body.theme-dark textarea,
body.theme-dark select {
  background: #020617 !important;
  border: 1px solid #1e293b !important;
  color: #e5e7eb !important;
}

body.theme-dark input::placeholder,
body.theme-dark textarea::placeholder {
  color: #6b7280 !important;
}

body.theme-dark .input-sm,
body.theme-dark input.input-sm {
  background: #020617 !important;
  border: 1px solid #1e293b !important;
  color: #e5e7eb !important;
}

/* File input button */
body.theme-dark .file-input {
  background: #0b1120 !important;
  color: #e5e7eb !important;
  border: 1px solid #1e293b !important;
}

/* Dropzone */
body.theme-dark .dropzone {
  background: #0b1120 !important;
  border: 2px dashed #1e293b !important;
}

body.theme-dark .dz-empty,
body.theme-dark .dz-preview {
  background: #020617 !important;
  color: #e5e7eb !important;
}

/* Labels */
body.theme-dark .label-sm,
body.theme-dark .label {
  color: #cbd5e1 !important;
}

/* =========================================================
   TRUE FIX — Dark Mode Create Form Container
   ========================================================= */
body.theme-dark .create-form {
    background: #111b32 !important;
    border: 1px solid #0b1120 !important;
    box-shadow: none !important;
}

body.theme-dark .create-form * {
    color: #e5e7eb !important;
}

body.theme-dark .create-form .label,
body.theme-dark .create-form .label-row label {
    color: #cbd5e1 !important;
}

body.theme-dark .create-form input::placeholder,
body.theme-dark .create-form textarea::placeholder {
    color: #6b7280 !important;
}

body.theme-dark .btn-ghost {
  background: #0f172a !important;     
  color: #e5e7eb !important;          
  border: 1px solid #334155 !important;
}

body.theme-dark .btn-ghost:hover {
  background: #1e293b !important;    
  color: #ffffff !important;
}

.admin-topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
}

