/* Plan limit indicator (in drawer header) */
.plan-limit-indicator {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-secondary, #999);
  margin-left: 0.5rem;
  vertical-align: middle;
}
.plan-limit-indicator.at-limit {
  color: #dc3545;
  font-weight: 700;
}
.plan-limit-indicator.pro {
  color: #DD5100;
  font-weight: 600;
}

/* ============================================
   Upgrade Modal — matches checkout-panel visual language
   White card, polished, same badge/feature/button style
   ============================================ */

/* Overlay */
.upgrade-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 12, 10, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 1;
  transition: opacity 0.22s ease;
}
.upgrade-modal-overlay.hidden {
  display: none;
}

/* Card — matches .checkout-card */
.upgrade-modal {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 440px;
  margin: 1rem;
  padding: 1.5rem 1.75rem 1.25rem;
  box-shadow: 0 32px 80px rgba(0,0,0,0.28), 0 0 0 1px rgba(0,0,0,0.04);
  position: relative;
  transform: translateY(0) scale(1);
  color: #111;
  text-align: center;
  box-sizing: border-box;
  overflow: hidden;
}

/* Close button — matches .checkout-close */
.upgrade-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 32px;
  height: 32px;
  border: none;
  background: #f3f3f3;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  transition: background 0.12s, color 0.12s;
  padding: 0;
}
.upgrade-modal-close:hover {
  background: #e8e8e8;
  color: #111;
}

/* Badge row */
.upgrade-badge-row {
  margin-bottom: 0.75rem;
}

/* Badge — matches .checkout-badge */
.upgrade-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #FFF3EC;
  color: #DD5100;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid rgba(221,81,0,0.18);
}
.upgrade-badge svg {
  flex-shrink: 0;
}

/* Headline — matches .checkout-headline */
.upgrade-headline {
  font-size: 1.35rem;
  font-weight: 800;
  color: #111;
  line-height: 1.2;
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
}

.upgrade-sub {
  font-size: 0.88rem;
  color: #666;
  margin-bottom: 0.25rem;
  line-height: 1.5;
}
.upgrade-sub strong { color: #111; }

/* Price row — matches .checkout-price-row */
.upgrade-price-row {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  margin: 1.25rem 0 1rem;
  flex-wrap: wrap;
}
.upgrade-price {
  font-size: 2.5rem;
  font-weight: 800;
  color: #111;
  line-height: 1;
  letter-spacing: -0.03em;
}
.upgrade-period {
  font-size: 0.9rem;
  color: #888;
  font-weight: 500;
}
.upgrade-price-cancel {
  font-size: 0.72rem;
  color: #aaa;
  margin-left: auto;
  align-self: center;
}

/* Divider — matches .checkout-divider */
.upgrade-divider {
  border: none;
  border-top: 1px solid #f0f0f0;
  margin: 0 0 1rem;
}

/* Features list — matches .checkout-features */
.upgrade-features {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
  display: grid;
  gap: 0.5rem;
  text-align: left;
}
.upgrade-features li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.875rem;
  color: #333;
  font-weight: 500;
}

/* Check icon — matches .checkout-check */
.upgrade-check-icon {
  width: 18px;
  height: 18px;
  background: #F0FAF4;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #22a55b;
}
.upgrade-check-icon svg {
  stroke: #22a55b;
}

/* CTA button — matches .checkout-features primary action */
.upgrade-cta-btn {
  display: block;
  width: 100%;
  background: #DD5100;
  color: #fff;
  border: none;
  padding: 0.875rem 1.5rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.15s;
  margin-bottom: 0.75rem;
}
.upgrade-cta-btn:hover {
  background: #c44800;
}

/* Trust line */
.upgrade-trust {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 0.72rem;
  color: #aaa;
  margin-top: 0.25rem;
}
.upgrade-trust svg {
  color: #aaa;
  flex-shrink: 0;
}

/* Note */
.upgrade-note {
  font-size: 0.75rem;
  color: #aaa;
  margin-top: 0.5rem;
}

/* Anonymous email capture */
.upgrade-email-row {
  margin-bottom: 0.75rem;
}
.upgrade-email-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.15s;
  color: #111;
  background: #fafafa;
}
.upgrade-email-input:focus {
  border-color: #DD5100;
  box-shadow: 0 0 0 3px rgba(221,81,0,0.1);
}
.upgrade-email-hint {
  font-size: 11px;
  color: #999;
  margin: 5px 0 0;
  text-align: center;
}

/* SP-141: Referral code input — light theme to match white modal card */
.upgrade-referral-input {
  width: 100%;
  padding: 8px 12px;
  background: #fff;
  border: 1px solid #d0d0d0;
  border-radius: 6px;
  color: #1a1a1a;
  font-size: 14px;
  margin-top: 4px;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.15s;
}
.upgrade-referral-input::placeholder {
  color: #999;
}
.upgrade-referral-input:focus {
  border-color: #DD5100;
  box-shadow: 0 0 0 3px rgba(221, 81, 0, 0.1);
}

/* Temporary: instrument-paper.css !important override (remove when SP-133 lands) */
.upgrade-modal { border-radius: 16px !important; box-shadow: 0 32px 80px rgba(0,0,0,0.28), 0 0 0 1px rgba(0,0,0,0.04) !important; }
.upgrade-modal-close { border-radius: 50% !important; transition: background 0.12s, color 0.12s !important; }
.upgrade-badge { border-radius: 20px !important; }
.upgrade-check-icon { border-radius: 50% !important; }
.upgrade-cta-btn { border-radius: 8px !important; transition: background 0.15s !important; }
.upgrade-email-input { border-radius: 8px !important; transition: border-color 0.15s !important; }
.upgrade-referral-input { border-radius: 6px !important; transition: border-color 0.15s !important; }

/* Narrow viewports — constrain card content */
@media (max-width: 480px) {
  .upgrade-modal {
    padding: 1.25rem 1rem 1.25rem;
    margin: 0.5rem;
  }
  .upgrade-headline {
    font-size: 1.15rem;
  }
  .upgrade-sub {
    font-size: 0.82rem;
  }
  .upgrade-price {
    font-size: 2rem;
  }
  .upgrade-cta-btn {
    font-size: 0.9rem;
    padding: 0.75rem 1rem;
  }
}

/* Mobile — matches checkout-panel mobile behavior */
@media (max-width: 400px) {
  .upgrade-modal {
    border-radius: 20px 20px 0 0;
    margin: 0;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 100%;
    padding: 1.5rem 1.25rem 2rem;
  }
  .upgrade-modal-overlay {
    align-items: flex-end;
  }
}

/* ============================================
   Anonymous Account Banner
   Compact strip at the bottom of the control panel,
   below Dev Tools — just the CTA + dismiss.
   ============================================ */

.anon-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border-top: 1px solid var(--border-default, #e8e8e8);
  flex-shrink: 0;
  margin-top: auto; /* push to bottom if parent is flex column */
}

.anon-banner-cta {
  flex: 1;
  background: transparent;
  color: #DD5100;
  border: 1px solid rgba(221, 81, 0, 0.35);
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: background 0.12s, border-color 0.12s;
  white-space: nowrap;
}
.anon-banner-cta:hover {
  background: rgba(221, 81, 0, 0.07);
  border-color: #DD5100;
}

.anon-banner-dismiss {
  background: none;
  border: none;
  color: #bbb;
  font-size: 15px;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
  flex-shrink: 0;
  transition: color 0.12s;
}
.anon-banner-dismiss:hover {
  color: #888;
}

/* ============================================
   "Not right now" — faint dismiss link in CTA hero panel
   ============================================ */

.cta-not-now {
  display: block;
  background: none;
  border: none;
  font-size: 12px;
  color: var(--text-secondary, #aaa);
  cursor: pointer;
  padding: 0.5rem 0 0;
  margin: 0 auto;
  font-family: inherit;
  transition: color 0.15s;
  text-align: center;
  width: 100%;
}
.cta-not-now:hover {
  color: var(--text-primary, #666);
}
[data-theme="light"] .cta-not-now,
[data-theme="default"] .cta-not-now,
[data-theme="instrument-paper"] .cta-not-now {
  color: #bbb;
}
[data-theme="light"] .cta-not-now:hover,
[data-theme="default"] .cta-not-now:hover,
[data-theme="instrument-paper"] .cta-not-now:hover {
  color: #888;
}
