/* ===== ปุ่มโพสต์ลอย (FAB) + bottom sheet เรื่องราว/ผลลัพธ์ ===== */
:root {
  --post-primary: #014198;
  --post-accent: #F59B23;
  --post-accent-dark: #D97900;
  --post-ink: #07336D;
  --post-muted: #6E7891;
  --post-border: #E4E8EF;
  --post-coral: #E94B57;
}

.post-fab {
  position: fixed;
  right: 18px;
  bottom: 78px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  z-index: 1040;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  background: linear-gradient(135deg, var(--post-accent) 0%, var(--post-accent-dark) 100%);
  color: #fff;
  font-size: 30px;
  line-height: 1;
  box-shadow: 0 8px 22px rgba(245, 155, 35, .5);
  cursor: pointer;
  transition: transform .2s;
}
.post-fab:hover { transform: scale(1.08); color: #fff; }
@media (max-width: 799px) { .post-fab { bottom: 70px; } }

/* type chooser (ในpopupCard) */
.post-type-grid { display: grid; gap: 12px; }
.post-type-card {
  display: flex; align-items: center; gap: 12px;
  padding: 16px; border: 2px solid var(--post-border); border-radius: 16px;
  background: #fff; cursor: pointer; text-align: left; font-family: inherit; width: 100%;
  text-decoration: none; color: inherit;
  transition: border-color .15s, transform .15s;
}
.post-type-card:hover { border-color: var(--post-accent); transform: translateY(-2px); }
.post-type-emoji { width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 24px; flex-shrink: 0; }
.post-type-emoji.s { background: #FFF5E5; }
.post-type-emoji.o { background: #E8F1FF; }
.post-type-name { font-weight: 800; font-size: 15px; color: var(--post-ink); }
.post-type-desc { font-size: 12px; color: var(--post-muted); margin-top: 1px; }

/* form */
.post-field { margin-bottom: 14px; }
.post-label { display: block; font-size: 13px; font-weight: 700; color: var(--post-ink); margin-bottom: 5px; }
.post-label .req { color: var(--post-coral); }
.post-hint { font-weight: 500; font-size: 11px; color: var(--post-muted); }
.post-input {
  width: 100%; padding: 10px 12px; border: 1.5px solid var(--post-border);
  border-radius: 10px; background: #fff; font-family: inherit; font-size: 14px; color: #2A3548;
}
.post-input:focus { outline: none; border-color: var(--post-accent); box-shadow: 0 0 0 3px rgba(245, 155, 35, .12); }
.post-textarea { resize: vertical; min-height: 80px; }

.post-chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.post-chip { position: relative; }
.post-chip input { position: absolute; opacity: 0; pointer-events: none; }
.post-chip span {
  display: inline-block; padding: 7px 13px; border-radius: 999px;
  border: 1.5px solid var(--post-border); font-size: 12px; font-weight: 600; color: var(--post-muted); cursor: pointer;
}
.post-chip input:checked + span { background: var(--post-accent); border-color: var(--post-accent); color: #fff; }
.post-chip-btn {
  padding: 7px 13px; border-radius: 999px; border: 1.5px solid var(--post-border);
  background: #fff; font-size: 12px; font-weight: 600; color: var(--post-muted); cursor: pointer; font-family: inherit;
}
.post-chip-btn.active { background: var(--post-accent); border-color: var(--post-accent); color: #fff; }

/* pictures */
.post-pic-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
@media (max-width: 480px) { .post-pic-grid { grid-template-columns: repeat(3, 1fr); } }
.post-pic-item, .post-pic-add { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; }
.post-pic-item img { width: 100%; height: 100%; object-fit: cover; }
.post-pic-item.uploading { opacity: .5; }
.post-pic-del {
  position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%;
  border: none; background: rgba(0, 0, 0, .6); color: #fff; font-size: 14px; line-height: 1; cursor: pointer;
}
.post-pic-add {
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  border: 2px dashed var(--post-border); background: #F4F6FA; color: var(--post-accent-dark); font-size: 26px;
}

/* public toggle */
.post-public-row { display: flex; align-items: center; gap: 10px; padding: 12px; background: #F4F6FA; border-radius: 12px; margin-bottom: 14px; }
.post-public-title { font-weight: 700; font-size: 13px; color: var(--post-ink); }
.post-public-sub { font-size: 11px; color: var(--post-muted); }
.post-switch { position: relative; width: 42px; height: 24px; margin-left: auto; flex-shrink: 0; }
.post-switch input { opacity: 0; width: 0; height: 0; }
.post-switch span { position: absolute; inset: 0; background: var(--post-border); border-radius: 999px; transition: .2s; }
.post-switch span::before { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; background: #fff; border-radius: 50%; transition: .2s; }
.post-switch input:checked + span { background: var(--post-accent); }
.post-switch input:checked + span::before { left: 21px; }

.post-actions { display: flex; gap: 10px; padding-top: 4px; }
.post-btn { flex: 1; padding: 12px; border-radius: 10px; border: none; font-family: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.post-btn-ghost { background: #fff; color: var(--post-muted); border: 1px solid var(--post-border); flex: 0 0 100px; }
.post-btn-primary { background: var(--post-accent); color: #fff; }
.post-btn-primary:disabled { opacity: .6; cursor: default; }
.post-form-error { padding: 30px 16px; text-align: center; color: var(--post-coral); font-weight: 600; }

/* ===== console feed (เมนู 5/6) ===== */
.post-feed { display: grid; gap: 12px; }
.post-card { display: flex; gap: 12px; background: #fff; border: 1px solid var(--post-border); border-radius: 14px; padding: 14px; }
.post-card-thumb { width: 88px; height: 88px; border-radius: 10px; overflow: hidden; flex-shrink: 0; background: #E8F1FF; position: relative; }
.post-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-card-thumb-empty { display: flex; align-items: center; justify-content: center; height: 100%; font-size: 26px; color: #1762C7; }
.post-card-thumb-multi { position: absolute; top: 4px; right: 4px; background: rgba(0, 0, 0, .7); color: #fff; font-size: 9px; padding: 2px 6px; border-radius: 4px; font-weight: 700; }
.post-card-body { flex: 1; min-width: 0; }
.post-card-meta { font-size: 11px; color: var(--post-muted); }
.post-card-meta strong { color: var(--post-ink); }
.post-card-event { display: inline-block; font-size: 10px; color: var(--post-primary); font-weight: 700; background: #E8F1FF; padding: 2px 7px; border-radius: 5px; margin: 3px 0; }
.post-card-caption { font-size: 13px; color: #2A3548; line-height: 1.5; margin-top: 4px; }
.post-card-foot { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.post-pill { font-size: 10px; padding: 3px 9px; border-radius: 999px; font-weight: 700; }
.post-pill-1 { background: #FFF5E5; color: var(--post-accent-dark); }
.post-pill-2 { background: #E8F1FF; color: var(--post-primary); }
.post-pill-3 { background: #DCFCE7; color: #16A34A; }
.post-pill-4 { background: #FEE2E2; color: #DC2626; }
.post-pill-public { background: #E0F2FE; color: #0369A1; }
.post-card-actions { margin-left: auto; display: flex; gap: 6px; }
.post-act-btn { padding: 5px 11px; border-radius: 7px; border: none; font-size: 11px; font-weight: 700; cursor: pointer; font-family: inherit; }
.post-act-submit { background: var(--post-accent); color: #fff; }
.post-act-edit { background: #F4F6FA; color: var(--post-ink); }
.post-act-del { background: #FEE2E2; color: #DC2626; }
.post-act-cancel { background: #E8F1FF; color: var(--post-primary); }
.post-stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.post-stat { background: #fff; border: 1px solid var(--post-border); border-radius: 12px; padding: 12px; }
.post-stat-num { font-size: 22px; font-weight: 800; color: var(--post-ink); line-height: 1; }
.post-stat-lbl { font-size: 11px; color: var(--post-muted); margin-top: 4px; }
.post-empty { text-align: center; padding: 40px 16px; color: var(--post-muted); }
.post-toolbar { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.post-toolbar-btn { padding: 9px 16px; border-radius: 10px; border: 1px solid var(--post-border); background: #fff; color: var(--post-ink); font-family: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.post-toolbar-btn.primary { background: var(--post-accent); border-color: var(--post-accent); color: #fff; }
.post-tabs { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.post-tab { padding: 6px 13px; border-radius: 8px; border: 1px solid var(--post-border); background: #fff; font-size: 12px; font-weight: 600; color: var(--post-muted); cursor: pointer; font-family: inherit; }
.post-tab.active { background: var(--post-primary); border-color: var(--post-primary); color: #fff; }
