/**
 * Phase 1 boundaries for Premium, nxtlAI and MCP.
 * Page CSS stays scoped by unique class names. Tokens come from .nxtl-shell.
 */

.rate-preview-note,
.showcase-empty,
.buddy-history-empty {
  color: var(--t2);
  font-size: 0.8125rem;
  line-height: 1.5;
}

.rate-preview-note {
  margin-top: 0.35rem;
}

.showcase-empty,
.buddy-history-empty {
  margin: 0;
  padding: 1.25rem 0.25rem;
}

.msg-notice {
  margin: 0.75rem 0;
  padding: 0.9rem 1rem;
  border: 1px solid var(--b2);
  border-radius: var(--r-l);
  background: var(--c2);
  color: var(--t1);
  font-size: 0.9375rem;
  line-height: 1.5;
}

body.nxtl-feature-premium #premiumActiveBanner,
body.nxtl-feature-premium #heroMemberCta,
body.nxtl-feature-premium #ctaBuddyPrimary {
  display: none !important;
}

body.nxtl-feature-premium .premium-page,
body.nxtl-feature-premium .closing-photo-sec {
  margin-bottom: 0;
}

body.nxtl-feature-premium .ftr {
  margin-top: 0;
}

body.buddy--embedded .nxtl-shell {
  height: 100%;
  max-height: 100%;
  padding-top: env(safe-area-inset-top, 0px);
}

body.buddy--embedded .buddy-app-bar {
  height: calc(52px + env(safe-area-inset-top, 0px));
  padding-top: env(safe-area-inset-top, 0px);
}

body.nxtl-feature-page [hidden] {
  display: none !important;
}

body.nxtl-feature-page dialog.nxtl-modal-dialog {
  position: fixed;
  inset: 0;
  width: min(560px, calc(100vw - 32px));
  height: fit-content;
  max-height: calc(100dvh - 48px);
  margin: auto;
  overflow: auto;
}

/* Homepage locks hero metrics with !important. Restore the approved prototype scale on these pages only. */
body.nxtl-feature-page .nxtl-shell .h-sec {
  font-size: clamp(1.625rem, 3vw, 2.25rem) !important;
  line-height: 1.18 !important;
  letter-spacing: -0.03em !important;
}
body.nxtl-feature-page .sec-head > .h-sec,
body.nxtl-feature-community .directory-header > .h-sec,
body.nxtl-feature-mcp .mcp-section .h-sec {
  margin-bottom: 14px !important;
}
body.nxtl-feature-page .sec-head > .h-sec + .lead,
body.nxtl-feature-community .directory-header > .h-sec + .lead,
body.nxtl-feature-page .sec-head > .lead {
  margin-top: 0;
}
body.nxtl-feature-premium .nxtl-shell .h-hero,
body.nxtl-feature-mcp .nxtl-shell .h-hero,
body.nxtl-feature-ai .nxtl-shell .h-hero {
  font-size: clamp(2.25rem, 4.5vw, 3.5rem) !important;
  line-height: 1.08 !important;
  letter-spacing: -0.04em !important;
}
body.nxtl-feature-community .nxtl-shell .community-hero .h-hero {
  font-size: clamp(2.25rem, 5vw, 3.5rem) !important;
  line-height: 1.12 !important;
  letter-spacing: -0.035em !important;
}

/* Header is fixed. Paint the page canvas so the translucent header is not over the browser background. */
html:has(body.nxtl-feature-page),
body.nxtl-feature-page {
  background: #0a0c12;
}
body.nxtl-feature-ai:not(.buddy--embedded) .nxtl-shell {
  padding-top: var(--hdr, 64px);
  background: #0a0c12;
}

body.nxtl-feature-premium .premium-hero-sec {
  padding-top: calc(var(--hdr, 64px) + clamp(2.25rem, 4vw, 3.5rem));
}
body.nxtl-feature-mcp .mcp-hero-sec {
  padding-top: calc(var(--hdr, 64px) + clamp(1.75rem, 3vw, 2.75rem));
}
body.nxtl-feature-ai:not(.buddy--embedded) .buddy-page-wrapper {
  margin-top: 0;
  height: calc(100dvh - var(--hdr, 64px) - var(--toolbar-h, 0px));
}

/* Embedded bar is inside the shell. Do not subtract it again. */
body.buddy--embedded .nxtl-shell {
  height: 100%;
  max-height: 100dvh;
  padding-top: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
body.buddy--embedded .buddy-app-bar {
  height: calc(52px + env(safe-area-inset-top, 0px));
  padding-top: env(safe-area-inset-top, 0px);
  box-sizing: border-box;
}
body.buddy--embedded .buddy-page-wrapper {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
}
@media (max-width: 860px) {
  body.buddy--embedded .buddy-sidebar {
    top: calc(52px + env(safe-area-inset-top, 0px) + 12px);
  }
}

body.nxtl-feature-ai .buddy-sidebar-footer {
  flex-shrink: 0;
  margin-top: auto;
}
body.nxtl-feature-ai .buddy-history-empty {
  padding: 0.75rem 0.35rem 0;
}

/* Homepage reset is more specific than a single class. Restore feature controls only. */
body.nxtl-feature-page .nxtl-shell button.btn--p {
  background: var(--grad-accent);
  color: #ffffff;
  border: none;
}
body.nxtl-feature-page .nxtl-shell button.btn--s,
body.nxtl-feature-page .nxtl-shell a.btn--s {
  background-color: var(--c2);
  color: var(--t1);
  border: 1px solid var(--b1);
}
body.nxtl-feature-premium .nxtl-shell button.rate-shortcut-pill,
body.nxtl-feature-premium .nxtl-shell button.showcase-filter-pill {
  background: #0a0c12;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--t2);
  font-size: 0.6875rem;
  font-weight: 600;
}
body.nxtl-feature-premium .nxtl-shell button.showcase-filter-pill {
  background: var(--c1);
  border-color: var(--b1);
  font-size: 0.8125rem;
  padding: 6px 14px;
}
body.nxtl-feature-premium .nxtl-shell button.rate-shortcut-pill:hover,
body.nxtl-feature-premium .nxtl-shell button.showcase-filter-pill:hover,
body.nxtl-feature-premium .nxtl-shell button.showcase-filter-pill.is-active {
  background: #161922;
  color: var(--t1);
  border-color: rgba(255, 255, 255, 0.16);
}
body.nxtl-feature-premium .nxtl-shell button.rate-shortcut-pill.is-active,
body.nxtl-feature-premium .nxtl-shell button.showcase-filter-pill.is-active {
  background: rgba(255, 61, 90, 0.12);
  border-color: var(--coral);
  color: var(--coral);
}
body.nxtl-feature-premium .rate-picker {
  position: relative;
  margin: 0.75rem 0;
}
body.nxtl-feature-premium .rate-picker-label,
body.nxtl-feature-premium .rate-result-note,
body.nxtl-feature-premium .rate-source-note,
body.nxtl-feature-premium .rate-preview-note {
  font-size: 0.8125rem;
  line-height: 1.45;
}
body.nxtl-feature-premium .rate-source-note {
  margin-top: 0.75rem;
  color: var(--t3);
}
body.nxtl-feature-premium .nxtl-shell button.rate-picker-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  background: #0a0c12;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--r-s);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  text-align: left;
}
body.nxtl-feature-premium .nxtl-shell button.rate-picker-button:focus-visible,
body.nxtl-feature-premium .rate-picker-search:focus {
  border-color: var(--coral);
  outline: none;
  box-shadow: 0 0 0 1px var(--coral);
}
body.nxtl-feature-premium .rate-picker-panel {
  position: absolute;
  z-index: 5;
  left: 0;
  right: 0;
  margin-top: 4px;
  padding: 8px;
  background: #111319;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--r-s);
}
body.nxtl-feature-premium .nxtl-shell input.rate-picker-search {
  width: 100%;
  min-height: 44px;
  margin-bottom: 6px;
  padding: 0 10px;
  background: #0a0c12;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--r-s);
  color: #fff;
  font-size: 16px;
}
body.nxtl-feature-premium .rate-picker-list {
  max-height: 220px;
  margin: 0;
  padding: 0;
  overflow: auto;
  list-style: none;
}
body.nxtl-feature-premium .rate-picker-option,
body.nxtl-feature-premium .rate-picker-empty {
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
}
body.nxtl-feature-premium .rate-picker-option.is-active,
body.nxtl-feature-premium .rate-picker-option[aria-selected="true"] {
  background: rgba(255, 61, 90, 0.12);
  color: #fff;
}
body.nxtl-feature-page .visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
body.nxtl-feature-premium .rate-native-fallback {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
body.nxtl-feature-premium .rate-tier-val {
  font-size: 1.35rem;
  font-weight: 700;
}
body.nxtl-feature-community .nxtl-shell button.directory-search-clear,
body.nxtl-feature-community .nxtl-shell input.directory-search-input {
  background: #0a0c12;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
}
body.nxtl-feature-community .ftr,
body.nxtl-feature-premium .ftr {
  margin-top: 0;
}

body.nxtl-feature-premium .nxtl-shell select.rate-country-select,
body.nxtl-feature-premium .nxtl-shell input.rate-country-search {
  width: 100%;
  height: 38px;
  padding: 0 10px;
  background: #0a0c12;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--r-s);
  color: #ffffff;
  font-family: var(--ff);
  font-size: 0.8125rem;
  font-weight: 600;
}
body.nxtl-feature-premium .nxtl-shell input.rate-country-search {
  margin-bottom: 8px;
  font-weight: 500;
}
body.nxtl-feature-premium .nxtl-shell select.rate-country-select:focus,
body.nxtl-feature-premium .nxtl-shell input.rate-country-search:focus {
  border-color: var(--coral);
  outline: none;
  box-shadow: 0 0 0 1px var(--coral);
}
body.nxtl-feature-premium .rate-card-meta {
  flex-wrap: wrap;
  gap: 4px 12px;
}
body.nxtl-feature-premium .rate-card-pricing {
  gap: 10px;
}
body.nxtl-feature-premium .rate-price-block {
  min-width: 0;
  flex: 1 1 0;
}
body.nxtl-feature-premium .rate-tier-val,
body.nxtl-feature-premium .rate-tier-unit {
  overflow-wrap: anywhere;
}
body.nxtl-feature-premium .rate-tier-unit {
  font-size: 0.6875rem;
  color: var(--t3);
}
body.nxtl-feature-premium .compare-table {
  min-width: 720px;
}
body.nxtl-feature-premium .compare-table-wrap:focus {
  outline: 1px solid var(--coral);
  outline-offset: 2px;
}
body.nxtl-feature-premium .compare-pill {
  white-space: normal;
  line-height: 1.35;
}

body.nxtl-feature-mcp .nxtl-shell button.mcp-prompt-btn {
  background: var(--c1);
  border: 1px solid var(--b1);
  border-radius: var(--r-m);
  color: var(--t1);
  font-size: 0.875rem;
  font-weight: 500;
  text-align: left;
}
body.nxtl-feature-mcp .nxtl-shell button.mcp-prompt-btn:hover,
body.nxtl-feature-mcp .nxtl-shell button.mcp-prompt-btn:focus-visible,
body.nxtl-feature-mcp .nxtl-shell button.mcp-prompt-btn.is-active {
  background: var(--c2);
  border-color: var(--coral);
  color: #ffffff;
}
body.nxtl-feature-mcp .nxtl-shell button.mcp-prompt-btn.is-active {
  box-shadow: 0 0 0 1px var(--coral);
}
body.nxtl-feature-mcp .nxtl-shell button.mcp-action-pill,
body.nxtl-feature-mcp .nxtl-shell button.mcp-assistant-opt-btn,
body.nxtl-feature-page .nxtl-shell button.modal-close-btn {
  background: var(--c1);
  border: 1px solid var(--b1);
  color: var(--t2);
}
body.nxtl-feature-mcp .nxtl-shell button.mcp-action-pill {
  background: var(--grad-accent);
  border: none;
  color: #ffffff;
}

body.nxtl-feature-ai .nxtl-shell button.buddy-new-chat-btn,
body.nxtl-feature-ai .nxtl-shell button.buddy-toggle-sidebar-btn,
body.nxtl-feature-ai .nxtl-shell button.buddy-suggestion-card,
body.nxtl-feature-ai .nxtl-shell button.buddy-app-back-btn,
body.nxtl-feature-ai .nxtl-shell button.buddy-app-history-btn,
body.nxtl-feature-ai .nxtl-shell button.buddy-history-item,
body.nxtl-feature-ai .nxtl-shell button.buddy-history-delete,
body.nxtl-feature-ai .nxtl-shell button.buddy-history-close,
body.nxtl-feature-ai .nxtl-shell button.msg-status-action {
  background: var(--c1);
  border: 1px solid var(--b1);
  color: var(--t1);
  font-family: Inter, 'NXTL Inter Fallback', var(--fb), sans-serif;
  letter-spacing: normal;
  text-transform: none;
}
body.nxtl-feature-ai .nxtl-shell button.buddy-new-chat-btn {
  background: var(--c2);
  height: 38px;
  font-size: 14px;
  font-weight: 600;
}
body.nxtl-feature-ai .nxtl-shell button.buddy-history-item {
  background: transparent;
  border-color: transparent;
  font-size: 14px;
  font-weight: 500;
}
body.nxtl-feature-ai .nxtl-shell button.buddy-history-delete,
body.nxtl-feature-ai .nxtl-shell button.buddy-history-close,
body.nxtl-feature-ai .nxtl-shell button.msg-status-action {
  background: transparent;
}
body.nxtl-feature-ai .nxtl-shell button.copy-action-btn {
  width: auto;
  border: 0;
  background: transparent;
  color: #9AA3B5;
  font-size: 13px;
  font-weight: 500;
}
body.nxtl-feature-ai .nxtl-shell button.buddy-suggestion-card {
  text-align: left;
  padding: 12px 14px;
}
body.nxtl-feature-ai .nxtl-shell button.buddy-suggestion-card:hover,
body.nxtl-feature-ai .nxtl-shell button.buddy-new-chat-btn:hover,
body.nxtl-feature-ai .nxtl-shell button.buddy-toggle-sidebar-btn:hover {
  background: var(--c2);
  border-color: var(--coral);
}
body.nxtl-feature-ai .nxtl-shell .buddy-composer-wrap textarea.buddy-textarea,
body.nxtl-feature-ai .nxtl-shell .buddy-composer-wrap textarea.buddy-textarea:focus,
body.nxtl-feature-ai .nxtl-shell .buddy-composer-wrap textarea.buddy-textarea:focus-visible {
  background: transparent;
  border: 0;
  outline: none;
  box-shadow: none;
  color: var(--t1);
  font-family: var(--fb);
  font-size: 0.9375rem;
  line-height: 1.45;
  padding: 0;
}
@media (max-width: 860px) {
  body.nxtl-feature-ai .nxtl-shell .buddy-composer-wrap textarea.buddy-textarea,
  body.nxtl-feature-ai .nxtl-shell .buddy-composer-wrap textarea.buddy-textarea:focus,
  body.nxtl-feature-ai .nxtl-shell .buddy-composer-wrap textarea.buddy-textarea:focus-visible {
    font-size: 16px;
  }
}
body.nxtl-feature-ai .nxtl-shell button.composer-send-btn {
  width: 44px;
  height: 44px;
  background: var(--grad-accent);
  border: none;
  color: #ffffff;
  border-radius: var(--r-s);
}
body.nxtl-feature-ai .nxtl-shell button.composer-send-btn:disabled {
  opacity: 0.4;
}
