/* =========================================================
   GBook Post Creator — polished composer + modal
   ========================================================= */

:root {
  --pc-blue: #1877f2;
  --pc-blue-deep: #0b5fcc;
  --pc-green: #31a24c;
  --pc-amber: #f0a000;
  --pc-red: #e41e3f;
}

/* --- Feed / Profile composer trigger --- */
.post-creator-box.fb-composer {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(24, 119, 242, 0.06), transparent 42%),
    var(--card-bg, #ffffff);
  border: 1px solid var(--card-border, #e4e6eb);
  border-radius: 18px;
  padding: 14px 16px 12px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

.post-creator-box.fb-composer::before {
  display: none !important;
}

html[data-theme="dark"] .post-creator-box.fb-composer {
  background:
    linear-gradient(135deg, rgba(24, 119, 242, 0.14), transparent 48%),
    #1c1f26;
  border-color: rgba(148, 163, 184, 0.16);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
}

.fb-composer .creator-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

html[data-theme="dark"] .fb-composer .creator-header {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.fb-composer .mini-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #1877f2, #0ea5e9);
  color: #fff;
  font-weight: 800;
  font-size: 17px;
  box-shadow: 0 0 0 3px rgba(24, 119, 242, 0.15);
}

.fb-composer .mini-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.fb-composer .creator-header input {
  flex: 1;
  height: 44px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid transparent;
  padding: 0 18px;
  color: inherit;
  font-size: 15px;
  cursor: pointer;
  outline: none;
  transition: background .2s ease, border-color .2s ease, box-shadow .2s ease;
}

html[data-theme="dark"] .fb-composer .creator-header input {
  background: rgba(255, 255, 255, 0.06);
  color: #e8eef8;
}

.fb-composer .creator-header input:hover {
  background: rgba(24, 119, 242, 0.08);
  border-color: rgba(24, 119, 242, 0.25);
  box-shadow: 0 0 0 3px rgba(24, 119, 242, 0.08);
}

.fb-composer .composer-photo-btn {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 0;
  background: rgba(69, 189, 98, 0.12);
  color: var(--pc-green);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform .2s ease, background .2s ease;
}

.fb-composer .composer-photo-btn:hover {
  transform: translateY(-1px);
  background: rgba(69, 189, 98, 0.2);
}

.fb-composer .creator-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.fb-composer .creator-actions button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.03);
  border: 1px solid transparent;
  color: var(--text-secondary, #65676b);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease, transform .2s ease;
}

html[data-theme="dark"] .fb-composer .creator-actions button {
  background: rgba(255, 255, 255, 0.04);
  color: #b8c0cc;
}

.fb-composer .creator-actions button:hover {
  background: rgba(24, 119, 242, 0.08);
  border-color: rgba(24, 119, 242, 0.18);
  transform: translateY(-1px);
}

/* --- Desktop Modal --- */
.gbook-post-modal {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  max-height: 100vh !important;
  max-height: 100dvh !important;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  box-sizing: border-box;
  margin: 0;
  transform: none !important;
  animation: gbookFadeIn 0.22s ease-out;
}

.gbook-post-modal[hidden],
.gbook-mobile-post-page [hidden],
.gbook-post-modal [hidden],
.gbook-feeling-chip[hidden],
.gbook-category-fields[hidden],
.gbook-preview-grid-wrap[hidden],
.gbook-youtube-input-box[hidden],
.youtube-live-preview[hidden],
.gbook-feelings-menu[hidden],
.gbook-post-error[hidden],
[hidden] {
  display: none !important;
}

.gbook-post-modal-backdrop {
  position: absolute;
  inset: 0;
  background: #0b111e !important;
  z-index: 1;
}

html:not([data-theme="dark"]) .gbook-post-modal-backdrop {
  background: #1e293b !important;
}

.gbook-post-modal-dialog {
  position: relative;
  z-index: 2;
  width: min(560px, 100%);
  max-height: min(92vh, 820px);
  margin: auto;
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(180deg, rgba(24, 119, 242, 0.08), transparent 28%),
    #161b22;
  color: #e8eef8;
  border-radius: 22px;
  box-shadow:
    0 28px 80px rgba(2, 8, 23, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(148, 163, 184, 0.18);
  overflow: hidden;
  animation: gbookSlideUp 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

html:not([data-theme="dark"]) .gbook-post-modal-dialog {
  background:
    linear-gradient(180deg, rgba(24, 119, 242, 0.07), transparent 30%),
    #ffffff;
  color: #0f172a;
  border-color: rgba(15, 23, 42, 0.08);
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.22);
}

.gbook-post-modal-accent {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #0ea5e9, #1877f2 45%, #38bdf8);
}

@keyframes gbookFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes gbookSlideUp {
  from { opacity: 0; transform: translateY(18px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.gbook-post-modal-header {
  position: relative;
  padding: 20px 22px 14px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

html:not([data-theme="dark"]) .gbook-post-modal-header {
  border-bottom-color: rgba(15, 23, 42, 0.06);
}

.gbook-post-modal-heading {
  padding-right: 44px;
}

.gbook-post-modal-kicker {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #60a5fa;
  margin-bottom: 4px;
}

html:not([data-theme="dark"]) .gbook-post-modal-kicker {
  color: #1877f2;
}

.gbook-post-modal-header h3 {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
  line-height: 1.2;
  color: inherit;
}

.gbook-post-modal-sub {
  margin: 4px 0 0;
  font-size: 13px;
  color: #94a3b8;
  line-height: 1.4;
}

html:not([data-theme="dark"]) .gbook-post-modal-sub {
  color: #64748b;
}

.gbook-post-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: inherit;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .2s ease, transform .2s ease, border-color .2s ease;
}

html:not([data-theme="dark"]) .gbook-post-modal-close {
  background: #f1f5f9;
  border-color: #e2e8f0;
  color: #475569;
}

.gbook-post-modal-close:hover {
  background: rgba(228, 30, 63, 0.18);
  border-color: rgba(228, 30, 63, 0.35);
  color: #fb7185;
  transform: rotate(90deg);
}

.gbook-post-form {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  min-height: 0;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 16px 22px 18px;
  gap: 14px;
  flex: 1;
}

.gbook-post-author-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.gbook-post-author-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(145deg, #1877f2, #0ea5e9);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(24, 119, 242, 0.18);
}

.gbook-post-author-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gbook-post-author-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.gbook-post-author-meta .author-name {
  font-size: 15.5px;
  font-weight: 800;
  color: inherit;
  line-height: 1.2;
}

.gbook-mode-toggle-wrap {
  display: inline-flex;
  flex-wrap: wrap;
  background: rgba(255, 255, 255, 0.06);
  padding: 3px;
  border-radius: 999px;
  gap: 3px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

html:not([data-theme="dark"]) .gbook-mode-toggle-wrap {
  background: #f1f5f9;
  border-color: #e2e8f0;
}

.mode-toggle-btn {
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

html:not([data-theme="dark"]) .mode-toggle-btn {
  color: #64748b;
}

.mode-toggle-btn.is-active {
  background: linear-gradient(135deg, #1877f2, #0ea5e9);
  color: #ffffff !important;
  box-shadow: 0 6px 16px rgba(24, 119, 242, 0.35);
}

.gbook-feeling-chip:not([hidden]) {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(24, 119, 242, 0.12);
  border: 1px solid rgba(24, 119, 242, 0.28);
  color: #93c5fd;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  align-self: flex-start;
  animation: gbookFadeIn .2s ease;
}

html:not([data-theme="dark"]) .gbook-feeling-chip:not([hidden]) {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.chip-remove-btn {
  background: transparent;
  border: none;
  color: inherit;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

/* --- Unified Post Composer Box (as shown in reference image media_1789197208187.png) --- */
.gbook-unified-box {
  position: relative;
  width: 100%;
  min-height: 175px;
  background: #08111e;
  border: 1.5px solid #0084ff;
  border-radius: 14px;
  padding: 16px 16px 42px 16px;
  box-shadow: 0 0 0 1px rgba(0, 132, 255, 0.22), 0 8px 24px rgba(0, 132, 255, 0.08);
  display: flex;
  flex-direction: column;
  cursor: text;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
}

html:not([data-theme="dark"]) .gbook-unified-box {
  background: #f8fafc;
  border-color: #0084ff;
  box-shadow: 0 0 0 1px rgba(0, 132, 255, 0.2), 0 6px 18px rgba(0, 132, 255, 0.06);
}

.gbook-unified-box:focus-within {
  border-color: #0084ff;
  box-shadow: 0 0 0 2px rgba(0, 132, 255, 0.35), 0 8px 28px rgba(0, 132, 255, 0.15);
}

/* Ensure all textarea elements inside unified box are completely transparent and borderless, overriding any global theme.css styles */
html[data-theme="dark"] .gbook-unified-box textarea,
html:not([data-theme="dark"]) .gbook-unified-box textarea,
.gbook-unified-box textarea,
.gbook-unified-box textarea:focus,
.gbook-unified-box textarea:hover {
  background-color: transparent !important;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
}

.gbook-box-headline,
html[data-theme="dark"] .gbook-unified-box .gbook-box-headline,
.gbook-unified-box .gbook-box-headline {
  width: 100%;
  background-color: transparent !important;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  color: #ffffff !important;
  font-family: inherit;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.4;
  padding: 0 !important;
  margin: 0;
  resize: none;
  overflow: hidden;
  display: block;
}

html:not([data-theme="dark"]) .gbook-box-headline,
html:not([data-theme="dark"]) .gbook-unified-box .gbook-box-headline {
  color: #0f172a !important;
}

.gbook-box-headline::placeholder {
  color: #64748b !important;
  font-weight: 500;
}

.gbook-box-desc,
html[data-theme="dark"] .gbook-unified-box .gbook-box-desc,
.gbook-unified-box .gbook-box-desc {
  width: 100%;
  background-color: transparent !important;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  color: #cbd5e1 !important;
  font-family: inherit;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.6;
  padding: 8px 0 0 !important;
  margin: 0;
  resize: none;
  overflow-y: auto;
  min-height: 65px;
  display: block;
  animation: gbookFadeIn 0.2s ease;
}

html:not([data-theme="dark"]) .gbook-box-desc,
html:not([data-theme="dark"]) .gbook-unified-box .gbook-box-desc {
  color: #334155 !important;
}

.gbook-box-desc::placeholder {
  color: #94a3b8 !important;
}

/* Headline wrapper & Interactive Enter Hint */
.gbook-headline-wrap {
  position: relative;
  width: 100%;
}

.gbook-headline-hint:not([hidden]) {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 6px 0 4px;
  animation: gbookFadeIn 0.2s ease;
}

.btn-headline-enter {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: linear-gradient(135deg, #0084ff 0%, #0070df 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
  color: #ffffff !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  padding: 6px 14px !important;
  border-radius: 999px !important;
  cursor: pointer !important;
  transition: all 0.18s ease;
  user-select: none;
  line-height: 1.4;
  box-shadow: 0 4px 14px rgba(0, 132, 255, 0.4) !important;
}

.btn-headline-enter:hover,
.btn-headline-enter:active {
  background: #0073e6 !important;
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 6px 18px rgba(0, 132, 255, 0.5) !important;
}

.btn-headline-enter i {
  font-size: 12px;
}

html:not([data-theme="dark"]) .btn-headline-enter {
  background: #0084ff !important;
  color: #ffffff !important;
}

.gbook-box-footer {
  position: absolute;
  right: 14px;
  bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 2;
  user-select: none;
}

.btn-box-emoji {
  background: transparent;
  border: none;
  color: #8a9aa8;
  font-size: 17px;
  padding: 0;
  margin: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease, transform 0.15s ease;
  line-height: 1;
}

.btn-box-emoji:hover {
  color: #f59e0b;
  transform: scale(1.15);
}

.box-char-counter {
  font-size: 13px;
  font-weight: 500;
  color: #64748b;
  letter-spacing: 0.02em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.gbook-category-fields:not([hidden]) {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: transparent;
  padding: 4px 0 0;
  border-radius: 0;
  border: none;
  overflow: visible;
}

html:not([data-theme="dark"]) .gbook-category-fields {
  background: transparent;
  border: none;
}

.cat-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.cat-field-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.cat-field-group label {
  font-size: 12px;
  font-weight: 700;
  color: #94a3b8;
}

html:not([data-theme="dark"]) .cat-field-group label {
  color: #475569;
}

.cat-field-group .req {
  color: #e41e3f;
}

.cat-field-input {
  width: 100%;
  height: 42px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: inherit;
  padding: 0 12px;
  font-size: 14px;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}

html:not([data-theme="dark"]) .cat-field-input {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #0f172a;
}

.cat-field-input:focus {
  border-color: #1877f2;
  box-shadow: 0 0 0 3px rgba(24, 119, 242, 0.18);
}

.gbook-category-fields .form-row-ec,
.gbook-category-fields .cat-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 600px) {
  .gbook-category-fields .form-row-ec,
  .gbook-category-fields .cat-field-row {
    grid-template-columns: 1fr;
  }
}
.gbook-category-fields .ec-section-box {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 14px;
  padding: 14px;
  margin: 12px 0;
}
html:not([data-theme="dark"]) .gbook-category-fields .ec-section-box {
  background: #f8fafc;
  border-color: #e2e8f0;
}
.gbook-category-fields .ec-section-box h4 {
  font-size: 14px;
  margin: 0 0 10px;
}
.gbook-category-fields .attr-row,
.gbook-category-fields .var-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
  margin-bottom: 8px;
  align-items: center;
}
.gbook-category-fields .var-row {
  grid-template-columns: 1fr 1fr 72px 72px 1fr auto;
}
@media (max-width: 768px) {
  .gbook-category-fields .var-row {
    grid-template-columns: 1fr 1fr;
  }
}
.gbook-category-fields .btn-ec-add {
  background: #ebf8ff;
  color: #2b6cb0;
  border: 1px dashed #90cdf4;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  margin-top: 6px;
}
.gbook-category-fields .btn-ec-mini {
  background: transparent;
  border: 1px solid #e2e8f0;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
}
.gbook-category-fields .btn-ec-mini.danger {
  color: #c53030;
}
.gbook-category-fields textarea.cat-field-input {
  height: auto;
  min-height: 88px;
  padding: 10px 12px;
}

.gbook-preview-grid-wrap:not([hidden]) {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 22px;
  border: 1px dashed rgba(148, 163, 184, 0.35);
  padding: 12px;
  overflow: visible !important;
  flex-shrink: 0 !important;
}

html:not([data-theme="dark"]) .gbook-preview-grid-wrap:not([hidden]) {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.preview-grid-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  font-weight: 700;
  color: #94a3b8;
}

html:not([data-theme="dark"]) .preview-grid-header {
  color: #475569;
}

.btn-add-more-photos {
  background: rgba(24, 119, 242, 0.12);
  border: 1px solid rgba(24, 119, 242, 0.25);
  color: #60a5fa;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s ease;
}

.btn-add-more-photos:hover {
  background: rgba(24, 119, 242, 0.2);
}

html:not([data-theme="dark"]) .btn-add-more-photos {
  color: #1877f2;
}

.gbook-preview-thumbnails {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 8px;
}

.preview-thumb-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  background: #0f172a;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.preview-thumb-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumb-remove-btn,
.btn-remove-thumb {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.78);
  border: 2px solid rgba(255, 255, 255, 0.9);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  z-index: 5;
  padding: 0;
  transition: transform 0.15s ease, background .15s ease;
}

.thumb-remove-btn:hover,
.btn-remove-thumb:hover {
  transform: scale(1.1);
  background: #e41e3f;
}

html[data-theme="dark"] .gbook-youtube-input-box:not([hidden]),
.gbook-youtube-input-box:not([hidden]) {
  background: #08111e !important;
  border-radius: 14px !important;
  padding: 10px 14px !important;
  border: 1.5px solid rgba(239, 68, 68, 0.45) !important;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
  box-shadow: 0 4px 18px rgba(239, 68, 68, 0.12) !important;
}

html:not([data-theme="dark"]) .gbook-youtube-input-box:not([hidden]) {
  background: #fef2f2 !important;
  border-color: rgba(239, 68, 68, 0.35) !important;
}

.youtube-input-inner {
  display: flex;
  align-items: center;
  gap: 10px;
}

.youtube-icon {
  font-size: 20px;
  color: #ef4444;
}

html[data-theme="dark"] .youtube-input-inner input,
html:not([data-theme="dark"]) .youtube-input-inner input,
.youtube-input-inner input,
.youtube-input-inner input:focus,
.youtube-input-inner input:hover {
  flex: 1;
  background-color: transparent !important;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  color: #ffffff !important;
  font-size: 14px;
  font-family: inherit;
  padding: 4px 0 !important;
}

html:not([data-theme="dark"]) .youtube-input-inner input {
  color: #0f172a !important;
}

.youtube-input-inner input::placeholder {
  color: #64748b !important;
}

.box-close-btn,
.menu-close-btn {
  background: transparent;
  border: none;
  color: inherit;
  font-size: 18px;
  cursor: pointer;
}

.youtube-live-preview:not([hidden]) iframe {
  width: 100%;
  height: 180px;
  border-radius: 12px;
  border: none;
}

/* --- GBook Poll Creation Box --- */
.gbook-poll-box:not([hidden]) {
  background: #08111e !important;
  border-radius: 14px !important;
  padding: 14px 16px !important;
  border: 1.5px solid rgba(245, 158, 11, 0.45) !important;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 4px 18px rgba(245, 158, 11, 0.12) !important;
}

html:not([data-theme="dark"]) .gbook-poll-box:not([hidden]) {
  background: #fffbeb !important;
  border-color: rgba(245, 158, 11, 0.4) !important;
}

.poll-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 700;
  color: #f59e0b;
}

.poll-question-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14.5px;
  font-weight: 600;
  color: inherit;
  box-sizing: border-box;
}

html:not([data-theme="dark"]) .poll-question-input {
  background: #ffffff;
  border-color: #fcd34d;
  color: #1e293b;
}

.poll-options-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.poll-opt-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.poll-opt-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(245, 158, 11, 0.18);
  color: #f59e0b;
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.poll-opt-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13.5px;
  color: inherit;
  box-sizing: border-box;
}

html:not([data-theme="dark"]) .poll-opt-input {
  background: #ffffff;
  border-color: #e2e8f0;
  color: #1e293b;
}

.poll-opt-remove {
  background: transparent;
  border: none;
  color: #ef4444;
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  line-height: 1;
}

.btn-add-poll-opt {
  align-self: flex-start;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.28);
  color: #f59e0b;
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-add-poll-opt:hover {
  background: rgba(245, 158, 11, 0.22);
}

/* --- Feed Poll Display Styles --- */
.feed-poll-widget {
  margin: 12px 18px 14px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(24, 119, 242, 0.04);
  border: 1px solid rgba(24, 119, 242, 0.14);
}

html[data-theme="dark"] .feed-poll-widget {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.08);
}

.feed-poll-question {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-heading);
}

.feed-poll-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.feed-poll-opt-btn {
  position: relative;
  width: 100%;
  padding: 11px 14px;
  border-radius: 10px;
  background: var(--surface-2, #ffffff);
  border: 1.5px solid var(--card-border, #e2e8f0);
  cursor: pointer;
  text-align: left;
  overflow: hidden;
  transition: all 0.2s ease;
  font-family: inherit;
}

html[data-theme="dark"] .feed-poll-opt-btn {
  background: #1a2332;
  border-color: #2a3547;
}

.feed-poll-opt-btn:hover {
  border-color: #1877f2;
}

.feed-poll-opt-btn.has-voted {
  border-color: #3b82f6;
}

.feed-poll-progress-bar {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  background: rgba(24, 119, 242, 0.18);
  border-radius: 8px;
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.feed-poll-opt-btn.is-winner .feed-poll-progress-bar {
  background: rgba(16, 185, 129, 0.22);
}

.feed-poll-opt-content {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.feed-poll-opt-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-heading);
}

.feed-poll-radio-circle {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid #94a3b8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.feed-poll-opt-btn.is-my-pick .feed-poll-radio-circle {
  border-color: #1877f2;
  background: #1877f2;
}

.feed-poll-radio-inner {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  display: none;
}

.feed-poll-opt-btn.is-my-pick .feed-poll-radio-inner {
  display: block;
}

.feed-poll-opt-pct {
  font-size: 13px;
  font-weight: 800;
  color: #1877f2;
}

.feed-poll-opt-btn.is-winner .feed-poll-opt-pct {
  color: #10b981;
}

.feed-poll-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 8px;
  font-size: 12px;
  color: var(--text-subtle, #94a3b8);
}

.gbook-post-toolbar {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 8px 10px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background:
    linear-gradient(90deg, rgba(24, 119, 242, 0.08), transparent 40%),
    rgba(255, 255, 255, 0.03);
  overflow: hidden;
  box-sizing: border-box;
}

.gbook-post-toolbar[hidden],
.gbook-mobile-bottom-toolbar[hidden] {
  display: none !important;
}

html:not([data-theme="dark"]) .gbook-post-toolbar {
  border-color: #e2e8f0;
  background:
    linear-gradient(90deg, rgba(24, 119, 242, 0.06), transparent 42%),
    #f8fafc;
}

.toolbar-title {
  display: none !important;
}

.toolbar-icons {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.toolbar-icon-btn {
  flex: 1 1 0;
  min-width: 0;
  min-height: 44px;
  padding: 0 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: inherit;
}

html:not([data-theme="dark"]) .toolbar-icon-btn {
  background: #ffffff;
  border-color: #e2e8f0;
  color: #1e293b;
}

.toolbar-icon-btn .tb-ico {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 17px;
  flex-shrink: 0;
}

.toolbar-icon-btn.is-photo .tb-ico { background: rgba(69, 189, 98, 0.15); color: #31a24c; }
.toolbar-icon-btn.is-feel .tb-ico { background: rgba(240, 160, 0, 0.15); color: #f0a000; }
.toolbar-icon-btn.is-yt .tb-ico { background: rgba(255, 0, 0, 0.12); color: #ff0000; }
.toolbar-icon-btn.is-cat .tb-ico { background: rgba(24, 119, 242, 0.14); color: #1877f2; }

.toolbar-icon-btn .tb-label {
  font-size: 13px;
  font-weight: 700;
  color: #94a3b8;
  white-space: nowrap;
}

html:not([data-theme="dark"]) .toolbar-icon-btn .tb-label {
  color: #1e293b;
}

.toolbar-icon-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(24, 119, 242, 0.28);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
}

.gbook-feelings-menu:not([hidden]) {
  background: #1c2330;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 16px;
  padding: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  animation: gbookFadeIn .18s ease;
}

.gbook-feelings-menu[hidden] {
  display: none !important;
}

html:not([data-theme="dark"]) .gbook-feelings-menu {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.12);
}

.feelings-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13.5px;
  font-weight: 800;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

html:not([data-theme="dark"]) .feelings-menu-header {
  border-bottom-color: #e2e8f0;
  color: #0f172a;
}

.menu-close-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 6px;
}

.menu-close-btn:hover {
  color: #ef4444;
}

html:not([data-theme="dark"]) .menu-close-btn {
  color: #64748b;
}

.feelings-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  max-height: 190px;
  overflow-y: auto;
}

.feeling-item {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 8px 10px;
  color: inherit;
  font-size: 13px;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  transition: all 0.15s ease;
}

html:not([data-theme="dark"]) .feeling-item {
  background: #f8fafc;
  color: #0f172a;
}

.feeling-item:hover {
  background: rgba(24, 119, 242, 0.16);
  border-color: rgba(24, 119, 242, 0.28);
  color: #93c5fd;
}

.gbook-post-error {
  background: rgba(228, 30, 63, 0.14);
  border: 1px solid rgba(228, 30, 63, 0.4);
  color: #fb7185;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 13.5px;
}

html:not([data-theme="dark"]) .gbook-post-error {
  background: #fff1f2;
  color: #be123c;
}

.gbook-post-footer {
  padding-top: 2px;
}

.gbook-btn-post {
  width: 100%;
  min-height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, #1877f2 0%, #0ea5e9 100%);
  color: #ffffff;
  border: none;
  font-size: 15.5px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 12px 28px rgba(24, 119, 242, 0.35);
  transition: transform .2s ease, box-shadow .2s ease, opacity .2s ease;
}

.gbook-btn-post:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 16px 32px rgba(24, 119, 242, 0.42);
}

.gbook-btn-post:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Mobile create-post page shell */
.gbook-mobile-post-page {
  min-height: calc(100vh - 70px);
  background:
    radial-gradient(circle at top right, rgba(24, 119, 242, 0.16), transparent 28%),
    #12161d;
  color: #e8eef8;
}

html:not([data-theme="dark"]) .gbook-mobile-post-page {
  background:
    radial-gradient(circle at top right, rgba(24, 119, 242, 0.1), transparent 30%),
    #f8fafc;
  color: #0f172a;
}

.mobile-post-container {
  max-width: 640px;
  margin: 0 auto;
  padding-bottom: 84px;
}

.mobile-post-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(18, 22, 29, 0.85);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 20;
}

html:not([data-theme="dark"]) .mobile-post-topbar {
  border-bottom-color: rgba(15, 23, 42, 0.06);
  background: rgba(255, 255, 255, 0.9);
}

.mobile-topbar-back {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 16px;
  color: inherit;
  background: rgba(255, 255, 255, 0.06);
  text-decoration: none;
}

html:not([data-theme="dark"]) .mobile-topbar-back {
  background: #f1f5f9;
}

.mobile-topbar-title {
  font-size: 17px;
  font-weight: 800;
  margin: 0;
}

.mobile-topbar-submit {
  background: linear-gradient(135deg, #1877f2, #0ea5e9);
  color: #ffffff;
  border: none;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(24, 119, 242, 0.3);
}

.gbook-mobile-post-page .gbook-post-form {
  padding: 16px;
}

.gbook-mobile-bottom-toolbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(22, 27, 34, 0.94);
  border-top: 1px solid rgba(148, 163, 184, 0.16);
  z-index: 100;
  padding: 8px 12px max(8px, env(safe-area-inset-bottom));
  backdrop-filter: blur(12px);
}

html:not([data-theme="dark"]) .gbook-mobile-bottom-toolbar {
  background: rgba(255, 255, 255, 0.95);
  border-top-color: #e2e8f0;
}

.mobile-toolbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-around;
  max-width: 600px;
  margin: 0 auto;
}

.mobile-tb-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: transparent;
  border: none;
  color: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 12px;
}

.mobile-tb-btn:hover {
  background: rgba(24, 119, 242, 0.1);
}

.mobile-tb-btn i {
  font-size: 18px;
}

@media (max-width: 540px) {
  .cat-field-row { grid-template-columns: 1fr; }
}

/* --- Feed Multi-Image Collage Grids --- */
.post-images-collage {
  display: grid;
  gap: 3px;
  width: 100%;
  background: #000000;
  overflow: hidden;
  border-radius: 6px;
  margin-top: 8px;
}

/* 1 Image: Full */
.post-images-collage.collage-1 {
  grid-template-columns: 1fr;
  max-height: 520px;
}

.post-images-collage.collage-1 .collage-img-item {
  height: auto;
  max-height: 520px;
}

/* 2 Images: 2 columns */
.post-images-collage.collage-2 {
  grid-template-columns: 1fr 1fr;
  height: 340px;
}

/* 3 Images: 1 large left, 2 stacked right */
.post-images-collage.collage-3 {
  grid-template-columns: 1.25fr 1fr;
  grid-template-rows: 1fr 1fr;
  height: 380px;
}

.post-images-collage.collage-3 .collage-img-item:first-child {
  grid-row: span 2;
}

/* 4 Images: 2x2 grid */
.post-images-collage.collage-4 {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  height: 400px;
}

/* 5+ Images: 2x2 grid with overlay on 4th */
.post-images-collage.collage-5-plus {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  height: 400px;
}

.collage-img-item {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  cursor: pointer;
  background: #1c1e21;
}

.collage-img-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.25s ease;
}

.collage-img-item:hover img {
  transform: scale(1.03);
}

.collage-more-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 32px;
  font-weight: 800;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  pointer-events: none;
}

/* Feelings in Post Card Header */
.post-feeling-badge {
  font-size: 13.5px;
  font-weight: normal;
  color: #94a3b8;
  margin-left: 4px;
}

html:not([data-theme="dark"]) .post-feeling-badge {
  color: #65676b;
}

.post-feeling-badge .feeling-highlight {
  font-weight: 600;
  color: #38bdf8;
}

html:not([data-theme="dark"]) .post-feeling-badge .feeling-highlight {
  color: #1877f2;
}

/* --- 3. Fullscreen Lightbox Viewer --- */
.gbook-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000000;
  background: rgba(0, 0, 0, 0.94);
  display: flex;
  flex-direction: column;
  animation: gbookFadeIn 0.2s ease;
}

.gbook-lightbox[hidden] {
  display: none !important;
}

.gbook-lightbox-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  color: #ffffff;
  z-index: 2;
}

.gbook-lightbox-counter {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.gbook-lightbox-close {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #ffffff;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.gbook-lightbox-close:hover {
  background: #e41e3f;
  transform: scale(1.1);
}

.gbook-lightbox-stage {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 60px;
  overflow: hidden;
}

.gbook-lightbox-img {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
  user-select: none;
}

.gbook-lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #ffffff;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 2;
}

.gbook-lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.35);
  transform: translateY(-50%) scale(1.1);
}

.gbook-lightbox-prev {
  left: 14px;
}

.gbook-lightbox-next {
  right: 14px;
}

/* Lightbox Bottom Footer / Quick React */
.gbook-lightbox-footer {
  padding: 12px 20px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 2;
}

.lightbox-react-btn {
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: #ffffff;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.lightbox-react-btn:hover {
  background: #1877f2;
}

/* Small adjustments for small screen */
@media (max-width: 540px) {
  .post-images-collage.collage-2,
  .post-images-collage.collage-3,
  .post-images-collage.collage-4,
  .post-images-collage.collage-5-plus {
    height: 280px;
  }

  .gbook-lightbox-stage {
    padding: 0 10px;
  }
}

/* Mobile Full-Screen Popup Modal (as requested: full page popup on mobile) */
@media (max-width: 768px) {
  .gbook-post-modal {
    padding: 12px 10px !important;
    align-items: center !important;
    justify-content: center !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
  }

  html[data-theme="dark"] .gbook-post-modal-backdrop,
  .gbook-post-modal-backdrop {
    background: #0b111e !important;
  }

  html:not([data-theme="dark"]) .gbook-post-modal-backdrop {
    background: #1e293b !important;
  }

  .gbook-post-modal-dialog {
    width: calc(100vw - 20px) !important;
    max-width: min(520px, calc(100vw - 20px)) !important;
    height: calc(100dvh - 24px) !important;
    max-height: calc(100dvh - 24px) !important;
    border-radius: 18px !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }

  html[data-theme="dark"] .gbook-post-modal-dialog,
  .gbook-post-modal-dialog {
    background: #0c1524 !important;
    color: #e8eef8 !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(0, 132, 255, 0.25) !important;
  }

  html:not([data-theme="dark"]) .gbook-post-modal-dialog {
    background: #ffffff !important;
    color: #0f172a !important;
    border: 1px solid rgba(15, 23, 42, 0.12) !important;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.22), 0 0 0 1px rgba(0, 132, 255, 0.18) !important;
  }

  .gbook-post-modal-header {
    padding: 14px 16px !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 10 !important;
    flex-shrink: 0 !important;
  }

  html[data-theme="dark"] .gbook-post-modal-header,
  .gbook-post-modal-header {
    background: #0c1524 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  }

  html:not([data-theme="dark"]) .gbook-post-modal-header {
    background: #ffffff !important;
    border-bottom: 1px solid #e2e8f0 !important;
  }

  .gbook-post-modal-kicker {
    font-size: 11px !important;
  }

  .gbook-post-modal-heading h3 {
    font-size: 22px !important;
    font-weight: 800 !important;
  }

  html[data-theme="dark"] .gbook-post-modal-heading h3 {
    color: #ffffff !important;
  }

  html:not([data-theme="dark"]) .gbook-post-modal-heading h3 {
    color: #0f172a !important;
  }

  .gbook-post-modal-sub {
    font-size: 12.5px !important;
  }

  html[data-theme="dark"] .gbook-post-modal-sub {
    color: #94a3b8 !important;
  }

  html:not([data-theme="dark"]) .gbook-post-modal-sub {
    color: #64748b !important;
  }

  .gbook-post-modal-close {
    width: 38px !important;
    height: 38px !important;
    top: 14px !important;
    right: 14px !important;
  }

  html:not([data-theme="dark"]) .gbook-post-modal-close {
    background: #f1f5f9 !important;
    border-color: #e2e8f0 !important;
    color: #475569 !important;
  }

  .gbook-post-form {
    padding: 14px 14px 32px !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior: contain !important;
    gap: 14px !important;
  }

  .gbook-preview-grid-wrap:not([hidden]) {
    flex-shrink: 0 !important;
    min-height: 110px !important;
    overflow: visible !important;
  }

  .gbook-preview-thumbnails {
    min-height: 84px !important;
    flex-shrink: 0 !important;
  }

  .preview-thumb-item {
    min-height: 84px !important;
    flex-shrink: 0 !important;
  }

  .gbook-post-toolbar {
    flex-shrink: 0 !important;
  }

  .gbook-post-footer {
    flex-shrink: 0 !important;
  }

  /* Author Row on mobile */
  .gbook-post-author-row {
    gap: 10px !important;
  }

  .gbook-post-author-avatar {
    width: 44px !important;
    height: 44px !important;
  }

  .author-name {
    font-size: 15px !important;
    font-weight: 700 !important;
  }

  html[data-theme="dark"] .author-name {
    color: #ffffff !important;
  }

  html:not([data-theme="dark"]) .author-name {
    color: #0f172a !important;
  }

  .mode-toggle-btn {
    font-size: 13px !important;
    padding: 7px 14px !important;
  }

  html:not([data-theme="dark"]) .mode-toggle-btn {
    background: #f1f5f9 !important;
    border-color: #e2e8f0 !important;
    color: #475569 !important;
  }

  html:not([data-theme="dark"]) .mode-toggle-btn.is-active {
    background: #0084ff !important;
    border-color: #0084ff !important;
    color: #ffffff !important;
  }

  /* Unified Composer Box on mobile */
  .gbook-unified-box {
    min-height: 190px !important;
    padding: 16px 14px 44px 14px !important;
    border-radius: 16px !important;
  }

  html[data-theme="dark"] .gbook-unified-box,
  .gbook-unified-box {
    background: #08111e !important;
    border: 1.5px solid #0084ff !important;
  }

  html:not([data-theme="dark"]) .gbook-unified-box {
    background: #f8fafc !important;
    border: 1.5px solid #0084ff !important;
    box-shadow: 0 0 0 1px rgba(0, 132, 255, 0.2) !important;
  }

  .gbook-box-headline {
    font-size: 20px !important;
    font-weight: 700 !important;
    line-height: 1.4 !important;
  }

  html[data-theme="dark"] .gbook-box-headline {
    color: #ffffff !important;
  }

  html:not([data-theme="dark"]) .gbook-box-headline {
    color: #0f172a !important;
  }

  .gbook-box-desc {
    font-size: 16px !important;
    line-height: 1.6 !important;
    padding-top: 10px !important;
  }

  html[data-theme="dark"] .gbook-box-desc {
    color: #cbd5e1 !important;
  }

  html:not([data-theme="dark"]) .gbook-box-desc {
    color: #334155 !important;
  }

  .btn-headline-enter {
    font-size: 12.5px !important;
    padding: 7px 14px !important;
  }

  /* Toolbar on mobile */
  .gbook-post-toolbar {
    padding: 8px 8px !important;
    border-radius: 14px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  html[data-theme="dark"] .gbook-post-toolbar,
  .gbook-post-toolbar {
    background: #0e1a2c !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
  }

  html:not([data-theme="dark"]) .gbook-post-toolbar {
    background: #f1f5f9 !important;
    border: 1px solid #e2e8f0 !important;
  }

  .toolbar-title {
    display: none !important;
  }

  .toolbar-icons {
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
  }

  .toolbar-icon-btn {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    min-height: 44px !important;
    padding: 0 4px !important;
    border-radius: 10px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
  }

  html[data-theme="dark"] .toolbar-icon-btn,
  .toolbar-icon-btn {
    background: #142236 !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    color: #cbd5e1 !important;
  }

  html:not([data-theme="dark"]) .toolbar-icon-btn {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    color: #1e293b !important;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06) !important;
  }

  .toolbar-icon-btn .tb-ico {
    width: 28px !important;
    height: 28px !important;
    font-size: 16px !important;
    border-radius: 7px !important;
    display: grid !important;
    place-items: center !important;
    flex-shrink: 0 !important;
  }

  .toolbar-icon-btn .tb-label {
    display: inline-block !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  html[data-theme="dark"] .toolbar-icon-btn .tb-label {
    color: #cbd5e1 !important;
  }

  html:not([data-theme="dark"]) .toolbar-icon-btn .tb-label {
    color: #1e293b !important;
  }

  /* Submit button on mobile */
  .gbook-btn-post {
    min-height: 50px !important;
    font-size: 16px !important;
    border-radius: 14px !important;
  }
}

/* ==========================================================================
   GBook Auth Required Login Prompt Modal (for unlogged visitors)
   ========================================================================== */
.gbook-auth-modal {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  max-height: 100dvh !important;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  margin: 0;
  transform: none !important;
  overflow: auto;
}

.gbook-auth-modal[hidden] {
  display: none !important;
}

.gbook-auth-backdrop {
  position: absolute;
  inset: 0;
  background: #0b111e !important;
  animation: gbookFadeIn 0.2s ease;
  z-index: 1;
}

html:not([data-theme="dark"]) .gbook-auth-backdrop {
  background: #1e293b !important;
}

.gbook-auth-dialog {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 420px;
  border-radius: 22px;
  padding: 32px 24px 26px;
  text-align: center;
  box-sizing: border-box;
  overflow: hidden;
  animation: gbookAuthZoomIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(0, 132, 255, 0.25);
}

@keyframes gbookAuthZoomIn {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Dark theme dialog surface */
html[data-theme="dark"] .gbook-auth-dialog,
.gbook-auth-dialog {
  background: #0f1a2c;
  background-image: radial-gradient(ellipse at top, rgba(0, 132, 255, 0.16), transparent 70%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
}

/* Light theme dialog surface */
html:not([data-theme="dark"]) .gbook-auth-dialog {
  background: #ffffff;
  background-image: radial-gradient(ellipse at top, rgba(0, 132, 255, 0.08), transparent 70%);
  border: 1px solid rgba(15, 23, 42, 0.1);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.2), 0 0 0 1px rgba(0, 132, 255, 0.15);
  color: #0f172a;
}

/* Close button */
.gbook-auth-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  font-size: 20px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

html[data-theme="dark"] .gbook-auth-close,
.gbook-auth-close {
  background: rgba(255, 255, 255, 0.08);
  color: #94a3b8;
}

html[data-theme="dark"] .gbook-auth-close:hover,
.gbook-auth-close:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  transform: scale(1.05);
}

html:not([data-theme="dark"]) .gbook-auth-close {
  background: #f1f5f9;
  color: #64748b;
}

html:not([data-theme="dark"]) .gbook-auth-close:hover {
  background: #e2e8f0;
  color: #0f172a;
  transform: scale(1.05);
}

/* Visual Icon Badge */
.gbook-auth-badge {
  display: flex;
  justify-content: center;
  margin-bottom: 18px;
}

.gbook-auth-badge-icon {
  width: 66px;
  height: 66px;
  border-radius: 20px;
  background: linear-gradient(135deg, #0084ff 0%, #00c6ff 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 26px;
  box-shadow: 0 12px 28px rgba(0, 132, 255, 0.38);
  animation: gbookAuthBounce 2s ease infinite;
}

@keyframes gbookAuthBounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

/* Typography */
.gbook-auth-title {
  font-size: 21px;
  font-weight: 800;
  margin: 0 0 8px;
  line-height: 1.3;
}

html[data-theme="dark"] .gbook-auth-title,
.gbook-auth-title {
  color: #ffffff;
}

html:not([data-theme="dark"]) .gbook-auth-title {
  color: #0f172a;
}

.gbook-auth-desc {
  font-size: 14px;
  line-height: 1.55;
  margin: 0 0 18px;
}

html[data-theme="dark"] .gbook-auth-desc,
.gbook-auth-desc {
  color: #94a3b8;
}

html:not([data-theme="dark"]) .gbook-auth-desc {
  color: #475569;
}

/* Features List */
.gbook-auth-features {
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 22px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

html[data-theme="dark"] .gbook-auth-features,
.gbook-auth-features {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

html:not([data-theme="dark"]) .gbook-auth-features {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.gbook-auth-feat-item {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.4;
}

html[data-theme="dark"] .gbook-auth-feat-item,
.gbook-auth-feat-item {
  color: #cbd5e1;
}

html:not([data-theme="dark"]) .gbook-auth-feat-item {
  color: #334155;
}

.gbook-auth-feat-item i {
  color: #0084ff;
  font-size: 14px;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}

/* Actions */
.gbook-auth-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gbook-auth-btn-login {
  background: linear-gradient(135deg, #0084ff 0%, #0066cc 100%);
  color: #ffffff !important;
  text-decoration: none !important;
  padding: 13px 16px;
  border-radius: 12px;
  font-size: 15.5px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  box-shadow: 0 8px 22px rgba(0, 132, 255, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.gbook-auth-btn-login:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(0, 132, 255, 0.45);
  color: #ffffff !important;
}

.gbook-auth-btn-register {
  text-decoration: none !important;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.15s ease;
}

html[data-theme="dark"] .gbook-auth-btn-register,
.gbook-auth-btn-register {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1 !important;
}

html[data-theme="dark"] .gbook-auth-btn-register:hover,
.gbook-auth-btn-register:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff !important;
}

html:not([data-theme="dark"]) .gbook-auth-btn-register {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #1e293b !important;
}

html:not([data-theme="dark"]) .gbook-auth-btn-register:hover {
  background: #e2e8f0;
  color: #0f172a !important;
}

/* Mobile optimizations */
@media (max-width: 540px) {
  .gbook-auth-dialog {
    max-width: calc(100vw - 28px);
    padding: 26px 18px 22px;
    border-radius: 18px;
  }
  .gbook-auth-title {
    font-size: 19px;
  }
  .gbook-auth-desc {
    font-size: 13.5px;
  }
}
