/* ========================================================================
   HANIHO UI — Unified Button & Pill System (Apple-inspired, dark-first)
   Tokens + 4 components: .hani-pill .hani-btn .hani-segmented .hani-icon-btn
   Replaces ad-hoc inline styles and per-screen chip/btn classes.
   ======================================================================== */

:root {
  /* HANIHO Brand Palette 2026 ------------------------------------- */
  --h-orange:  #FF6A00;  /* Primary — Live, Now, Brand */
  --h-pink:    #FF2D7A;  /* Alert/Danger — Signal, Urgency */
  --h-purple:  #8A2BE2;  /* Action/Now — Check-in, Presence */
  --h-blue:    #2B7BFF;  /* Info/Link — Community, Calm */
  --h-ink:     #111317;  /* Background ink */

  /* Pill tokens — neutral rest, orange-tint active */
  --hani-pill-bg:            rgba(255,255,255,0.05);
  --hani-pill-bg-hover:      rgba(255,255,255,0.09);
  --hani-pill-border:        rgba(255,255,255,0.10);
  --hani-pill-text:          #93a3b8;
  --hani-pill-active-bg:     rgba(255,106,0,0.16);
  --hani-pill-active-border: rgba(255,106,0,0.55);
  --hani-pill-active-text:   #FFD4B0;

  /* Button tokens ------------------------------------------------- */
  --hani-btn-bg-ghost:       rgba(255,255,255,0.06);
  --hani-btn-border-ghost:   rgba(255,255,255,0.14);
  --hani-btn-text-ghost:     #e7ecf3;

  --hani-btn-primary-bg:     var(--h-orange);
  --hani-btn-primary-bg-h:   #E55F00;
  --hani-btn-primary-shadow: 0 2px 12px rgba(255,106,0,0.35);

  --hani-btn-danger-bg:      var(--h-pink);
  --hani-btn-danger-bg-h:    #E3266B;
  --hani-btn-danger-shadow:  0 2px 12px rgba(255,45,122,0.35);

  --hani-btn-success-bg:     var(--h-purple);
  --hani-btn-success-bg-h:   #7823C8;
  --hani-btn-success-shadow: 0 2px 12px rgba(138,43,226,0.35);

  --hani-btn-info-bg:        var(--h-blue);
  --hani-btn-info-bg-h:      #236ADE;
  --hani-btn-info-shadow:    0 2px 12px rgba(43,123,255,0.35);

  /* Geometry */
  --hani-pill-h:    36px;
  --hani-pill-h-sm: 28px;
  --hani-btn-h:     48px;
  --hani-btn-h-sm:  40px;
  --hani-radius-btn: 14px;
}

/* ---------- PILL — chip/tab/category/scope/nav/hashtag ------------- */
.hani-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: var(--hani-pill-h);
  padding: 0 14px;
  border-radius: 999px;
  background: var(--hani-pill-bg);
  border: 1px solid var(--hani-pill-border);
  color: var(--hani-pill-text);
  font: 700 13px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: background .15s ease, border-color .15s ease,
              color .15s ease, transform .08s ease;
}
.hani-pill:hover  { background: var(--hani-pill-bg-hover); color: #cbd5e1; }
.hani-pill:active { transform: scale(0.97); }
.hani-pill.is-active,
.hani-pill[aria-selected="true"] {
  background: var(--hani-pill-active-bg);
  border-color: var(--hani-pill-active-border);
  color: var(--hani-pill-active-text);
}
.hani-pill--sm {
  min-height: var(--hani-pill-h-sm);
  padding: 0 10px;
  font-size: 12px;
}

/* ---------- BUTTON — primary actions ------------------------------- */
.hani-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--hani-btn-h);
  padding: 0 20px;
  border-radius: var(--hani-radius-btn);
  border: 1px solid transparent;
  background: var(--hani-btn-bg-ghost);
  color: var(--hani-btn-text-ghost);
  font: 700 15px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0.01em;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  text-decoration: none;
  transition: background .15s ease, transform .08s ease, box-shadow .2s ease;
}
.hani-btn:active { transform: scale(0.98); }
.hani-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.hani-btn--primary {
  background: var(--hani-btn-primary-bg);
  color: #fff;
  box-shadow: var(--hani-btn-primary-shadow);
}
.hani-btn--primary:hover { background: var(--hani-btn-primary-bg-h); }

.hani-btn--danger {
  background: var(--hani-btn-danger-bg);
  color: #fff;
  box-shadow: var(--hani-btn-danger-shadow);
}
.hani-btn--danger:hover { background: var(--hani-btn-danger-bg-h); }

.hani-btn--success {
  background: var(--hani-btn-success-bg);
  color: #fff;
  box-shadow: var(--hani-btn-success-shadow);
}
.hani-btn--success:hover { background: var(--hani-btn-success-bg-h); }

.hani-btn--info {
  background: var(--hani-btn-info-bg);
  color: #fff;
  box-shadow: var(--hani-btn-info-shadow);
}
.hani-btn--info:hover { background: var(--hani-btn-info-bg-h); }

.hani-btn--ghost {
  background: var(--hani-btn-bg-ghost);
  border-color: var(--hani-btn-border-ghost);
  color: var(--hani-btn-text-ghost);
}
.hani-btn--ghost:hover { background: rgba(255,255,255,0.1); }

.hani-btn--sm { min-height: var(--hani-btn-h-sm); padding: 0 16px; font-size: 14px; }
.hani-btn--block { width: 100%; }

/* ---------- SEGMENTED CONTROL — iOS-like ----------------------------- */
.hani-segmented {
  display: inline-flex;
  padding: 3px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 11px;
  gap: 0;
}
.hani-segmented > .hani-seg-item {
  flex: 1 1 auto;
  min-height: 32px;
  padding: 0 14px;
  border: 0;
  background: transparent;
  color: #93a3b8;
  font: 600 13px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: background .15s ease, color .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.hani-segmented > .hani-seg-item.is-active,
.hani-segmented > .hani-seg-item[aria-selected="true"] {
  background: rgba(255,255,255,0.12);
  color: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,0.25);
}

/* ---------- ICON BUTTON — round, utility ----------------------------- */
.hani-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: #cbd5e1;
  cursor: pointer;
  flex: 0 0 auto;
  font-size: 18px;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
  transition: background .15s ease, transform .08s ease;
}
.hani-icon-btn:hover  { background: rgba(255,255,255,0.1); }
.hani-icon-btn:active { transform: scale(0.94); }
.hani-icon-btn--primary {
  background: var(--hani-btn-primary-bg);
  border-color: transparent;
  color: #fff;
  box-shadow: var(--hani-btn-primary-shadow);
}
.hani-icon-btn--primary:hover { background: var(--hani-btn-primary-bg-h); }

/* ---------- LEGACY SELECTOR ALIASES ---------------------------------
   Map existing inconsistent chip classes onto the unified look without
   requiring every JS rewrite at once. These alias-selectors give the
   same visual treatment as .hani-pill / .is-active.
   -------------------------------------------------------------------- */
.heute-cat-chip,
.xf-chip,
.chat-view-btn,
.nav-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: var(--hani-pill-h);
  padding: 0 14px;
  border-radius: 999px;
  background: var(--hani-pill-bg);
  border: 1px solid var(--hani-pill-border);
  color: var(--hani-pill-text);
  font: 700 13px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s ease, border-color .15s ease,
              color .15s ease, transform .08s ease;
  -webkit-tap-highlight-color: transparent;
}
.heute-cat-chip:hover,
.xf-chip:hover,
.chat-view-btn:hover,
.nav-pill:hover { background: var(--hani-pill-bg-hover); color: #cbd5e1; }
.heute-cat-chip:active,
.xf-chip:active,
.chat-view-btn:active,
.nav-pill:active { transform: scale(0.97); }

.heute-cat-chip--active,
.xf-chip.xf-active,
.chat-view-btn.active {
  background: var(--hani-pill-active-bg);
  border-color: var(--hani-pill-active-border);
  color: var(--hani-pill-active-text);
}

/* scope toggles — render as segmented control ------------------------ */
.xf-scope-btn {
  flex: 1 1 auto;
  min-height: 32px;
  padding: 0 14px;
  border: 0;
  background: transparent;
  color: #93a3b8;
  font: 600 13px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: background .15s ease, color .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.xf-scope-btn.xf-active {
  background: rgba(255,255,255,0.12);
  color: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,0.25);
}
