/* Astroflick — Digiknack tokens, astrology-only shell */

html.af-html,
body.af-landing,
body.af-body {
  --af-accent: #f5f203;
  --af-grad: linear-gradient(90deg, #f5f203 0%, #bcba02 70.1397%, #8f8d02 100%);
  --accent-color: #f5f203;
  --cal-accent: #f5f203;
  --admin-accent: #f5f203;
  --dk-scroll-thumb-accent: #f5f203;
  --cal-text: #e3dbcc;
  --cal-border: rgba(227, 219, 204, 0.12);
  /* DigiknackSelect / DigiknackDate — yellow surfaces (no pink) */
  --dk-select-accent: #f5f203;
  --dk-select-hover: color-mix(in srgb, #f5f203 14%, transparent);
  --dk-select-selected: color-mix(in srgb, #f5f203 18%, #0a0a0a);
  --dk-select-selected-hover: color-mix(in srgb, #f5f203 28%, #0a0a0a);
  --dk-date-accent: #f5f203;
  --dk-date-rule: color-mix(in srgb, #f5f203 35%, transparent);
}

/* Portaled DigiknackSelect panels */
html.af-html .dk-select__panel,
body.af-body .dk-select__panel,
html.af-html .dk-date__panel,
body.af-body .dk-date__panel {
  --cal-accent: #f5f203;
  --dk-select-accent: #f5f203;
  --dk-select-hover: color-mix(in srgb, #f5f203 14%, transparent);
  --dk-select-selected: color-mix(in srgb, #f5f203 18%, #0a0a0a);
  --dk-select-selected-hover: color-mix(in srgb, #f5f203 28%, #0a0a0a);
  --dk-date-accent: #f5f203;
  --dk-date-rule: color-mix(in srgb, #f5f203 35%, transparent);
}

body.af-body .astro-suggest-list__btn:hover,
body.af-body .astro-suggest-list__btn:focus,
body.af-body .astro-suggest-list__btn:focus-visible {
  background: color-mix(in srgb, #f5f203 14%, transparent);
}

body.af-body .dk-select__option:hover:not(:disabled),
body.af-body .dk-select__option.is-active:not(:disabled),
html.af-html .dk-select__panel .dk-select__option:hover:not(:disabled),
html.af-html .dk-select__panel .dk-select__option.is-active:not(:disabled) {
  background: color-mix(in srgb, #f5f203 14%, transparent);
}

body.af-body .dk-select__option.is-selected,
html.af-html .dk-select__panel .dk-select__option.is-selected {
  background: color-mix(in srgb, #f5f203 18%, #0a0a0a);
}

body.af-body .dk-select__option.is-selected.is-active,
body.af-body .dk-select__option.is-selected:hover:not(:disabled),
html.af-html .dk-select__panel .dk-select__option.is-selected.is-active,
html.af-html .dk-select__panel .dk-select__option.is-selected:hover:not(:disabled) {
  background: color-mix(in srgb, #f5f203 28%, #0a0a0a);
}

body.af-body .dk-date__day.is-selected,
body.af-body .dk-date__day[aria-selected='true'],
html.af-html .dk-date__panel .dk-date__day.is-selected {
  background: #f5f203;
  border-color: #f5f203;
  color: #060606;
}

body.af-body .admin-user-menu__item:hover,
body.af-body .admin-user-menu__item:focus-visible,
body.af-body .crm-row-menu__item:hover,
body.af-body .crm-row-menu__item:focus-visible {
  background: color-mix(in srgb, #f5f203 12%, transparent);
}

body.af-body *:focus-visible {
  outline-color: color-mix(in srgb, #f5f203 45%, transparent);
}

.af-body {
  background: #060606;
  color: #e3dbcc;
}

/* Digiknack visitor chat — landing only */
body.af-body .dk-chat,
html.af-html body.af-body .dk-chat {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* Landing must scroll (admin-body locks overflow) — Digiknack thin accent bar */
html.af-html,
body.af-landing {
  height: auto;
  max-height: none;
  overflow-x: hidden;
  overflow-y: auto;
}

body.af-landing.dk-scroll {
  scrollbar-gutter: stable;
}

.af-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.af-brand {
  font-family: clother, system-ui, sans-serif;
  font-size: 1.25rem;
  color: #e3dbcc;
  text-decoration: none;
  letter-spacing: 0.02em;
}

.af-top__nav {
  display: flex;
  align-items: center;
  gap: 16px;
}

.af-top__nav a {
  color: rgba(227, 219, 204, 0.75);
  text-decoration: none;
  font-size: 0.875rem;
}

.af-hero {
  max-width: 40rem;
  margin: 0 auto;
  padding: 72px 24px 48px;
}

.af-hero__brand {
  margin: 0 0 12px;
  font-size: clamp(2.5rem, 8vw, 4rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  color: #e3dbcc;
  line-height: 1.05;
}

.af-hero__title {
  margin: 0 0 12px;
  font-size: 1.125rem;
  font-weight: 400;
  line-height: 1.45;
  color: rgba(227, 219, 204, 0.85);
}

.af-hero__sub {
  margin: 0 0 28px;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: rgba(227, 219, 204, 0.55);
}

.af-hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}

.af-link {
  color: #f5f203;
  text-decoration: none;
  font-size: 0.875rem;
}

button.af-link {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font: inherit;
}

.af-auth-forgot-row {
  margin: 0;
  text-align: right;
}

.af-auth-forgot-btn {
  font-size: 0.8125rem;
  line-height: 1.3;
  color: rgba(227, 219, 204, 0.55);
}

.af-auth-forgot-btn:hover {
  color: #e3dbcc;
}

.af-auth-switch {
  margin: 0;
  color: rgba(227, 219, 204, 0.55);
  font-size: 14px;
  line-height: 1.3;
  min-width: 0;
  flex: 1 1 auto;
}

.af-auth-switch--under-title {
  flex: 0 0 auto;
  margin: -2px 0 0;
}

.af-auth-switch .af-btn {
  margin-left: 4px;
}

.af-auth-panel {
  width: min(420px, calc(100vw - 32px)) !important;
  max-width: min(420px, calc(100vw - 32px)) !important;
  top: 16px !important;
  bottom: auto !important;
  height: auto !important;
  max-height: calc(100dvh - 32px);
  padding: 18px 14px !important;
  gap: 10px !important;
}

.af-auth-panel .contact-panel__main,
.af-auth-panel .admin-slideout-main {
  flex: 0 1 auto;
  gap: 10px;
  overflow: visible;
  padding-left: 0;
  padding-right: 0;
}

.af-auth-panel .contact-title {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
}

.af-auth-panel .admin-slideout-hint {
  margin: 0;
}

.af-auth-panel form[hidden] {
  display: none !important;
}

.af-auth-form {
  display: flex;
  flex-direction: column;
  margin: 0;
  min-height: 0;
  flex: 0 1 auto;
  gap: 10px;
}

.af-auth-fields {
  display: block;
  margin: 0;
  border: 1px solid rgba(227, 219, 204, 0.35);
  border-radius: 12px;
  background: transparent;
  overflow: hidden;
  flex: 0 0 auto;
}

.af-auth-field {
  display: block;
  position: relative;
  margin: 0;
}

.af-auth-field + .af-auth-field {
  border-top: 1px solid rgba(227, 219, 204, 0.35);
}

.af-auth-input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 8px 14px;
  line-height: 1.35;
  border: 0;
  border-radius: 0;
  background: transparent;
  font: inherit;
  font-size: 14px;
  font-weight: 400;
  color: #e3dbcc;
  caret-color: #e3dbcc;
  outline: none;
  box-shadow: none;
  -webkit-appearance: none;
  appearance: none;
}

.af-auth-input::placeholder {
  color: rgba(227, 219, 204, 0.5);
}

.af-auth-input:focus,
.af-auth-input:focus-visible,
.af-auth-input:invalid,
.af-auth-input:user-invalid {
  outline: none;
  border: 0;
  box-shadow: none;
}

.af-auth-input:-webkit-autofill,
.af-auth-input:-webkit-autofill:hover,
.af-auth-input:-webkit-autofill:focus,
.af-auth-input:-webkit-autofill:active {
  -webkit-text-fill-color: #e3dbcc !important;
  caret-color: #e3dbcc;
  transition: background-color 99999s ease-out;
  box-shadow: 0 0 0 1000px #202020 inset !important;
}

.af-auth-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 0;
  border: 0;
  flex-wrap: wrap;
}

.af-auth-footer--end {
  justify-content: flex-end;
}

.af-auth-footer .af-btn:last-child {
  margin-left: auto;
}

.af-auth-panel .contact-feedback--compact {
  margin: 0;
  min-height: 0;
}

.af-auth-panel .contact-feedback--compact:empty {
  display: none;
  margin: 0;
}

.af-packs {
  max-width: 56rem;
  margin: 0 auto;
  padding: 24px 24px 80px;
}

.af-section-title {
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(227, 219, 204, 0.55);
}

.af-section-sub {
  margin: 0 0 24px;
  color: rgba(227, 219, 204, 0.65);
  font-size: 0.875rem;
}

.af-pack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.af-pack {
  padding: 18px 16px;
  border: 1px solid rgba(227, 219, 204, 0.12);
  border-radius: 8px 8px 8px 0;
  background: #202020;
}

.af-pack--free {
  border-color: rgba(227, 219, 204, 0.22);
}

.af-pack--free .af-pack__buy {
  display: inline-flex;
  text-decoration: none;
}

.af-pack h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 400;
  color: #e3dbcc;
}

.af-pack__price {
  margin: 0;
  font-size: 1.5rem;
  color: #e3dbcc;
}

.af-pack__tokens {
  margin: 4px 0 16px;
  font-size: 0.8125rem;
  color: rgba(227, 219, 204, 0.55);
}

.af-packs__note {
  margin: 20px 0 0;
  font-size: 0.75rem;
  color: rgba(227, 219, 204, 0.45);
}

.af-foot {
  padding: 24px;
  text-align: center;
  font-size: 0.75rem;
  color: rgba(227, 219, 204, 0.35);
}

.af-app {
  /* Digiknack admin page inset — 60px sides, 32px top/bottom */
  --admin-page-padding-x: 60px;
  --admin-page-padding-y: 32px;
  display: flex !important;
  flex-direction: column;
  min-height: 100dvh;
  /* admin-app already pads; do not double-pad header/main */
}

.af-app__header {
  /* Match Digiknack: header sits inside .admin-app padding, no extra inset */
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0;
  border-bottom: none;
  flex-shrink: 0;
  width: 100%;
}

.af-app__header-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex: 0 0 auto;
  position: relative;
  z-index: 40;
  overflow: visible;
}

.af-app .admin-user-menu {
  position: relative;
  z-index: 40;
  overflow: visible;
}

.af-app .admin-user-menu__dropdown {
  z-index: 50;
}

.af-tokens {
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--af-accent, #f5f203);
}

.af-user-menu__email {
  margin: 0 0 4px;
  padding: 6px 4px 10px;
  font-size: 0.75rem;
  font-weight: 400;
  color: rgba(227, 219, 204, 0.55);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-bottom: 1px solid rgba(227, 219, 204, 0.35);
}

.af-app__main {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  /* Digiknack: main content uses the same horizontal inset from .admin-app */
  padding: 12px 0 0;
}

@media (max-width: 1100px) {
  .af-app {
    --admin-page-padding-x: 20px;
    --admin-page-padding-y: 24px;
  }
}

@media (max-width: 720px) {
  .af-app {
    --admin-page-padding-x: 16px;
    --admin-page-padding-y: 20px;
  }
}

.af-app .admin-app__brand:focus-visible {
  outline-color: rgba(245, 242, 3, 0.45);
}

.af-app .admin-user-menu__trigger:focus-visible {
  outline-color: rgba(245, 242, 3, 0.45);
}

.af-app .admin-user-menu__item:hover,
.af-app .admin-user-menu__item:focus-visible {
  color: #f5f203;
}

.af-app .admin-user-menu__item .crm-row-menu__icon,
.af-app .admin-user-menu__item .crm-row-menu__icon svg {
  color: #f5f203;
  stroke: #f5f203;
}

/* Slideout panels — same thin Digiknack scrollbar; never sideways scroll the panel */
html.af-html,
body.af-body,
.af-body .admin-app,
.af-body .admin-app__main {
  overflow-x: hidden !important;
  max-width: 100%;
}

.af-body .contact-overlay,
.af-body .contact-panel,
.af-body .admin-slideout-panel,
.af-body #astro-chart-overlay,
.af-body #astro-chart-overlay .contact-panel,
.af-body #af-auth-overlay .contact-panel,
.af-body #af-packs-overlay .contact-panel,
.af-body #af-logs-overlay .contact-panel {
  overflow-x: hidden !important;
  max-width: min(100vw, 100%);
}

.af-body .contact-panel,
.af-body .admin-slideout-panel,
.af-body #astro-chart-overlay .contact-panel.astro-slideout-panel {
  box-sizing: border-box;
  min-width: 0;
}

.af-body .contact-panel__main,
.af-body .astro-slideout-main,
.af-body .admin-slideout-main,
.af-body .astro-slideout-form,
.af-body .astro-slideout-tabpanels,
.af-body .crm-lead-tabpanel {
  overflow-x: hidden !important;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.af-body .contact-panel__main {
  scrollbar-width: thin;
  scrollbar-color: var(--dk-scroll-thumb-accent, #f5f203) transparent;
}

.af-body .contact-panel__main::-webkit-scrollbar {
  width: 2px;
  height: 0; /* no horizontal scrollbar track */
}

.af-body .contact-panel__main::-webkit-scrollbar-thumb {
  background: var(--dk-scroll-thumb-accent, #f5f203);
  border-radius: 1px;
  min-height: 30px;
}

/*
 * Digiknack admin tables force min-width 880px + overflow-x:auto — that is the
 * sidescroll on Astroflick Charts and inside the birth-chart slideout.
 * Fit columns to the panel; clip instead of panning sideways.
 */
.af-body .admin-table-wrap,
.af-body .astro-table-wrap,
.af-body #astro-chart-overlay .admin-table-wrap,
.af-body #astro-chart-overlay .astro-table-wrap,
.af-body #af-logs-overlay .admin-table-wrap {
  max-width: 100% !important;
  min-width: 0 !important;
  overflow-x: hidden !important;
  overscroll-behavior-x: none;
}

.af-body .admin-table,
.af-body .admin-table.admin-table--compact,
.af-body #astro-table {
  min-width: 0 !important;
  width: 100% !important;
  max-width: 100%;
  table-layout: fixed;
}

.af-body .admin-table th,
.af-body .admin-table td {
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
}

.af-body #astro-chart-overlay .admin-ai-md,
.af-body #astro-chart-overlay pre,
.af-body #astro-chart-overlay code {
  max-width: 100%;
  overflow-x: hidden;
}

.af-body #astro-chart-overlay .admin-ai-md,
.af-body #astro-chart-overlay .admin-ai-md * {
  word-break: break-word;
  overflow-wrap: anywhere;
}

/*
 * Predictions chat — flex min-content width + overflow:auto was still
 * sidescrolling the thread (Thinking dumps, wide tables, long URLs).
 */
.af-body #astro-tab-panel-predictions,
.af-body #astro-tab-panel-predictions .astro-predict-wrap,
.af-body #astro-tab-panel-predictions .astro-predict-shell,
.af-body #astro-tab-panel-predictions .astro-predict-body,
.af-body #astro-tab-panel-predictions .astro-predict-thread,
.af-body #astro-tab-panel-predictions .dk-compose[data-dk-compose='predict'] {
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box;
}

.af-body #astro-tab-panel-predictions .astro-predict-thread {
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior-x: none;
}

.af-body #astro-tab-panel-predictions .admin-ai-md table {
  min-width: 0 !important;
  width: 100% !important;
  table-layout: fixed;
}

.af-body #astro-tab-panel-predictions .admin-ai-md th,
.af-body #astro-tab-panel-predictions .admin-ai-md td {
  white-space: normal !important;
}

/* Tabs may scroll internally for many labels — never chain to the page */
.af-body #astro-chart-overlay .astro-slideout-tabs {
  max-width: 100%;
  min-width: 0;
  overscroll-behavior-x: contain;
}

.af-app__main #panel-astrology {
  display: block !important;
}

.af-charts-top {
  /* Digiknack module gap: 100px between title and Add */
  justify-content: flex-start !important;
  align-items: center;
  gap: 100px !important;
  margin-bottom: 20px;
}

.af-add-chart {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  margin: 0;
  padding: 0;
  min-height: 0;
  border: 0;
  background: none;
  color: #e3dbcc !important;
  cursor: pointer;
}

.af-add-chart .dk-btn__icon,
.af-add-chart svg.lucide {
  width: 18px;
  height: 18px;
  color: #f5f203 !important;
  stroke: #f5f203 !important;
  flex-shrink: 0;
}

.af-add-chart:hover .dk-btn__icon,
.af-add-chart:hover svg.lucide {
  transform: none;
}

.af-body .admin-table thead [data-astro-col="company"],
.af-body .admin-table thead [data-astro-col="by"],
.af-body .admin-table tbody [data-astro-col="company"],
.af-body .admin-table tbody [data-astro-col="by"] {
  display: none !important;
}

.af-pack-grid--slideout {
  margin-top: 12px;
}

.af-logs-panel .admin-slideout-main {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.af-logs-table-wrap {
  margin-top: 12px;
  flex: 1;
  min-height: 0;
  max-height: min(70vh, 560px);
  overflow: auto;
}

.af-logs-user {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.af-logs-name {
  color: #e3dbcc;
  font-weight: 400;
}

.af-logs-email {
  color: rgba(227, 219, 204, 0.65);
  font-size: 12px;
  word-break: break-all;
}

.af-logs-tier {
  color: #e3dbcc;
}

.af-logs-tier--nova,
.af-logs-tier--super-admin {
  color: #f5f203;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
