/* home.css — bento dashboard, page-specific (Bento 2026) */

.dash { padding: var(--sp-6) 0 var(--sp-9); }

/* ── Daily row: Today in History + Word of the Day ──────────────────────── */
.dash-daily { margin-bottom: var(--sp-8); }
.dash-today__year {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 600;
  color: var(--bento-ink);
}
.dash-word__term {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--bento-ink);
  text-transform: capitalize;
}
.dash-daily .bento-card__eyebrow { display: flex; align-items: center; gap: var(--sp-2); }
.dash-daily .bento-card__eyebrow svg { width: 14px; height: 14px; }

/* ── Explore section ──────────────────────────────────────────────────── */
.dash-explore { margin-bottom: var(--sp-8); }
.dash-explore__intro { color: var(--bento-ink-soft); margin: 0 0 var(--sp-5); }

.era-card { text-decoration: none; }
.era-card__icon {
  width: 52px; height: 52px;
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  background: var(--bento-tan-100);
  color: var(--bento-ink);
  margin-bottom: var(--sp-2);
}
.era-card__icon svg { width: 28px; height: 28px; }
.era-card .chip { align-self: flex-start; margin-top: auto; }

/* ── Recent searches ──────────────────────────────────────────────────── */
.dash-recent { margin-bottom: var(--sp-6); }
.section-heading {
  display: flex; align-items: center; gap: var(--sp-2);
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--bento-ink);
  margin: 0 0 var(--sp-4);
}
.section-heading svg { width: 16px; height: 16px; color: var(--bento-ink-soft); }

.recent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--sp-3);
}
.recent-card {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-4);
  border-radius: var(--r-md);
  background: var(--bento-cream);
  border: 1px solid var(--bento-line);
  text-decoration: none;
  transition: transform var(--dur-base) var(--ease-spring), box-shadow var(--dur-base) var(--ease-spring);
}
.recent-card:hover, .recent-card:focus-visible {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}
.recent-card__icon {
  width: 36px; height: 36px; flex-shrink: 0;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--bento-sand);
  color: var(--bento-ink-soft);
}
.recent-card__icon svg { width: 15px; height: 15px; }
.recent-card__body { min-width: 0; }
.recent-card__topic {
  display: block;
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--bento-ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.recent-card__meta { font-size: 0.8125rem; color: var(--bento-ink-soft); }

/* ── Free-limit modal (built on shared .bento-modal-overlay/.bento-modal) ── */
.limit-modal { text-align: center; max-width: 420px; }
.limit-modal__icon { display: flex; align-items: center; justify-content: center; margin-bottom: var(--sp-4); }
.limit-modal__icon svg { width: 56px; height: 56px; animation: limit-pulse 2.2s ease-in-out infinite; }
@keyframes limit-pulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.06); }
}
.limit-modal__title { font-size: 1.375rem; margin: 0 0 var(--sp-2); }
.limit-modal__sub { color: var(--bento-ink-soft); margin: 0 0 var(--sp-5); }
.limit-modal__countdown-wrap {
  display: inline-block;
  padding: var(--sp-3) var(--sp-6);
  margin-bottom: var(--sp-6);
  border-radius: var(--r-md);
  background: var(--bento-sand);
}
.limit-modal__countdown-label {
  font-size: 0.75rem;
  color: var(--bento-ink-soft);
  margin: 0 0 var(--sp-1);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.limit-modal__countdown { font-size: 1.625rem; font-weight: 700; color: var(--bento-ink); margin: 0; }
.limit-modal__btns { display: flex; flex-direction: column; gap: var(--sp-3); }
.limit-modal__cta { width: 100%; }

/* ── Feedback bubble ───────────────────────────────────────────────────── */
.fb-bubble {
  position: fixed;
  bottom: var(--sp-6);
  right: var(--sp-5);
  z-index: var(--z-modal);
  opacity: 0;
  transform: translateY(24px) scale(0.88);
  pointer-events: none;
  transition: opacity var(--dur-slow) var(--ease-spring), transform var(--dur-slow) var(--ease-spring);
}
.fb-bubble--visible { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.fb-bubble-inner {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4) var(--sp-3) var(--sp-3);
  border-radius: var(--r-pill);
  max-width: 300px;
  background: var(--bento-white);
  border: 1px solid var(--bento-line);
  box-shadow: var(--shadow-card-hover);
  cursor: pointer;
  transition: transform var(--dur-fast) ease, box-shadow var(--dur-fast) ease;
}
.fb-bubble-inner:hover { transform: scale(1.02); box-shadow: var(--shadow-card-hover); }
.fb-agent-icon { width: 42px; height: 42px; flex-shrink: 0; }
.fb-bubble-text-wrap { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.fb-bubble-name {
  font-size: 0.75rem; font-weight: 700;
  color: var(--bento-ink-soft);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.fb-bubble-label { font-size: 0.8125rem; font-weight: 500; color: var(--bento-ink); line-height: 1.4; }
.fb-bubble-close {
  background: none; border: none; cursor: pointer;
  padding: var(--sp-1) 0 var(--sp-1) var(--sp-1);
  color: var(--bento-ink-soft);
  flex-shrink: 0;
}
.fb-bubble-close:hover { color: var(--bento-ink); }
.fb-bubble-close svg { width: 12px; height: 12px; }

/* ── Feedback modal ────────────────────────────────────────────────────── */
.fb-modal {
  position: fixed; inset: 0;
  z-index: var(--z-modal);
  display: flex; align-items: center; justify-content: center;
  padding: var(--sp-4);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-base) ease;
}
.fb-modal.fb-modal--open { opacity: 1; pointer-events: auto; }
.fb-modal-backdrop { position: absolute; inset: 0; background: rgba(33, 26, 20, 0.4); }
.fb-modal-card {
  position: relative; z-index: 1;
  width: min(480px, 92vw);
  padding: var(--sp-6);
  border-radius: var(--r-lg);
  background: var(--bento-white);
  border: 1px solid var(--bento-line);
  box-shadow: var(--shadow-card-hover);
  transform: scale(0.92) translateY(20px);
  transition: transform var(--dur-slow) var(--ease-spring);
  max-height: 85vh;
  overflow-y: auto;
}
.fb-modal--open .fb-modal-card { transform: scale(1) translateY(0); }

.fb-modal-header { display: flex; align-items: flex-start; gap: var(--sp-3); margin-bottom: var(--sp-5); }
.fb-modal-agent { width: 52px; height: 52px; flex-shrink: 0; }
.fb-modal-header__text { flex: 1; }
.fb-modal-agent-name {
  font-size: 0.75rem; font-weight: 700;
  color: var(--bento-ink-soft);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: var(--sp-1);
}
.fb-modal-title { font-family: var(--font-body); font-size: 1rem; font-weight: 700; color: var(--bento-ink); margin: 0; line-height: 1.5; }
.fb-modal-close {
  background: none; border: none; cursor: pointer;
  color: var(--bento-ink-soft);
  padding: var(--sp-1);
  flex-shrink: 0;
}
.fb-modal-close:hover { color: var(--bento-ink); }
.fb-modal-close svg { width: 14px; height: 14px; }

.fb-textarea {
  width: 100%;
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-sm);
  background: var(--bento-cream);
  border: 1px solid var(--bento-line);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: var(--bento-ink);
  resize: vertical;
  min-height: 120px;
  outline: none;
  transition: border-color var(--dur-fast) ease, box-shadow var(--dur-fast) ease;
}
.fb-textarea:focus { border-color: var(--bento-tan-300); }
.fb-textarea:focus-visible { box-shadow: 0 0 0 2px var(--bento-tan-300); }
.fb-char-count { font-size: 0.75rem; color: var(--bento-ink-soft); text-align: right; margin: var(--sp-1) var(--sp-1) var(--sp-4); }
.fb-send-btn { width: 100%; }

/* ── Feedback thank-you celebration state ─────────────────────────────── */
.fb-thanks { display: none; text-align: center; padding: var(--sp-5) var(--sp-2) var(--sp-3); position: relative; overflow: hidden; min-height: 200px; }
.fb-modal-card[data-view="thanks"] #fb-form-view { display: none; }
.fb-modal-card[data-view="thanks"] #fb-thanks-view { display: block; }

.fb-confetti-dot { position: absolute; width: 9px; height: 9px; border-radius: 50%; top: 50%; left: 50%; opacity: 0; pointer-events: none; transform: translate(-50%, -50%); }
.fb-confetti-dot:nth-child(4n+1) { background: var(--bento-tan-200); }
.fb-confetti-dot:nth-child(4n+2) { background: var(--bento-tan-300); }
.fb-confetti-dot:nth-child(4n+3) { background: var(--bento-sand); border: 1px solid var(--bento-line); }
.fb-confetti-dot:nth-child(4n)   { background: var(--bento-ink-soft); }
.fb-thanks--active .fb-confetti-dot {
  animation: fb-confetti-fly var(--fly-dur, 1.2s) cubic-bezier(0.22, 0.61, 0.36, 1) var(--fly-delay, 0s) forwards;
}
@keyframes fb-confetti-fly {
  0%   { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(0deg); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--fly-x, 0px)), calc(-50% + var(--fly-y, 0px))) scale(0.2) rotate(180deg); }
}

.fb-thanks-check { width: 80px; height: 80px; margin: 0 auto var(--sp-3); transform: scale(0); opacity: 0; }
.fb-thanks--active .fb-thanks-check { animation: fb-check-bounce 0.55s var(--ease-spring) 0.08s both; }
@keyframes fb-check-bounce { 0% { transform: scale(0); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }

.fb-check-circle { stroke-dasharray: 151; stroke-dashoffset: 151; }
.fb-thanks--active .fb-check-circle { animation: fb-circle-draw 0.48s ease 0.08s forwards; }
@keyframes fb-circle-draw { to { stroke-dashoffset: 0; } }

.fb-check-path { stroke-dasharray: 38; stroke-dashoffset: 38; }
.fb-thanks--active .fb-check-path { animation: fb-check-draw 0.35s ease 0.48s forwards; }
@keyframes fb-check-draw { to { stroke-dashoffset: 0; } }

.fb-thanks-title {
  font-family: var(--font-display); font-size: 1.25rem; font-weight: 600;
  color: var(--bento-ink); margin: 0 0 var(--sp-2);
  opacity: 0; transform: translateY(10px);
}
.fb-thanks--active .fb-thanks-title { animation: fb-text-rise 0.45s var(--ease-spring) 0.58s both; }

.fb-thanks-sub { font-size: 0.875rem; color: var(--bento-ink-soft); margin: 0; line-height: 1.5; opacity: 0; transform: translateY(8px); }
.fb-thanks--active .fb-thanks-sub { animation: fb-text-rise 0.45s var(--ease-spring) 0.76s both; }

@keyframes fb-text-rise { 0% { opacity: 0; transform: translateY(10px); } 100% { opacity: 1; transform: translateY(0); } }

@media (prefers-reduced-motion: reduce) {
  .fb-confetti-dot, .fb-thanks-check, .fb-check-circle, .fb-check-path, .fb-thanks-title, .fb-thanks-sub, .limit-modal__icon svg {
    animation: none !important; opacity: 1 !important; transform: none !important; stroke-dashoffset: 0 !important;
  }
}

@media (max-width: 600px) {
  .fb-bubble { bottom: var(--sp-4); right: var(--sp-4); }
  .fb-bubble-inner {
    max-width: none; width: 52px; height: 52px; padding: 0;
    justify-content: center; border-radius: 50%;
  }
  .fb-agent-icon { width: 28px; height: 28px; }
  .fb-bubble-text-wrap, .fb-bubble-close { display: none; }
}
