/* ===================================================================
   Canadong — HongKonger in Canada Forum
   Brand overrides layered on top of the base forum theme (style.css)
   =================================================================== */

:root {
  --canadong-red: #d52b1e;
  --canadong-red-dark: #b21f15;
  --canadong-ink: #394047;
  --canadong-soft: #fff4f2;
}

/* ---- Brand logo lockup ---- */
.header__logo img,
.footer__logo img,
.signup__logo a img {
  max-width: 30px;
}
.footer__logo img {
  max-width: var(--logo-max-width, 120px);
}
.header__logo-btn,
.footer__logo > div,
.signup__logo a {
  letter-spacing: -0.2px;
}
.header__logo-btn b,
.footer__logo b,
.signup__logo b {
  font-weight: 800;
  color: var(--canadong-red);
}

/* Logo-only header (brand name text removed): give the mark a bit more
   presence and stop it floating in the old name-sized column. */
.header__logo--image-only img { max-width: var(--logo-max-width, 120px); }
@media only screen and (min-width: 1040px) {
  .header__logo--image-only { width: auto; padding-right: 24px; }
}

/* ---- Welcome hero (home page intro strip) ---- */
.welcome {
  background: linear-gradient(120deg, #ffffff 0%, var(--canadong-soft) 100%);
  border: 1px solid #f0e2df;
  border-left: 4px solid var(--canadong-red);
  border-radius: 6px;
  padding: 22px 26px;
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.welcome__text h2 {
  font-size: 22px;
  font-weight: 800;
  margin: 0 0 6px;
  color: var(--canadong-ink);
}
.welcome__text h2 span {
  color: var(--canadong-red);
}
.welcome__text p {
  margin: 0;
  font-size: 14px;
  color: #6c7378;
  max-width: 640px;
  line-height: 1.5;
}
.welcome__cta {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}
.welcome__cta .btn {
  white-space: nowrap;
}
@media only screen and (max-width: 600px) {
  .welcome {
    padding: 18px;
  }
  .welcome__text h2 {
    font-size: 19px;
  }
}

/* ---- Pinned / welcome post accent ---- */
.posts__item.bg-fef2e0 {
  background-color: var(--canadong-soft);
  box-shadow: inset 3px 0 0 var(--canadong-red);
}

/* ---- Footer copyright ---- */
.footer__copyright span {
  white-space: nowrap;
}
.footer__version {
  margin-left: 6px;
  padding: 1px 8px;
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.06);
  color: #8e9091;
  font-size: 11px;
  font-weight: 700;
}

/* ===================================================================
   Dynamic forum components
   =================================================================== */

/* ---- Header: signed-out auth buttons ---- */
.header__auth {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-left: auto;
}
.header__auth-link {
  font-weight: 700;
  font-size: 14px;
  color: #394047;
  white-space: nowrap;
}
.header__auth-link:hover { color: var(--canadong-red); }
.header__auth-btn { padding: 8px 18px; white-space: nowrap; }
@media only screen and (max-width: 1023px) {
  /* Keep the auth area (incl. Sign In) visible on mobile — explicit so no
     inherited rule can hide it. */
  .header__auth { margin-left: 0; gap: 10px; display: flex; align-items: center; }
  .header__auth-link { display: inline-block; }
}
/* Keep both Sign In + Join usable on small screens. */
@media only screen and (max-width: 480px) {
  .header__auth { gap: 8px; }
  .header__auth-link { font-size: 13px; }
  .header__auth-btn { padding: 7px 12px; font-size: 13px; }
}

/* logout button styled like a dropdown link */
.dropdown__link-btn,
.dropdown__logout button {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-align: left;
  width: 100%;
}
.dropdown__logout { display: inline; }
.dropdown__logout button { width: auto; }

/* ---- Flash messages ---- */
.flash {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 18px;
  border-radius: 6px;
  margin: 18px 0 0;
  font-size: 14px;
  font-weight: 600;
}
.flash--success { background: #e6f7f0; color: #1b7a55; border: 1px solid #b9e7d5; }
.flash--error { background: var(--canadong-soft); color: var(--canadong-red-dark); border: 1px solid #f3cfca; }
.flash__close {
  background: none; border: 0; font-size: 20px; line-height: 1;
  cursor: pointer; color: inherit; opacity: .6;
}
.flash__close:hover { opacity: 1; }

/* ---- Listing head (category / search) ---- */
.listing-head { margin: 22px 0 4px; }
.listing-head__title {
  font-size: 22px; font-weight: 800; color: var(--canadong-ink); margin: 0 0 4px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.listing-head__title .category i { width: 16px; height: 16px; border-radius: 50%; display: inline-block; }
.listing-head__title span { color: #97a0a6; font-weight: 700; }
.listing-head__title .tags { display: inline-flex; }
.listing-head p { color: #6c7378; font-size: 14px; margin: 0; }

/* ---- Empty state ---- */
.empty {
  text-align: center; padding: 54px 20px; color: #8a9197;
}
.empty i { font-size: 34px; display: block; margin-bottom: 12px; opacity: .5; }
.empty p { font-size: 16px; margin-bottom: 16px; }

/* ---- Pagination ---- */
.pagination {
  display: flex; align-items: center; justify-content: center;
  gap: 16px; margin: 24px 0 10px;
}
.pagination__info { font-size: 13px; color: #8a9197; font-weight: 700; }

/* ---- Form error box ---- */
.form-errors {
  background: var(--canadong-soft);
  border: 1px solid #f3cfca;
  border-radius: 6px;
  padding: 12px 16px 12px 32px;
  margin-bottom: 18px;
}
.form-errors ul { margin: 0; padding-left: 0; list-style: none; }
.form-errors li { color: var(--canadong-red-dark); font-size: 13.5px; font-weight: 600; position: relative; padding-left: 16px; }
.form-errors li:before { content: '!'; position: absolute; left: 0; font-weight: 800; }
.form-errors li + li { margin-top: 4px; }

/* ---- Vote widget state ---- */
.vote--up.is-active a i { color: #3cb878; }
.vote--down.is-active a i { color: var(--canadong-red); }
.vote a { cursor: pointer; }

/* ---- Bookmark active ---- */
.js-bookmark.is-active i,
.topic__footer-share .js-bookmark.is-active i { color: var(--canadong-red); }

/* ---- Reply box ---- */
.reply { margin: 6px 0 4px; }
.reply-form {
  background: #fff; border: 1px solid #f3f4f5;
  padding: 18px 22px; margin: 0;
}
.reply-form__head {
  display: flex; align-items: center; gap: 10px; margin-bottom: 12px;
  font-size: 13px; color: #6c7378;
}
.reply-form__head .avatar { width: 30px; height: 30px; }
.reply-form__head .avatar img { width: 30px; height: 30px; }
.reply-form textarea { resize: vertical; min-height: 90px; margin-bottom: 12px; }
.reply-form__actions { display: flex; justify-content: flex-end; }
.reply-signin {
  background: #fff; border: 1px solid #f3f4f5;
  padding: 22px; margin: 0 0 16px; text-align: center;
}
.reply-signin p { font-weight: 700; color: var(--canadong-ink); margin-bottom: 12px; }
.reply-signin .btn { margin: 0 4px; }

/* ---- Create thread tweaks ---- */
.create__guidelines span { cursor: pointer; }
.create__btn-create { border: 0; cursor: pointer; }
.create__textarea-head .js-md-btn { cursor: pointer; }
.create__textarea-head .js-md-btn:hover { color: var(--canadong-red); }
.create__textarea-head .js-img-btn { cursor: pointer; }
.create__textarea-head .js-img-btn:hover { color: var(--canadong-red); }
.js-img-btn.is-loading { opacity: .5; pointer-events: none; }
.create__preview {
  border: 1px solid #e3e7ea;
  border-top: 0;
  border-radius: 0 0 6px 6px;
  padding: 16px 18px;
  min-height: 120px;
  background: #fff;
}
.create__preview p { margin: 0 0 10px; }
.create__preview h4, .create__preview h5, .create__preview h6 { margin: 4px 0 8px; color: var(--canadong-ink); font-weight: 800; }
.create__preview blockquote { margin: 0 0 10px; padding: 6px 14px; border-left: 3px solid #e3e7ea; color: #6c7378; }
.create__preview ul { margin: 0 0 10px; padding-left: 20px; }
.create__preview code { background: #f2f4f6; padding: 1px 5px; border-radius: 4px; font-size: 13px; }
.create__preview-empty { color: #aab0b5; }

/* ---- WYSIWYG editor (admin page editor) ---- */
/* overflow must stay visible so the emoji panel can drop below the composer
   without being clipped; the corner rounding lives on the children instead. */
.wz { border: 1px solid #d8dde1; border-radius: 8px; background: #fff; }
.wz__toolbar { display: flex; align-items: center; gap: 2px; padding: 6px 8px; background: #f7f9fa; border-bottom: 1px solid #e3e7ea; flex-wrap: wrap; border-radius: 7px 7px 0 0; }
.wz__btn { border: 0; background: transparent; cursor: pointer; width: 30px; height: 28px; border-radius: 5px; color: var(--canadong-ink); font-size: 14px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; }
.wz__btn:hover { background: #e7edf0; color: var(--canadong-red); }
.wz__btn .wz__ico { width: 19px; height: 19px; display: block; }
.wz__sep { width: 1px; height: 18px; background: #dde2e5; margin: 0 4px; }
.wz__editor { min-height: 220px; max-height: 60vh; overflow-y: auto; padding: 16px 18px; font-size: 15px; line-height: 1.65; color: var(--canadong-ink); outline: none; border-radius: 0 0 7px 7px; }
.wz__editor:focus { box-shadow: inset 0 0 0 2px rgba(213,43,30,.12); }
.wz__editor:empty::before { content: attr(data-placeholder); color: #aab0b5; }
.wz__editor h2, .wz__editor h3 { color: var(--canadong-ink); font-weight: 800; margin: 12px 0 8px; }
.wz__editor h2 { font-size: 20px; } .wz__editor h3 { font-size: 17px; }
.wz__editor p { margin: 0 0 10px; }
/* Lists — the global reset (style.css) strips list markers site-wide, so we
   restore them explicitly in the editor AND in rendered post/reply bodies.
   Without this, a bullet/numbered list just indents with no visible marker
   and looks broken. */
.wz__editor ul, .topic__text ul { list-style: disc;    margin: 0 0 10px; padding-left: 24px; }
.wz__editor ol, .topic__text ol { list-style: decimal; margin: 0 0 10px; padding-left: 26px; }
.wz__editor li, .topic__text li { margin: 2px 0; }
.wz__editor blockquote { margin: 0 0 10px; padding: 4px 14px; border-left: 3px solid #e3e7ea; color: #6c7378; }
.wz__editor img { max-width: 100%; height: auto; border-radius: 8px; margin: 6px 0; }
.wz__editor a { color: var(--canadong-red); }

/* Section headings on rendered pages (markdown maps to h4–h6) */
.legal h4, .legal h5, .legal h6 { color: var(--canadong-ink); font-weight: 800; margin: 22px 0 10px; }
.legal h4 { font-size: 20px; } .legal h5 { font-size: 18px; } .legal h6 { font-size: 16px; }
.legal img { max-width: 100%; height: auto; border-radius: 8px; margin: 8px 0; }

/* Responsive video embeds (YouTube / Vimeo) in pages and posts */
.video-embed { position: relative; padding-bottom: 56.25%; height: 0; margin: 14px 0; border-radius: 10px; overflow: hidden; background: #000; }
.video-embed iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; }

/* Markdown rendering inside posts */
.topic__text blockquote { margin: 0 0 12px; padding: 6px 14px; border-left: 3px solid #e3e7ea; color: #6c7378; }
.topic__text h4, .topic__text h5, .topic__text h6 { margin: 6px 0 8px; color: var(--canadong-ink); font-weight: 800; }
.topic__text ul { margin: 0 0 12px; padding-left: 20px; }
.topic__text code { background: #f2f4f6; padding: 1px 5px; border-radius: 4px; font-size: 13px; }
.topic__text img, .create__preview img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 6px 0;
  display: block;
}

/* Reply form image button */
.reply-form__actions { display: flex; align-items: center; gap: 10px; }
.reply-form__img { cursor: pointer; }
.reply-form__img i { margin-right: 6px; }

/* ---- Emoji avatar picker ---- */
.emoji-pick { border: 1px solid #e3e7ea; border-radius: 10px; overflow: hidden; background: #fff; }
.emoji-pick__preview { display: flex; justify-content: center; padding: 12px; background: #f7f9fa; border-bottom: 1px solid #e3e7ea; }
.emoji-pick__preview img { width: 56px; height: 56px; border-radius: 50%; }
.emoji-pick__tabs { display: flex; gap: 2px; padding: 6px; background: #f7f9fa; border-bottom: 1px solid #e3e7ea; }
.emoji-pick__tab { flex: 1; border: 0; background: transparent; padding: 6px 4px; border-radius: 6px; cursor: pointer; font-size: 18px; line-height: 1; }
.emoji-pick__tab:hover { background: #e7edf0; }
.emoji-pick__tab.is-active { background: var(--canadong-soft); outline: 2px solid var(--canadong-red); }
.emoji-pick__grid { display: none; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 4px; padding: 10px; max-height: 240px; overflow-y: auto; }
.emoji-pick__grid.is-active { display: grid; }
.emoji-pick__item { cursor: pointer; margin: 0; }
.emoji-pick__item input { position: absolute; opacity: 0; width: 0; height: 0; }
.emoji-pick__item span { display: flex; align-items: center; justify-content: center; height: 40px; font-size: 24px; border-radius: 8px; }
.emoji-pick__item:hover span { background: #eef2f4; }
.emoji-pick__item input:checked + span { background: var(--canadong-soft); outline: 2px solid var(--canadong-red); }

/* ---- Toast ---- */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(8px);
  background: var(--canadong-ink); color: #fff; padding: 10px 20px; border-radius: 24px;
  font-weight: 700; font-size: 14px; z-index: 9999; box-shadow: 0 8px 30px rgba(0,0,0,.22);
  opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none;
}
.toast.is-on { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---- Maintenance ---- */
.maintenance {
  max-width: 560px;
  margin: 8vh auto;
  padding: 40px 28px;
  text-align: center;
  background: #fff;
  border: 1px solid #e9ecee;
  border-radius: 12px;
}
.maintenance__logo { height: 64px; width: auto; margin-bottom: 18px; }
.maintenance__title { color: var(--canadong-ink); font-weight: 800; margin: 0 0 12px; }
.maintenance__msg { color: #5d666c; font-size: 16px; line-height: 1.6; margin: 0 0 22px; white-space: pre-line; }
.maintenance__admin { color: var(--canadong-red); font-weight: 700; font-size: 14px; }

/* Admin maintenance toggle */
.settings-section { margin-top: 34px; border-top: 1px solid #e9ecee; padding-top: 22px; }
.maint-badge { font-weight: 800; font-size: 13px; }
.maint-badge--on  { color: var(--canadong-red); }
.maint-badge--off { color: #1a9b56; }
.maint-toggle { display: flex; align-items: center; gap: 8px; margin: 10px 0 6px; font-weight: 700; cursor: pointer; }
.maint-toggle input { width: 16px; height: 16px; }

/* ---- Profile ---- */
.profile { margin: 22px 0; }
.profile__card {
  background: #fff; border: 1px solid #e9ecee; border-radius: 10px;
  padding: 22px 26px; display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
}
.profile__avatar { width: 72px; height: 72px; flex-shrink: 0; }
.profile__avatar img { width: 72px; height: 72px; }
.profile__meta { flex: 1; min-width: 200px; }
.profile__name {
  font-size: 22px; font-weight: 800; color: var(--canadong-ink); margin: 0 0 4px;
  display: flex; align-items: center; gap: 10px;
}
.profile__role {
  font-size: 11px; text-transform: uppercase; letter-spacing: .04em;
  color: #fff; padding: 3px 9px; border-radius: 20px; font-weight: 700;
}
.profile__handle { color: #97a0a6; font-size: 13px; margin: 0 0 6px; }
.profile__bio { color: #6c7378; font-size: 14px; margin: 0; }
.profile__stats { display: flex; gap: 26px; }
.profile__stats div {
  text-align: center; font-size: 12px; color: #97a0a6; text-transform: uppercase; letter-spacing: .03em;
}
.profile__stats span {
  display: block; font-size: 22px; font-weight: 800; color: var(--canadong-ink);
  letter-spacing: 0; text-transform: none;
}
@media only screen and (max-width: 600px) {
  .profile__stats { width: 100%; justify-content: space-between; gap: 0; }
}

/* ---- Sign-up hint + button-as-submit ---- */
.signup__hint { margin-top: 16px; font-size: 12.5px; color: #97a0a6; text-align: center; }
.signup__btn-create { border: 0; cursor: pointer; width: 100%; }

/* ---- Error page ---- */
.errorpage { text-align: center; padding: 70px 20px; }
.errorpage img { width: 56px; opacity: .85; margin-bottom: 18px; }
.errorpage h2 { font-size: 26px; font-weight: 800; color: var(--canadong-ink); margin-bottom: 8px; }
.errorpage p { color: #6c7378; margin-bottom: 22px; }

/* ---- Legal pages (privacy / terms) ---- */
.legal {
  max-width: 780px;
  margin: 30px auto 48px;
  background: #fff;
  border: 1px solid #e9ecee;
  border-radius: 10px;
  padding: 38px 44px;
}
.legal h1 {
  font-size: 30px;
  font-weight: 800;
  color: var(--canadong-ink);
  margin: 0 0 6px;
}
.legal__updated { color: #97a0a6; font-size: 13px; margin: 0 0 22px; }
.legal h2 {
  font-size: 18px;
  font-weight: 800;
  color: var(--canadong-ink);
  margin: 26px 0 8px;
}
.legal p, .legal li { color: #4f565b; font-size: 15px; line-height: 1.75; }
.legal p { margin: 0 0 12px; }
.legal ul { margin: 0 0 12px; padding-left: 20px; }
.legal li { margin-bottom: 4px; }
.legal a { color: var(--canadong-red); font-weight: 600; }
.legal a:hover { text-decoration: underline; }
.legal strong { color: var(--canadong-ink); }
.legal__note {
  margin-top: 28px; padding-top: 18px; border-top: 1px solid #eef1f3;
  font-weight: 700;
}
@media only screen and (max-width: 600px) {
  .legal { padding: 24px 20px; }
  .legal h1 { font-size: 24px; }
}

/* ---- Emoji reactions ---- */
.reactions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0 2px;
}
.reactions__list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.reaction {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid #e3e7ea;
  background: #f4f6f8;
  border-radius: 14px;
  padding: 2px 10px;
  font-size: 14px;
  line-height: 1.7;
  cursor: pointer;
  transition: background .12s, border-color .12s;
}
.reaction:hover { border-color: #cdd4da; }
.reaction.is-mine { background: var(--canadong-soft); border-color: #f1c8c2; }
.reaction__emoji { font-size: 15px; }
.reaction__count { font-weight: 700; font-size: 12px; color: #6c7378; }
.reaction.is-mine .reaction__count { color: var(--canadong-red-dark); }

.reaction-add { position: relative; display: inline-flex; }
.reaction-add__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 26px;
  border: 1px solid #e3e7ea;
  background: #fff;
  border-radius: 14px;
  color: #9aa1a7;
  font-size: 14px;
  cursor: pointer;
  transition: color .12s, border-color .12s;
}
.reaction-add__btn:hover { color: var(--canadong-red); border-color: #cdd4da; }
.reaction-picker {
  position: absolute;
  bottom: 34px;
  left: 0;
  z-index: 30;
  display: none;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
  padding: 6px;
  background: #fff;
  border: 1px solid #e3e7ea;
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(20, 28, 36, .14);
}
.reaction-add.is-open .reaction-picker { display: grid; }
.reaction-pick {
  border: 0;
  background: none;
  font-size: 22px;
  line-height: 1;
  padding: 7px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .1s, transform .1s;
}
.reaction-pick:hover { background: #f0f2f4; transform: scale(1.15); }

/* ---- Add to Home Screen (mobile only) ---- */
.is-mobile-only { display: none; }
@media only screen and (max-width: 1039px) {
  .is-mobile-only { display: block; }
}
body.is-installed .is-mobile-only { display: none !important; }

.dropdown__install a {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
  color: var(--canadong-red);
}
.dropdown__install a i { font-size: 15px; }

.install-sheet {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.install-sheet__backdrop { position: absolute; inset: 0; background: rgba(20, 28, 36, .5); }
.install-sheet__card {
  position: relative;
  width: 100%;
  max-width: 430px;
  background: #fff;
  border-radius: 16px 16px 0 0;
  padding: 22px 22px 24px;
  box-shadow: 0 -12px 40px rgba(0, 0, 0, .22);
  animation: install-up .25s ease;
}
@media only screen and (min-width: 560px) {
  .install-sheet { align-items: center; }
  .install-sheet__card { border-radius: 16px; }
}
@keyframes install-up { from { transform: translateY(50px); opacity: .5; } to { transform: none; opacity: 1; } }
.install-sheet__head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.install-sheet__head img { width: 42px; height: 42px; border-radius: 10px; }
.install-sheet__head h3 { margin: 0; font-size: 18px; font-weight: 800; color: var(--canadong-ink); }
.install-sheet__body { color: #4f565b; font-size: 15px; line-height: 1.65; margin-bottom: 18px; }
.install-sheet__body ol { margin: 0; padding-left: 20px; }
.install-sheet__body li { margin-bottom: 8px; }
.install-sheet__body b { color: var(--canadong-ink); }
.install-sheet__body svg { vertical-align: -5px; color: var(--canadong-red); }
.install-sheet .btn { width: 100%; border: 0; cursor: pointer; }

/* Auto-appearing install bar (mobile). Slim, non-blocking, dismissible. */
.a2hs-bar {
  position: fixed; left: 12px; right: 12px; z-index: 900;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));  /* clear the iPhone home indicator */
  display: flex; align-items: center; gap: 12px;
  background: #fff; border: 1px solid #ece4e2; border-left: 4px solid var(--canadong-red);
  border-radius: 12px; padding: 10px 12px;
  box-shadow: 0 12px 34px rgba(20, 28, 36, .18);
  transform: translateY(160%); transition: transform .28s ease;
}
.a2hs-bar.is-open { transform: translateY(0); }
.a2hs-bar__icon { width: 40px; height: 40px; border-radius: 9px; flex: none; }
/* Single line + ellipsis so a long title can never balloon the bar's height. */
.a2hs-bar__text { flex: 1; min-width: 0; font-size: 14px; font-weight: 700; color: var(--canadong-ink); line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.a2hs-bar__action {
  flex: none; border: 0; cursor: pointer; border-radius: 8px;
  background: var(--canadong-red); color: #fff; font-weight: 800; font-size: 14px; padding: 9px 16px;
}
.a2hs-bar__action:hover { background: var(--canadong-red-dark); }
.a2hs-bar__close {
  flex: none; border: 0; background: none; cursor: pointer;
  color: #9aa0a6; font-size: 22px; line-height: 1; padding: 0 4px;
}
.a2hs-bar__close:hover { color: var(--canadong-ink); }
body.is-installed .a2hs-bar { display: none; }
/* Mobile-only, matching the header's .is-mobile-only breakpoint. */
@media only screen and (min-width: 1040px) { .a2hs-bar { display: none; } }

/* =========================================================
   Admin panel
   ========================================================= */
.dropdown__admin { color: var(--canadong-red) !important; display: flex; align-items: center; gap: 7px; }
.dropdown__admin i { font-size: 13px; }

.admin { display: flex; gap: 22px; align-items: flex-start; margin: 24px 0 44px; }
.admin__nav {
  flex: 0 0 200px; position: sticky; top: 16px;
  display: flex; flex-direction: column; gap: 2px;
  background: #fff; border: 1px solid #e9ecee; border-radius: 10px; padding: 10px;
}
.admin__nav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  border-radius: 7px; color: #4f565b; font-weight: 700; font-size: 14px;
}
.admin__nav a i { font-size: 15px; width: 16px; text-align: center; }
.admin__nav a:hover { background: #f4f6f8; }
.admin__nav a.active { background: var(--canadong-soft); color: var(--canadong-red); }
.admin__nav-exit { margin-top: 8px; padding-top: 14px; border-top: 1px solid #eef1f3; color: #97a0a6 !important; }
.admin__content { flex: 1; min-width: 0; }
@media only screen and (max-width: 800px) {
  .admin { flex-direction: column; }
  .admin__nav { flex-direction: row; flex-wrap: wrap; position: static; width: 100%; }
}

.admin__title { font-size: 24px; font-weight: 800; color: var(--canadong-ink); margin: 0 0 4px; }
.admin__count { font-size: 14px; color: #97a0a6; font-weight: 700; }
.admin__sub { color: #97a0a6; font-size: 13px; margin: 0 0 10px; }
.admin__subtitle { font-size: 17px; font-weight: 800; color: var(--canadong-ink); margin: 28px 0 12px; }
.admin__head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }

.admin__cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 12px; margin: 18px 0 28px; }
.admin-card {
  background: #fff; border: 1px solid #e9ecee; border-radius: 10px; padding: 16px;
  font-size: 11px; color: #8a9197; text-transform: uppercase; letter-spacing: .03em; font-weight: 700;
}
.admin-card__n { display: block; font-size: 26px; font-weight: 800; color: var(--canadong-ink); letter-spacing: 0; text-transform: none; margin-bottom: 2px; }
.admin-card--accent .admin-card__n { color: #3cb878; }
.admin-card--warn { background: var(--canadong-soft); }
.admin-card--warn .admin-card__n { color: var(--canadong-red); }

.admin__row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media only screen and (max-width: 900px) { .admin__row { grid-template-columns: 1fr; } }
.admin__panel { background: #fff; border: 1px solid #e9ecee; border-radius: 10px; overflow: hidden; }
.admin__panel-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid #eef1f3; }
.admin__panel-head h2 { font-size: 15px; font-weight: 800; color: var(--canadong-ink); margin: 0; }
.admin__panel-head a { font-size: 12px; font-weight: 700; color: var(--canadong-red); }
.admin__panel .admin-table thead { display: none; }

.admin-search { display: flex; gap: 8px; }
.admin-search .form-control { width: 240px; max-width: 58vw; }
.admin-search .btn { white-space: nowrap; }

.admin-table-wrap { overflow-x: auto; border: 1px solid #e9ecee; border-radius: 10px; background: #fff; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.admin-table th { text-align: left; padding: 11px 14px; background: #f8f9fa; color: #8a9197; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid #eef1f3; white-space: nowrap; }
.admin-table td { padding: 10px 14px; border-bottom: 1px solid #f1f3f5; vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table__muted { color: #8a9197; }
.admin-table__title { font-weight: 700; color: var(--canadong-ink); }
.admin-table__user { display: flex; align-items: center; gap: 9px; }
.admin-table__user small { display: block; color: #aab0b5; font-weight: 400; }
.admin-avatar, .admin-avatar img { width: 28px; height: 28px; border-radius: 50%; }
.admin-table__actions { display: flex; gap: 6px; white-space: nowrap; }
.admin-table__snippet { color: #5b6166; max-width: 340px; }
.admin-table__empty { text-align: center; color: #97a0a6; padding: 28px; }
.admin-table tr.is-banned { background: #fff6f5; }
.admin-table tr.is-hidden-row { background: #f6f7f8; opacity: .62; }
.admin-table tr.is-hidden-row:hover { opacity: 1; }
.admin-table tr.is-deleted-row { background: #fdf3f2; opacity: .7; }
.admin-table tr.is-deleted-row:hover { opacity: 1; }
.admin-table tr.is-deleted-row .admin-table__title { text-decoration: line-through; }
.admin-flag { font-style: normal; margin-right: 3px; }
/* Message status badges (admin topic/reply tables) */
.mstat { display: inline-block; font-size: 11px; font-weight: 700; line-height: 1.6; padding: 1px 9px; border-radius: 999px; white-space: nowrap; }
.mstat--live { background: #e6f7ee; color: #1f9d57; }
.mstat--hid  { background: #fff2df; color: #b7791f; }
.mstat--del  { background: #fdecea; color: #d52b1e; }
.mstat--ban  { background: #eceff1; color: #5d666c; }
.admin-table .category i { width: 11px; height: 11px; border-radius: 50%; display: inline-block; margin-right: 6px; vertical-align: 0; }

.role-badge { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 20px; text-transform: uppercase; letter-spacing: .03em; }
.role-admin { background: #fde8e6; color: #b21f15; }
.role-moderator { background: #e7eefc; color: #2f4fd1; }
.role-member { background: #eef1f3; color: #6c7378; }

.admin-inline { display: inline; margin: 0; }
.admin-btn { border: 1px solid #dfe3e7; background: #fff; color: #4f565b; font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: 6px; cursor: pointer; }
.admin-btn:hover { border-color: #c2c9cf; }
.admin-btn:disabled { opacity: .4; cursor: not-allowed; }
.admin-btn--ok { color: #1b7a55; border-color: #bce3d2; }
.admin-btn--warn { color: #b26a00; border-color: #f0d9b0; }
.admin-btn--danger { color: #b21f15; border-color: #f1c8c2; }
.admin-select { min-width: 124px; }
.admin-select select { font-size: 12px; padding: 5px 22px 5px 9px; }

.cat-admin { background: #fff; border: 1px solid #e9ecee; border-radius: 10px; overflow: hidden; }
.cat-admin__head { display: none; }
.cat-row { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid #f1f3f5; flex-wrap: wrap; }
.cat-row:last-child { border-bottom: 0; }
.cat-edit { display: flex; align-items: center; gap: 8px; flex: 1; flex-wrap: wrap; margin: 0; }
.cat-edit .form-control { height: 34px; font-size: 13px; }
.cat-edit__color { display: flex; align-items: center; gap: 6px; }
.cat-edit__color .form-control { width: 84px; }
.cat-edit input[name="name_en"], .cat-edit input[name="name_zh"] { width: 116px; }
.cat-edit input[name="description"] { flex: 1; min-width: 140px; }
.cat-swatch { width: 18px; height: 18px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.cat-edit__meta { font-size: 11px; color: #97a0a6; white-space: nowrap; }
.cat-del { margin: 0; }
.menu-pos { width: 64px; flex: 0 0 64px; }
.menu-url { flex: 1; min-width: 160px; }

/* ---- Ad slot (public) ---- */
.adv {
  position: relative;
  margin: 0 0 18px;
  background: #f8f9fa;
  border: 1px solid #eef1f3;
  border-radius: 8px;
  padding: 10px;
  text-align: center;
  overflow: hidden;
}
.adv__label {
  position: absolute; top: 6px; left: 8px; z-index: 2;
  font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: #aab0b5; background: rgba(255, 255, 255, .85); border-radius: 3px; padding: 1px 5px;
}
.adv__img { display: block; }
.adv__img img { max-width: 100%; height: auto; border-radius: 4px; display: block; margin: 0 auto; }
.adv__code { min-height: 50px; }

/* ---- Admin ad cards ---- */
.ad-card { background: #fff; border: 1px solid #e9ecee; border-radius: 10px; padding: 16px 18px; margin-bottom: 14px; }
.ad-card.is-paused { opacity: .62; }
.ad-card--new { margin-top: 4px; }
.ad-card__row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 12px; }
.ad-card__fields { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.ad-f { display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 700; color: #6c7378; flex: 1; min-width: 140px; }
.ad-f .form-control { height: 36px; }
.ad-f textarea.form-control { height: auto; }
.ad-f--pos { flex: 0 0 70px; min-width: 70px; }
.ad-f--chk { flex: 0 0 auto; min-width: 0; flex-direction: row; align-items: center; gap: 6px; }
.ad-card__fields .ad-f { min-width: 220px; }
.ad-card__foot { display: flex; align-items: center; gap: 12px; }
.ad-card__preview { height: 34px; border-radius: 4px; }
.ad-card__status { font-size: 12px; font-weight: 700; color: #97a0a6; }
.ad-card__actions { display: flex; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid #f1f3f5; }

/* ---- Admin: pages + social ---- */
.page-edit { background: #fff; border: 1px solid #e9ecee; border-radius: 10px; padding: 18px 20px; margin-bottom: 18px; }
.page-edit__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.page-edit__head .admin__subtitle { margin: 0; }
.page-edit__titles { display: flex; gap: 12px; flex-wrap: wrap; margin: 14px 0; }
.page-edit__label { display: block; font-size: 12px; font-weight: 700; color: #6c7378; margin-bottom: 14px; }
.page-edit__label textarea { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; margin-top: 5px; line-height: 1.5; }
.page-edit__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.page-edit__foot .btn { border: 0; cursor: pointer; }
.social-prev { width: 30px; flex: 0 0 30px; text-align: center; font-size: 17px; color: #6c7378; }
.settings-logo { display: flex; gap: 20px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.settings-logo__preview { width: 72px; height: 72px; border: 1px solid #e9ecee; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex: 0 0 72px; background: #fff; }
.settings-logo__preview img { max-width: 52px; max-height: 52px; }
.settings-logo__fields { flex: 1; min-width: 240px; display: flex; flex-direction: column; gap: 12px; }
.settings-tip { margin-top: 16px; }

.admin-newcat { background: #fff; border: 1px solid #e9ecee; border-radius: 10px; padding: 18px; }
.admin-newcat__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 14px; }
.admin-newcat label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 700; color: #6c7378; }
.admin-newcat__desc { grid-column: 1 / -1; }
.admin-newcat .btn { border: 0; cursor: pointer; }

/* =========================================================
   Profile settings (edit profile)
   ========================================================= */
.settings { max-width: 640px; margin: 26px auto 44px; }
.settings__head { margin-bottom: 18px; }
.settings__title { font-size: 26px; font-weight: 800; color: var(--canadong-ink); margin: 0 0 4px; }
.settings__intro { color: #8a9197; font-size: 14px; margin: 0; }
.settings__card {
  background: #fff; border: 1px solid #e9ecee; border-radius: 10px;
  padding: 22px 24px; margin-bottom: 18px;
}
.settings__subtitle { font-size: 17px; font-weight: 800; color: var(--canadong-ink); margin: 0 0 16px; }
.settings__field { margin-bottom: 16px; }
.settings__label { display: block; font-size: 13px; font-weight: 700; color: #5b6166; margin-bottom: 6px; }
.settings__note { display: block; color: #aab0b5; font-size: 12px; margin-top: 5px; }
.settings__actions { display: flex; justify-content: flex-end; }
.settings__actions .btn { border: 0; cursor: pointer; }
.settings .form-control:disabled { background: #f4f6f8; color: #97a0a6; cursor: not-allowed; }

.avatar-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 8px; }
.avatar-pick__item { cursor: pointer; margin: 0; position: relative; }
.avatar-pick__item input { position: absolute; opacity: 0; pointer-events: none; }
.avatar-pick__item img {
  width: 100%; max-width: 48px; border-radius: 50%;
  border: 2px solid transparent; padding: 2px; background: #f4f6f8;
  transition: border-color .12s, transform .12s; display: block; margin: 0 auto;
}
.avatar-pick__item:hover img { transform: scale(1.07); }
.avatar-pick__item input:checked + img { border-color: var(--canadong-red); background: var(--canadong-soft); }

.profile__edit { margin-top: 12px; display: inline-flex; align-items: center; gap: 7px; }
.profile__edit i { font-size: 13px; }

/* ---- Author edit / delete controls (own posts) ---- */
.topic__edited { color: #9aa0a6; font-size: 12px; font-weight: 600; margin-left: 5px; }
.topic__footer-share .topic__owner-del {
  display: inline-flex; align-items: center; margin: 0; padding: 0; border: 0; background: none;
}
.topic__footer-share .topic__owner-delbtn {
  background: none; border: 0; padding: 0; margin: 0; cursor: pointer;
  color: inherit; font: inherit; line-height: 0; display: inline-flex; align-items: center;
}
.topic__footer-share .topic__owner-edit { cursor: pointer; line-height: 0; display: inline-flex; align-items: center; }
.topic__footer-share .topic__owner-edit:hover i,
.topic__footer-share .topic__owner-delbtn:hover i { color: var(--canadong-red); }

/* Inline reply edit form */
.post-edit { margin: 10px 0 4px; }
.post-edit textarea { resize: vertical; min-height: 90px; margin-bottom: 10px; width: 100%; }
.post-edit__actions { display: flex; gap: 10px; justify-content: flex-end; }

/* ============================================================
   Reddit-style thread — Canadong theme
   (flat white cards, #f3f4f5 borders, warm-grey meta, amber/red accents)
   ============================================================ */
/* Topic column fills the container so the post, reply box, comments,
   "Suggested Topics" title and its list all share one width (and line up
   with the nav + suggested-topics card, which are full container width). */
.rthread { max-width: 100%; margin: 0; }

/* ---- Original post (matches the .topic card treatment) ---- */
.rpost {
  background: #fff; border: 1px solid #f3f4f5;
  padding: 22px 26px; margin-bottom: 16px;
}
.rpost__main { min-width: 0; }
.rpost__title { font-size: 22px; line-height: 1.35; font-weight: 700; color: #394047; margin: 8px 0 10px; }
.rpost__body { margin-top: 6px; }

/* ---- Meta line (category · author · time) ---- */
.rpost__meta, .rcomment__meta {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  font-size: 13.5px; color: #8e9091;
}
.rmeta__author { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: #394047; }
.rmeta__author:hover { color: var(--canadong-red); }
.rpost__sub { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: #394047; }
.rpost__sub i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.ravatar { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; }
.ravatar--sm { width: 22px; height: 22px; }
.rdot { color: #cfd3d6; }
.rtime { color: #8e9091; }
.redited { font-style: italic; }
.rop {
  background: var(--canadong-soft); color: var(--canadong-red);
  font-weight: 800; font-size: 10.5px; padding: 1px 6px; border-radius: 3px; letter-spacing: .4px;
}
.rtags { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 10px; }
.rtags a { font-size: 12px; font-weight: 700; color: #fff; padding: 2px 10px; border-radius: 999px; }

/* ---- Votes rendered inline in any action bar (post + comments) ---- */
.ractions .topic__footer-likes { display: flex; flex-direction: row; align-items: center; gap: 5px; margin-right: 6px; }
.ractions .vote { display: inline-flex; align-items: center; }
.ractions .vote a { line-height: 0; cursor: pointer; }
.ractions .vote i { font-size: 17px; color: #b6babd; transition: color .12s; }
.ractions .vote a:hover i { color: var(--canadong-red); }
.ractions .vote--up.is-active a i { color: #3cb878; }
.ractions .vote--down.is-active a i { color: var(--canadong-red); }
.ractions .js-score { font-size: 13.5px; font-weight: 700; color: #394047; margin: 0 4px; }

/* ---- Action bar ---- */
.ractions { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; margin-top: 12px; }
.ractions__btn {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 700; color: #8e9091;
  padding: 6px 10px; border-radius: 4px; cursor: pointer;
  background: none; border: 0; line-height: 1;
}
.ractions__btn i { font-size: 16px; }
.ractions__btn:hover { background: #f6f7f8; color: #394047; }
.ractions__btn.is-active,
.ractions__btn.is-active i { color: var(--canadong-red); }
.ractions__form { margin: 0; display: inline-flex; }
.ractions__stat { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 700; color: #aab0b5; padding: 6px 4px; }
.ractions__stat i { font-size: 15px; }

/* per-context action-bar spacing */
.ractions--sm { gap: 2px; margin-top: 10px; }
.ractions--post { margin-top: 14px; gap: 4px; }

/* ---- Reply composer ---- */
.rreply { margin: 0 0 16px; }
.rlocked {
  display: flex; align-items: center; gap: 8px; color: #8e9091; font-weight: 600;
  background: #fff; border: 1px solid #f3f4f5; padding: 16px 20px;
}
.rlocked i { color: var(--canadong-red); }

/* ---- Comments ---- */
.rcomments__head { font-size: 16px; font-weight: 700; color: #394047; margin: 4px 0 0; }
.rcomments {
  background: #fff; border: 1px solid #f3f4f5;
  padding: 4px 22px; margin-top: 12px;
}
.rcomments__empty { color: #8e9091; padding: 22px 0; }
.rcomment { display: flex; gap: 10px; padding: 16px 0; border-top: 1px solid #f3f4f5; }
.rcomment:first-child { border-top: 0; }
.rcomment__gutter { display: flex; flex-direction: column; align-items: center; flex: 0 0 24px; }
.rcollapse {
  width: 22px; height: 22px; border-radius: 50%;
  border: 0; background: none; cursor: pointer;
  color: #c2c6c9; font-size: 16px; font-weight: 800; line-height: 1; padding: 0;
}
.rcollapse:hover { color: var(--canadong-red); background: #f6f7f8; }
.rline { flex: 1 1 auto; width: 2px; background: #f0f1f2; border-radius: 2px; margin-top: 6px; }
.rcomment:hover .rline { background: #e4e7e9; }
.rcomment__col { flex: 1 1 auto; min-width: 0; }
.rcomment__meta { margin-bottom: 5px; }
.rcomment.is-collapsed .rcomment__main { display: none; }
.rcomment.is-collapsed .rline { display: none; }
.rcomment.is-collapsed .rcomment__meta { opacity: .6; margin-bottom: 0; }

/* ---- Close notice ---- */
.rclose { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #aab0b5; margin: 18px 0 10px; }
.rclose i { font-size: 15px; }

@media (max-width: 600px) {
  .rpost { padding: 16px; gap: 12px; }
  .rpost__title { font-size: 19px; }
  .rcomments { padding: 2px 14px; }
  .rvote .topic__footer-likes { width: 30px; }
}

/* ---- Threaded replies: indent + inline reply box ---- */
.rcomment { margin-left: calc(var(--d, 0) * 22px); }
.rreplybox { margin: 10px 0 6px; }
.rreplybox textarea { width: 100%; resize: vertical; min-height: 72px; margin-bottom: 8px; }
.rreplybox__actions { display: flex; gap: 8px; justify-content: flex-end; }
@media (max-width: 600px) {
  .rcomment { margin-left: calc(var(--d, 0) * 10px); }
}

/* ---- Admin: logo upload control ---- */
.settings-logo__upload { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 4px 0 2px; }
.settings-logo__upload .js-logo-file, .settings-logo__upload input[type="file"] { display: none !important; }
.settings-logo__upload .js-logo-btn { display: inline-flex; align-items: center; gap: 7px; }
.settings-logo__upload .js-logo-btn.is-loading { opacity: .6; pointer-events: none; }
.settings-logo__hint { font-size: 12px; color: #8a9197; }

/* ---- Admin: ad image upload control ---- */
.ad-upload { display: inline-flex; align-items: center; gap: 8px; margin: 2px 0 6px; }
.ad-upload .js-adimg-file, .ad-upload input[type="file"] { display: none !important; }
.ad-upload .js-adimg-btn { display: inline-flex; align-items: center; gap: 6px; }
.ad-upload .js-adimg-btn.is-loading { opacity: .6; pointer-events: none; }

/* ---- Admin: maintenance page editor ---- */
.mnt-edit { margin: 6px 0 8px; }
.mnt-edit .js-mnt-file, .mnt-edit input[type="file"] { display: none !important; }
.mnt-edit .js-mnt-img { display: inline-flex; align-items: center; gap: 6px; }
.mnt-edit .js-mnt-img.is-loading { opacity: .6; pointer-events: none; }
/* Rich maintenance content */
.maintenance__msg img { max-width: 100%; height: auto; border-radius: 8px; margin: 10px auto; display: block; }
.maintenance__msg .video-embed { max-width: 100%; margin: 10px auto; }

/* ---- Admin role star (shown next to admin names) ---- */
.role-star { color: #f4b400; font-size: 13px; line-height: 1; margin-left: 3px; vertical-align: middle; }

/* ---- Admin: site health ---- */
.health-status { display: flex; flex-wrap: wrap; gap: 12px; margin: 8px 0 4px; }
.health-badge {
  display: flex; align-items: center; gap: 10px; flex: 1 1 210px;
  border: 1px solid #e9ecee; border-radius: 10px; padding: 12px 14px; background: #fff;
}
.health-badge strong { font-size: 14px; }
.health-badge small { display: block; color: #8a9197; font-size: 12px; }
.health-dot { width: 10px; height: 10px; border-radius: 50%; background: #9aa0a6; flex: none; }
.health-badge--ok   { border-color: #bfe6cf; } .health-badge--ok   .health-dot { background: #3cb878; }
.health-badge--warn { border-color: #f3d9a6; } .health-badge--warn .health-dot { background: #e6a817; }
.health-badge--err  { border-color: #f3cfca; } .health-badge--err  .health-dot { background: var(--canadong-red); }
.health-def td { padding: 8px 10px; font-size: 13.5px; vertical-align: top; }
.health-def td:first-child { color: #8a9197; white-space: nowrap; width: 42%; }
.health-def td:last-child { font-weight: 600; }
.health-muted { color: #9aa0a6; font-weight: 400; }
.health-online { display: flex; flex-wrap: wrap; gap: 10px; margin: 4px 0 8px; }
.health-online__user {
  display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px 5px 5px;
  border: 1px solid #e9ecee; border-radius: 999px; background: #fff; font-size: 13px; font-weight: 600;
}
.health-online__user img { width: 26px; height: 26px; border-radius: 50%; }
.health-online__user:hover { border-color: var(--canadong-red); }
.health-star { color: #e6a817; font-style: normal; font-size: 12px; }

/* ---- Avatar background colour picker ---- */
.color-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.color-pick__swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.color-pick__swatch {
  width: 30px; height: 30px; border-radius: 50%; border: 2px solid #fff;
  box-shadow: 0 0 0 1px #d6dbe0; cursor: pointer; padding: 0; transition: transform .12s ease;
}
.color-pick__swatch:hover { transform: scale(1.12); }
.color-pick__swatch.is-active { box-shadow: 0 0 0 2px var(--canadong-red); }
.color-pick__custom { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: #6c7378; cursor: pointer; }
.color-pick__custom input[type="color"] {
  width: 42px; height: 30px; padding: 0; border: 1px solid #d6dbe0; border-radius: 6px;
  background: none; cursor: pointer;
}

/* ---- Forgot / reset password ---- */
.signup__hint { text-align: center; font-size: 13px; margin: 10px 0 0; }
.signup__forgot { display: block; text-align: right; font-size: 13px; margin-top: 8px; }

/* ---- Admin: remove-logo button ---- */
.settings-logo__remove { margin-left: 8px; }
.settings-logo__remove:hover { border-color: var(--canadong-red); color: var(--canadong-red); }

/* ---- Province (region) chips ---- */
/* The theme paints every .tags chip white via `.tags a:link` etc.; the
   province chip has a WHITE background, so its colour must outrank those
   link-state rules or the text renders white-on-white (invisible). */
.tags .prov-chip, .prov-chip,
a.prov-chip:link, a.prov-chip:visited, a.prov-chip:active {
  background: #fff; border: 1px solid #e3b7b2; color: var(--canadong-red-dark);
  font-weight: 700;
}
.tags .prov-chip:hover, .prov-chip:hover,
a.prov-chip:hover { background: var(--canadong-soft); color: var(--canadong-red-dark); }
.prov-chip--meta {
  display: inline-flex; align-items: center; border-radius: 20px;
  padding: 1px 10px; font-size: 12px; text-decoration: none;
}
.profile__loc { color: #6c7378; }
/* Province dropdown: roomier grid so long names don't collide */
[data-dropdown-list="province"] { min-width: 400px; }
[data-dropdown-list="province"] .dropdown__catalog li { line-height: 1.3; }
[data-dropdown-list="province"] .category { white-space: normal; }
/* City dropdown: single readable column, scrolls when a province has many cities */
[data-dropdown-list="city"] { min-width: 220px; }
.dropdown__catalog--city { max-height: 320px; overflow-y: auto; margin-bottom: 0; }
.dropdown__catalog--city li { float: none; width: 100%; margin-bottom: 2px; line-height: 1.3; }
.dropdown__catalog--city .category { white-space: nowrap; }
/* Admin tags: inline rename form */
.tag-rename { display: inline-flex; gap: 6px; align-items: center; }
.tag-rename .form-control { width: 160px; padding: 4px 8px; font-size: 13px; }

/* ---- Wide wordmark logo (加拿港 CANADONG) ---- */
.header__logo--image-only img { max-width: var(--logo-max-width, 120px); max-height: 46px; width: auto; height: auto; }
.signup__logo a img { width: auto; max-height: 56px; max-width: 200px; }
.settings-logo__preview img { max-width: 120px; max-height: 64px; width: auto; height: auto; }

.site-announcement {
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 4px;
  padding: 10px 16px;
  margin-bottom: 16px;
  color: #664d03;
}
.site-announcement p { margin: 0; }
/* Field-level hint inside a signup section (left-aligned, tight) */
.signup__section .signup__hint { display: block; text-align: left; margin: 6px 0 0; }

/* ---- Admin bulk actions ---- */
.admin-table__check { width: 34px; text-align: center; }
.admin-table__check input, .cat-row__check { width: 16px; height: 16px; accent-color: var(--canadong-red); cursor: pointer; }
.admin-bulkbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 14px 0; padding: 10px 14px;
  background: #f8f9fa; border: 1px solid #e9ecee; border-radius: 8px;
}
.admin-bulkbar__label { font-size: 13px; font-weight: 700; color: #5c6166; }
.admin-bulkbar .admin-select select { min-width: 170px; }

/* Admin topics: category move dropdown */
.admin-cat-move { display: inline-flex; align-items: center; gap: 6px; }
.admin-cat-move .cat-swatch { flex: 0 0 auto; }
.admin-cat-move select { max-width: 130px; font-size: 13px; }

/* ---- Full emoji picker (composers) ---- */
.emopanel-wrap { position: relative; display: inline-flex; }
.emopanel {
  position: absolute; z-index: 60; top: calc(100% + 6px); left: 0;
  width: 316px; max-width: 86vw; background: #fff;
  border: 1px solid #e3e7ea; border-radius: 10px;
  box-shadow: 0 12px 34px rgba(0,0,0,.14); padding: 8px;
}
.emopanel__tabs { display: flex; gap: 2px; border-bottom: 1px solid #eef1f3; padding-bottom: 6px; margin-bottom: 6px; }
.emopanel__tab {
  border: 0; background: none; font-size: 17px; padding: 3px 6px; border-radius: 6px; cursor: pointer;
  filter: grayscale(1); opacity: .65;
}
.emopanel__tab:hover { background: #f4f6f7; }
.emopanel__tab.is-active { filter: none; opacity: 1; background: var(--canadong-soft); }
/* 204px = exactly 6 rows of 34px cells, so the last visible row is never cut
   in half; a thin scrollbar stays visible as the scroll cue. */
.emopanel__grid { display: none; max-height: 204px; overflow-y: auto; scrollbar-width: thin; }
.emopanel__grid.is-active { display: grid; grid-template-columns: repeat(9, 1fr); }
.emopanel__grid::-webkit-scrollbar { width: 8px; }
.emopanel__grid::-webkit-scrollbar-thumb { background: #cdd4da; border-radius: 4px; }
.emopanel__grid::-webkit-scrollbar-track { background: #f2f4f6; }
.emopanel__item {
  border: 0; background: none; font-size: 19px; height: 34px; line-height: 1; padding: 0; cursor: pointer; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
}
.emopanel__item:hover { background: var(--canadong-soft); transform: scale(1.15); }

/* ---- Rich-text editor in post composers ---- */
.rte { margin-bottom: 12px; }
.rte--compact .wz__editor { min-height: 110px; padding: 12px 14px; }
.rte .wz__editor img { max-width: 100%; height: auto; border-radius: 6px; }
.rte .wz__editor blockquote { border-left: 3px solid var(--canadong-red); margin: 8px 0; padding: 4px 12px; color: #5d666c; background: #fafbfc; }
.rte .emopanel { top: calc(100% + 4px); }
@media only screen and (max-width: 600px) {
  .rte .wz__toolbar { gap: 0; }
  .rte .wz__btn { width: 34px; height: 32px; } /* comfortable touch targets */
}
/* Bootstrap's input[type=file]{display:block} defeats the hidden attribute. */
.wz .js-wz-file[hidden] { display: none !important; }

/* The base form styles set inputs to display:block, which beats the browser's
   [hidden] rule — make hidden always win (stops stray "Choose File" controls
   and keeps toggled panels reliably hidden). */
[hidden] { display: none !important; }

/* ---- Mobile: centre the brand logo in the header and footer ---- */
@media only screen and (max-width: 1039px) {
  .header .container { position: relative; }
  /* Absolute-centre the mark so it stays dead-centre regardless of what's on
     either side (menu button left, auth/user + search right). Low z-index so
     the expanding mobile search overlay still covers it. */
  .header__logo--image-only {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    margin-left: 0;
    z-index: 1;
  }
  /* Cap the centred mark below the admin-set desktop size so it always clears
     the menu button on the left and Sign In / Join on the right. */
  .header__logo--image-only img { max-width: 88px; }
  /* The footer stacks and centres its children on mobile, but the logo's
     desktop margin pushed it off-centre. */
  .footer__logo { margin-right: 0; }
}
/* Very narrow phones: shrink the centred mark and compact the auth buttons so
   they never collide. */
@media only screen and (max-width: 374px) {
  .header__logo--image-only img { max-width: 56px; }
  .header__auth { gap: 6px; }
  .header__auth-link { font-size: 12px; }
  .header__auth-btn { padding: 6px 10px; font-size: 12px; }
}

/* ---- Admin statistics dashboard ---- */
.stats-range { display: inline-flex; gap: 4px; }
.stats-range a { font-size: 12px; font-weight: 700; color: #6c7378; padding: 3px 10px; border-radius: 999px; }
.stats-range a.is-active { background: var(--canadong-red); color: #fff; }
.stats-h3 { margin: 14px 0 6px; font-size: 13px; font-weight: 700; color: #5d666c; }
.stats-note { margin-top: 8px; font-size: 12px; }

.chart { width: 100%; height: auto; display: block; }
.chart__grid { stroke: #eceff1; stroke-width: 1; }
.chart__ylab { fill: #9aa0a6; font-size: 10px; font-family: inherit; }
.chart__xlab { fill: #9aa0a6; font-size: 10px; font-family: inherit; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 14px; margin: 4px 0 6px; }
.chart-legend__item { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: #5d666c; }
.chart-legend__item i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

.statbars { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.statbar { display: grid; grid-template-columns: 130px 1fr 44px; align-items: center; gap: 10px; }
.statbar__label { font-size: 13px; color: #394047; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.statbar__track { background: #eef1f3; border-radius: 999px; height: 10px; overflow: hidden; }
.statbar__fill { display: block; height: 100%; border-radius: 999px; min-width: 3px; }
.statbar__val { font-size: 12px; font-weight: 700; color: #5d666c; text-align: right; }
@media (max-width: 560px) { .statbar { grid-template-columns: 96px 1fr 38px; } }

/* ---- Hot hashtags picker (post composer) ---- */
.hot-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 10px; }
.hot-tags__label { font-size: 12px; font-weight: 700; color: #8a9197; margin-right: 2px; }
.hot-tag {
  border: 1px solid #dfe4e8; background: #fff; color: #4a5560;
  font-size: 12.5px; font-weight: 600; padding: 4px 11px; border-radius: 999px;
  cursor: pointer; transition: background .12s, color .12s, border-color .12s;
}
.hot-tag:hover { border-color: var(--canadong-red); color: var(--canadong-red); }
.hot-tag.is-active { background: var(--canadong-red); border-color: var(--canadong-red); color: #fff; }

/* ---- Category header: "New thread" button ---- */
.listing-head--flex { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.listing-head--flex .listing-head__main { min-width: 0; }
.listing-head__new { white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; }
.listing-head__new i { font-size: 12px; }
@media only screen and (max-width: 600px) {
  .listing-head--flex { align-items: stretch; }
  .listing-head__new { width: 100%; justify-content: center; margin-top: 6px; }
}

/* ---- Mobile floating Reply button (topic view) ---- */
.reply-fab { display: none; }
@media only screen and (max-width: 1023px) {
  .reply-fab {
    display: inline-flex; align-items: center; gap: 7px;
    position: fixed; right: 16px; bottom: 16px; z-index: 40;
    background: var(--canadong-red); color: #fff;
    padding: 12px 18px; border-radius: 999px;
    font-weight: 700; font-size: 14px; text-decoration: none;
    box-shadow: 0 6px 18px rgba(213, 43, 30, 0.42);
  }
  .reply-fab i { font-size: 16px; }
  .reply-fab:hover, .reply-fab:focus { color: #fff; }
}

/* ---- Composer province + city selectors ---- */
.prov-city { display: flex; gap: 10px; }
.prov-city .custom-select { flex: 1 1 0; min-width: 0; }
@media only screen and (max-width: 600px) { .prov-city { flex-direction: column; } }

/* ---- Notifications: header bell + badge, dropdown, centre page ---- */
.header__notify { position: relative; display: flex; align-items: center; }
.header__notify-btn {
  position: relative; cursor: pointer; color: #6c7378;
  width: 40px; height: 40px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
}
.header__notify-btn:hover { background: #f4f6f7; color: var(--canadong-ink); }
.header__notify-btn i { font-size: 20px; }
.notif-badge {
  position: absolute; top: 1px; right: 1px; min-width: 17px; height: 17px;
  padding: 0 4px; border-radius: 999px; background: var(--canadong-red); color: #fff;
  font-size: 10.5px; font-weight: 800; line-height: 17px; text-align: center;
  box-shadow: 0 0 0 2px #fff;
}
.dropdown--notify {
  left: auto; right: 0; width: 344px; max-width: calc(100vw - 24px);
  padding: 0; overflow: hidden;
}
.notif-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 16px; margin: 0; border-bottom: 1px solid #f0f1f2;
}
.notif-head strong { font-size: 15px; color: var(--canadong-ink); }
.notif-markall { margin: 0; }
.notif-markall button {
  background: none; border: 0; cursor: pointer; padding: 0;
  color: var(--canadong-red); font-size: 12.5px; font-weight: 700;
}
.notif-list { list-style: none; margin: 0; padding: 0; max-height: 60vh; overflow-y: auto; }
.notif-item { margin: 0; border-bottom: 1px solid #f4f5f6; }
.notif-item:last-child { border-bottom: 0; }
.notif-item > a { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; text-decoration: none; }
.notif-item > a:hover { background: #f8f9fa; }
.notif-item.is-unread > a { background: #fff6f5; }
.notif-item.is-unread > a:hover { background: #ffeeec; }
.notif-avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex: 0 0 34px; }
.notif-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.notif-text { font-size: 13.5px; color: #394047; line-height: 1.4; }
.notif-text strong { font-weight: 700; }
.notif-meta { font-size: 12px; color: #8e9091; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-empty { padding: 26px 16px; margin: 0; text-align: center; color: #8e9091; font-size: 13.5px; }
.notif-seeall {
  display: block; text-align: center; padding: 12px; font-size: 13px; font-weight: 700;
  color: var(--canadong-red); border-top: 1px solid #f0f1f2; text-decoration: none;
}
.notif-seeall:hover { background: #f8f9fa; }

/* Full notifications page (matches the card treatment used site-wide) */
.notif-page { background: #fff; border: 1px solid #f3f4f5; margin-top: 8px; }
.notif-page__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px; border-bottom: 1px solid #f0f1f2;
}
.notif-page__head h1 { font-size: 20px; margin: 0; color: var(--canadong-ink); }
.notif-list--page .notif-item > a { padding: 16px 22px; }
.notif-list--page .notif-avatar { width: 40px; height: 40px; flex-basis: 40px; }
.notif-list--page .notif-text { font-size: 14.5px; }
.notif-empty--page { padding: 44px 22px; }

/* ---- Mobile account menu (inside the hamburger; desktop uses .header__user) ---- */
/* Not .is-mobile-only: that is also hidden once the PWA is installed, but the
   account controls must always be reachable on mobile. */
.dropdown__account { display: none; }
@media only screen and (max-width: 1039px) {
  .dropdown__account { display: block; }
}
.dropdown__account h3 { margin: 0 0 8px; font-size: 15px; color: var(--canadong-ink); }
.dropdown__account .dropdown__catalog li { margin-bottom: 2px; }
.dropdown__account .dropdown__catalog li > a,
.dropdown__account .dropdown__link-btn {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 0; font-size: 15px; color: #394047;
}
.dropdown__account .dropdown__catalog li > a i,
.dropdown__account .dropdown__link-btn i {
  font-size: 16px; width: 20px; text-align: center; color: #9aa0a6;
}
.dropdown__account .dropdown__catalog li > a:hover,
.dropdown__account .dropdown__link-btn:hover { color: var(--canadong-red); }
.dropdown__account .dropdown__admin i { color: var(--canadong-red); }
.dropdown__account form { margin: 0; }

/* ---- Categories admin: up/down reorder + colour swatch picker ---- */
.cat-move { display: inline-flex; flex-direction: column; gap: 2px; flex: 0 0 auto; }
.cat-move__f { margin: 0; line-height: 0; }
.cat-move__btn {
  width: 26px; height: 17px; padding: 0; cursor: pointer;
  border: 1px solid #dfe4e8; background: #fff; color: #6c7378;
  font-size: 8px; line-height: 1; border-radius: 4px;
  display: inline-flex; align-items: center; justify-content: center;
}
.cat-move__btn:hover:not(:disabled) { border-color: var(--canadong-red); color: var(--canadong-red); }
.cat-move__btn:disabled { opacity: .35; cursor: default; }

/* Compact variant of the profile colour picker for the tight admin rows. */
.color-pick--sm { gap: 10px; }
.color-pick--sm .color-pick__swatches { gap: 6px; }
.color-pick--sm .color-pick__swatch { width: 22px; height: 22px; border-width: 2px; }
.color-pick--sm .color-pick__custom { font-size: 12px; }
.color-pick--sm .color-pick__custom input[type="color"] { width: 34px; height: 26px; }

.admin-newcat__color { grid-column: 1 / -1; }

/* ==========================================================================
   Admin polish — wider pages, tidy panel spacing, tables that reflow
   ========================================================================== */

/* Admin pages get more room than the default content container, so the
   listing tables and their controls aren't squeezed. (Bootstrap pins .container
   to a fixed width at each breakpoint, so override width too, not just max.) */
.container:has(> .admin) { width: auto; max-width: 1400px; }

/* Consistent vertical rhythm between admin blocks (panels / two-col rows). */
.admin__panel { margin-bottom: 18px; }
.admin__row   { margin-bottom: 18px; }
.admin__row > .admin__panel { margin-bottom: 0; }   /* the row owns the gap */

/* Panel body: inset every non-table child to line up with the header (16px),
   and give the last child breathing room at the bottom. */
.admin__panel > *:not(.admin__panel-head):not(.admin-table):not(.admin-table-wrap) {
  padding-left: 16px; padding-right: 16px; box-sizing: border-box;
}
.admin__panel > *:not(.admin__panel-head):not(.admin-table):not(.admin-table-wrap):last-child {
  padding-bottom: 14px;
}
.statbars { margin-top: 0; padding-top: 12px; padding-bottom: 14px; }

/* When the table is too tight, each row becomes a stacked card and the
   controls drop onto their own full-width row (applies to every admin table). */
@media only screen and (max-width: 1024px) {
  .admin-table-wrap { overflow: visible; border: 0; background: transparent; border-radius: 0; }
  .admin-table { font-size: 13.5px; }
  .admin-table thead { display: none; }
  .admin-table, .admin-table tbody { display: block; }
  .admin-table tr {
    display: block; position: relative;
    background: #fff; border: 1px solid #e9ecee; border-radius: 10px;
    padding: 12px 14px 10px; margin-bottom: 12px;
  }
  .admin-table tr:last-child td { border-bottom: 0; }
  .admin-table td {
    display: flex; align-items: center; gap: 8px;
    border: 0; padding: 3px 0; max-width: none;
  }
  /* label each stacked cell from its column header */
  .admin-table td[data-label]::before {
    content: attr(data-label); flex: 0 0 92px;
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .04em; color: #97a0a6;
  }
  .admin-table__title { white-space: normal; }
  .admin-table__snippet { max-width: none; }
  /* actions: full-width row, left-aligned, separated by a divider */
  .admin-table__actions {
    justify-content: flex-start; margin-top: 8px; padding-top: 10px;
    border-top: 1px solid #f1f3f5;
  }
  .admin-table__check { position: absolute; top: 12px; right: 12px; }
}

/* ============================ Thread poll ============================ */
.poll { border: 1px solid #e3e7ea; border-radius: 12px; padding: 16px 18px; margin: 14px 0 4px; background: #fff; }
.poll__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.poll__badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--canadong-red); text-transform: uppercase; letter-spacing: .04em; }
.poll__flag { font-size: 12px; font-weight: 700; color: #8e9091; }
.poll__q { font-size: 17px; font-weight: 800; color: var(--canadong-ink); margin: 8px 0 12px; line-height: 1.35; }
.poll__form { display: flex; flex-direction: column; gap: 8px; }
.poll__choice { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid #d6dbe0; border-radius: 8px; cursor: pointer; transition: border-color .15s, background .15s; }
.poll__choice:hover { border-color: var(--canadong-red); background: #fff6f5; }
.poll__choice input { accent-color: var(--canadong-red); width: 16px; height: 16px; flex: 0 0 auto; }
.poll__choicelabel { color: var(--canadong-ink); font-weight: 600; }
.poll__actions { display: flex; align-items: center; gap: 14px; margin-top: 4px; }
.poll__results { display: flex; flex-direction: column; gap: 12px; }
.poll__meta { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; color: var(--canadong-ink); margin-bottom: 4px; }
.poll__optlabel { font-weight: 600; }
.poll__row.is-mine .poll__optlabel { color: var(--canadong-red); }
.poll__you { color: var(--canadong-red); font-weight: 800; }
.poll__pct { font-weight: 800; }
.poll__bar { height: 8px; border-radius: 6px; background: #eef1f3; overflow: hidden; }
.poll__bar > span { display: block; height: 100%; background: var(--canadong-red); border-radius: 6px; min-width: 2px; }
.poll__count { font-size: 12px; color: #8e9091; margin-top: 3px; }
.poll__peek { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.poll__peek li { padding: 10px 12px; border: 1px solid #d6dbe0; border-radius: 8px; color: var(--canadong-ink); font-weight: 600; }
.poll__foot { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 12px; font-size: 13px; color: #8e9091; }
.poll__total { font-weight: 700; }
.poll__link { background: none; border: 0; padding: 0; color: var(--canadong-red); font-weight: 700; font-size: 13px; cursor: pointer; }
.poll__link:hover { text-decoration: underline; }
.poll__closeform { display: inline; margin: 0; }

/* ---- Poll composer (new thread) ---- */
.pollc { border: 1px dashed #d6dbe0; border-radius: 10px; padding: 4px; }
.pollc.is-open { border-style: solid; }
.pollc__toggle { display: inline-flex; align-items: center; gap: 8px; background: none; border: 0; color: var(--canadong-red); font-weight: 700; font-size: 14px; padding: 8px 10px; cursor: pointer; }
.pollc__body { display: none; padding: 6px 12px 12px; }
.pollc.is-open .pollc__body { display: block; }
.pollc__opts { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.pollc__opt { display: flex; align-items: center; gap: 8px; }
.pollc__opt .form-control { flex: 1; }
.pollc__rm { flex: 0 0 auto; width: 34px; height: 34px; border: 1px solid #d6dbe0; background: #fff; border-radius: 8px; color: #8e9091; font-size: 18px; line-height: 1; cursor: pointer; }
.pollc__rm:hover { border-color: var(--canadong-red); color: var(--canadong-red); }
.pollc__add { background: none; border: 0; color: var(--canadong-red); font-weight: 700; font-size: 13.5px; padding: 2px 0; cursor: pointer; }
.pollc__hint { font-size: 12.5px; color: #8e9091; margin: 8px 0 0; }

/* ============================ Day/night theme picker ============================ */
.footer__theme { position: relative; margin-left: 18px; }
.footer__theme-btn { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; color: #8e9091; font-weight: 600; font-size: 13px; }
.footer__theme-btn .js-theme-icon { font-size: 15px; line-height: 1; }
.footer__theme-btn i.icon-Arrow_Below { font-size: 10px; }
.theme-opts { list-style: none; margin: 0; padding: 0; }
.theme-opts li { margin: 0; }
.theme-opts .js-theme-opt { display: flex; align-items: center; gap: 8px; width: 100%; background: none; border: 0; text-align: left; padding: 8px 12px; cursor: pointer; color: var(--canadong-ink); font: inherit; font-size: 14px; border-radius: 6px; }
.theme-opts .js-theme-opt:hover { background: #f4f6f7; }
.theme-opts .js-theme-opt.is-active { color: var(--canadong-red); font-weight: 700; }
.theme-opts .js-theme-opt i { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: transparent; flex: 0 0 auto; }
.theme-opts .js-theme-opt.is-active i { background: var(--canadong-red); }

/* Mobile theme picker (inside the header menu dropdown) */
.dropdown__theme { padding: 12px 16px; border-top: 1px solid #eef1f3; }
.dropdown__theme-label { display: block; font-weight: 700; color: var(--canadong-ink); margin-bottom: 8px; }
.dropdown__theme-opts { display: flex; gap: 8px; }
.dropdown__theme-opts .js-theme-opt { flex: 1; padding: 8px 6px; border: 1px solid #d6dbe0; background: #fff; border-radius: 8px; color: var(--canadong-ink); font: inherit; font-size: 13px; cursor: pointer; }
.dropdown__theme-opts .js-theme-opt.is-active { border-color: var(--canadong-red); color: var(--canadong-red); font-weight: 700; }

/* Dark-mode surfaces for the mobile picker buttons + divider */
[data-theme="dark"] .dropdown__theme { border-top-color: var(--d-border); }
[data-theme="dark"] .dropdown__theme-opts .js-theme-opt { background: var(--d-surface-2); border-color: var(--d-border-in); color: var(--d-text); }
[data-theme="dark"] .dropdown__theme-opts .js-theme-opt.is-active { border-color: var(--canadong-red); color: var(--canadong-red); }

/* ============================ Admin → Locations ============================ */
.loc-prov { border: 1px solid #e9ecee; border-radius: 10px; margin-bottom: 10px; background: #fff; overflow: hidden; }
.loc-prov__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; cursor: pointer; font-weight: 700; color: var(--canadong-ink); list-style: none; }
.loc-prov__head::-webkit-details-marker { display: none; }
.loc-prov[open] .loc-prov__head { border-bottom: 1px solid #eef1f3; }
.loc-prov__name small { color: #97a0a6; font-weight: 600; }
.loc-prov__body { padding: 14px 16px; }
.loc-add { margin-bottom: 14px; gap: 8px; }
.loc-add .form-control { max-width: 340px; }
.loc-cities { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px; }
.loc-city { display: flex; align-items: center; gap: 6px; }
.loc-city__rename { flex: 1; gap: 6px; }
.loc-city__rename .form-control { flex: 1; min-width: 0; }
[data-theme="dark"] .loc-prov { background: var(--d-surface); border-color: var(--d-border); }
[data-theme="dark"] .loc-prov[open] .loc-prov__head { border-bottom-color: var(--d-border); }
.loc-prov__settings { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px dashed #e9ecee; }
.loc-rename { gap: 6px; flex-wrap: wrap; }
.loc-rename .form-control { max-width: 200px; }
.loc-newprov { margin-bottom: 10px; }
[data-theme="dark"] .loc-prov__settings { border-bottom-color: var(--d-border); }
.loc-flag { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--canadong-ink); cursor: pointer; white-space: nowrap; }
.loc-flag input { width: 15px; height: 15px; accent-color: var(--canadong-red); }
.loc-flag small { color: #97a0a6; }
.loc-badge { display: inline-block; font-size: 11px; font-weight: 700; color: var(--canadong-red); background: var(--canadong-soft); border-radius: 20px; padding: 1px 8px; margin-left: 6px; }
.news-key-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.news-key-actions form { margin: 0; }
.admin-user-edit { max-width: 640px; }
.admin-user-edit .settings__actions { display: flex; gap: 10px; margin-top: 6px; }
a.admin-btn { display: inline-block; text-decoration: none; line-height: 1.5; }
