:root {
  --bg-primary: #1e1e2f;
  --bg-secondary: #121221;
  --bg-tertiary: #2a2a3e;
  --bg-card: #2c2c3f;
  --accent: #2cab37;
  --accent-hover: #28a832;
  --accent-glow: rgba(42, 171, 55, 0.3);
  --text-primary: #fff;
  --text-secondary: #ddd;
  --text-muted: #aaa;
  --text-faded: #888;
  --border-subtle: rgba(255, 255, 255, 0.1);
  --gold: #ffd700;
  --error: #ff6b6b;
  --cyan: #00ffcc;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 50%;
}

* { box-sizing: border-box; }

body {
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
  background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 50%, #2d1b69 100%);
  color: var(--text-primary);
  margin: 0;
  padding: 0;
  min-height: 100vh;
  animation: bodyFadeIn 0.4s ease-out;
}

@keyframes bodyFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

h1 {
  font-size: 1.4em;
  margin-bottom: 0.75em;
  text-align: center;
}

h2 {
  font-size: 1.3em;
  color: var(--gold);
  margin-bottom: 0.5em;
}

.gradient-text {
  background: linear-gradient(45deg, var(--accent), #64ffda);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.container {
  max-width: 420px;
  margin: 0 auto;
  padding: 1em;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.form-group { margin-bottom: 1.5em; }

label {
  display: block;
  font-size: 1em;
  font-weight: 600;
  margin-bottom: 0.5em;
  color: var(--text-secondary);
}

input[type="date"],
input[type="time"],
input[type="text"],
input[type="number"],
textarea {
  width: 100%;
  font-size: 1em;
  padding: 0.8em;
  border-radius: var(--radius-md);
  border: 2px solid #444;
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  transition: border-color 0.3s;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
}

/* Date input with placeholder for iOS only */
.date-input-wrapper {
  position: relative;
}

.date-input-wrapper .date-placeholder {
  display: none;
}

@supports (-webkit-touch-callout: none) {
  .date-input-wrapper .date-placeholder {
    display: block;
    position: absolute;
    left: 0.8em;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    z-index: 2;
  }

  .date-input-wrapper input[type="date"]:valid + .date-placeholder,
  .date-input-wrapper input[type="date"]:focus + .date-placeholder {
    display: none;
  }
}

.btn {
  padding: 0.8em 1.5em;
  font-size: 1em;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: white;
  box-shadow: 0 2px 10px var(--accent-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px var(--accent-glow);
}

.btn-primary:disabled {
  background: #666;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-icon {
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  border: none;
  border-radius: var(--radius-full);
  width: 44px;
  height: 44px;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  box-shadow: 0 2px 10px var(--accent-glow);
  flex-shrink: 0;
}

.btn-icon:hover { transform: translateY(-2px); }

.btn-icon:disabled {
  background: #666;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.card {
  background-color: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 1.5em;
  margin: 1em 0;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
  text-align: center;
}

.card .stars {
  color: var(--text-muted);
  margin-bottom: 1em;
}

.info-text {
  font-size: 0.9em;
  color: var(--text-faded);
  margin-top: 0.3em;
}

.derived-value {
  font-size: 0.9em;
  color: var(--text-secondary);
  margin-top: 0.5em;
  padding: 0.5em;
  background: rgba(42, 171, 55, 0.1);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent);
}

.derived-value span {
  color: var(--accent);
  font-weight: 500;
}

.balance-display {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(18, 18, 33, 0.95);
  backdrop-filter: blur(10px);
  padding: 0.6rem 1rem;
  text-align: right;
  font-weight: bold;
  color: var(--cyan);
  font-size: 0.9em;
  border-bottom: 1px solid var(--border-subtle);
}

.loading {
  text-align: center;
  color: var(--accent);
  padding: 1rem;
}

.loading.hidden { display: none; }

.location-group {
  display: flex;
  gap: 0.5em;
}

.location-group input { flex: 1; }

.description {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 1.5em;
  line-height: 1.5;
}

/* Chat layout */
.chat-layout {
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
}

.header-buttons {
  position: absolute;
  top: 50%;
  left: 1rem;
  transform: translateY(-50%);
  z-index: 100;
  display: flex;
  flex-direction: row;
  gap: 0.5rem;
  align-items: center;
}

.header-buttons button {
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  background: rgba(42, 42, 62, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  font-size: 1.4rem;
  position: static;
  margin: 0;
  padding: 0;
}

.header-buttons button:hover {
  background: rgba(42, 171, 55, 0.2);
  border-color: var(--accent);
}

.header-buttons button svg {
  width: 20px;
  height: 20px;
}

.chat-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 280px;
  height: 100vh;
  background: rgba(30, 30, 47, 0.98);
  backdrop-filter: blur(10px);
  border-right: 1px solid var(--border-subtle);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
}

.chat-sidebar.open {
  transform: translateX(0);
}

.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 900;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.sidebar-overlay.visible {
  opacity: 1;
  visibility: visible;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  padding-top: max(1rem, env(safe-area-inset-top));
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
  background: rgba(30, 30, 47, 1);
  color: var(--text-primary);
}

.sidebar-header span {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-primary);
}

.sidebar-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.sidebar-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.history-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
}

.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.chat-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(30, 30, 47, 0.95);
  backdrop-filter: blur(10px);
  padding: 1rem;
  padding-left: 7rem;
  padding-right: 1rem;
  text-align: center;
  border-bottom: 1px solid var(--border-subtle);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.chat-header h1 {
  margin: 0;
  font-size: 1.4rem;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  margin: 0.25rem;
  transition: all 0.2s ease;
}

.history-item:hover {
  background: rgba(42, 171, 55, 0.1);
  border-color: rgba(42, 171, 55, 0.3);
}

.history-item.active {
  background: rgba(42, 171, 55, 0.2);
  border-color: var(--accent);
}

.history-item-content {
  flex: 1;
  min-width: 0;
  cursor: pointer;
}

.history-item-delete {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  opacity: 0.5;
}

.history-item:hover .history-item-delete {
  opacity: 1;
}

.history-item-delete:hover {
  background: rgba(255, 107, 107, 0.2);
  color: var(--error);
}

.history-question {
  font-size: 0.85rem;
  color: var(--text-primary);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-preview {
  font-size: 0.75rem;
  color: var(--text-faded);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 0.25rem;
}

.thread-info {
  font-size: 0.65rem;
  color: var(--accent);
  margin-top: 0.25rem;
  font-weight: 500;
}

.chat-messages {
  flex: 1;
  padding: 1rem;
  padding-top: 0.5rem;
  overflow-y: auto;
}

.message {
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  animation: fadeIn 0.3s ease;
}

.message.user { align-items: flex-end; }
.message.assistant { align-items: flex-start; }

.message-content {
  max-width: 80%;
  padding: 0.75rem 1rem;
  border-radius: 16px;
  word-wrap: break-word;
  line-height: 1.4;
}

.message.user .message-content {
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: white;
  border-bottom-right-radius: 6px;
}

.message.assistant .message-content {
  background: rgba(42, 42, 62, 0.8);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  border-bottom-left-radius: 6px;
}

.message-time {
  font-size: 0.7rem;
  color: var(--text-faded);
  margin-top: 0.25rem;
  padding: 0 0.5rem;
}

.message-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.25rem;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.message:hover .message-actions {
  opacity: 1;
}

.copy-btn {
  background: transparent;
  border: none;
  color: var(--text-faded);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  transition: all 0.2s ease;
}

.copy-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.1);
}

.copy-btn.copied {
  color: var(--accent);
}

.copy-btn svg {
  width: 14px;
  height: 14px;
}

.chat-input-wrapper {
  background: rgba(30, 30, 47, 0.9);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--border-subtle);
  padding-bottom: 60px;
}

.chat-cost-hint {
  text-align: center;
  font-size: 0.75rem;
  color: var(--gold);
  padding: 0.4rem 1rem 0;
  display: none;
}

.chat-input {
  padding: 0.75rem 1rem 1rem;
  display: flex;
  gap: 0.75rem;
  align-items: flex-end;
}

.chat-input textarea {
  flex: 1;
  min-height: 44px;
  max-height: 120px;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border-subtle);
  border-radius: 22px;
  resize: none;
}

.chat-input textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(42, 171, 55, 0.1);
}

.empty-state {
  text-align: center;
  padding: 2rem;
  color: var(--text-faded);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.typing-indicator {
  color: var(--accent);
  font-style: italic;
}

.typing-indicator::after {
  content: '';
  animation: typingDots 1.5s infinite;
}

@keyframes typingDots {
  0%, 20% { content: ''; }
  40% { content: '.'; }
  60% { content: '..'; }
  80%, 100% { content: '...'; }
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.05); }
::-webkit-scrollbar-thumb { background: rgba(42, 171, 55, 0.3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(42, 171, 55, 0.5); }

@media (max-width: 480px) {
  h1 { font-size: 1.2rem; }
  .message-content { max-width: 90%; }
  .chat-sidebar { width: 100%; }
}

/* Subscription styles */
.subscription-section {
  margin-bottom: 1rem;
}

.subscription-card {
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(44, 44, 63, 0.8) 100%);
  border-radius: var(--radius-lg);
  padding: 1rem;
  position: relative;
  border: 2px solid var(--border-subtle);
  text-align: center;
}

.subscription-card.subscription-active {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(42, 171, 55, 0.1) 0%, var(--bg-card) 100%);
}

.subscription-card.subscription-expired {
  border-color: var(--error);
  background: linear-gradient(135deg, rgba(255, 107, 107, 0.1) 0%, var(--bg-card) 100%);
}

.subscription-card.subscription-inactive {
  border-color: var(--gold);
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.05) 0%, var(--bg-card) 100%);
}

.subscription-badge {
  position: absolute;
  top: -10px;
  right: 20px;
  background: var(--accent);
  color: white;
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.subscription-badge.expired {
  background: var(--error);
}

.subscription-card h3 {
  color: var(--gold);
  margin: 0 0 0.3rem 0;
  font-size: 1.1rem;
}

.subscription-price {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0.3rem 0;
}

.subscription-price .price-original {
  text-decoration: line-through;
  color: var(--text-muted);
  font-size: 1rem;
  margin-right: 0.5rem;
}

.subscription-price .price-discounted {
  color: var(--accent);
}

.subscription-discount-info {
  color: var(--accent);
  font-size: 0.9rem;
  margin: 0.3rem 0 0.5rem;
  padding: 0.3rem 0.6rem;
  background: rgba(138, 43, 226, 0.15);
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.subscription-chat-limit {
  color: var(--text-primary);
  font-size: 0.95rem;
  margin: 0.5rem 0;
  padding: 0.4rem 0.6rem;
  background: rgba(76, 175, 80, 0.15);
  border-radius: var(--radius-sm);
  display: inline-block;
}

.subscription-chat-limit.usage-low {
  background: rgba(255, 152, 0, 0.2);
  color: #ffa726;
}

.upgrade-section {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.upgrade-hint {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin: 0 0 0.5rem 0;
}

.btn-upgrade {
  width: 100%;
}

.tier-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin: 0.75rem 0;
}

.tier-card {
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tier-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

.tier-card.selected {
  border-color: var(--accent);
  background: rgba(138, 43, 226, 0.1);
}

.tier-card h4 {
  margin: 0 0 0.3rem 0;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.tier-price {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gold);
  margin: 0 0 0.5rem 0;
}

.tier-features {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.tier-features li {
  margin-bottom: 0.2rem;
}

.billing-toggle {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.billing-btn {
  flex: 1;
  padding: 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.billing-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.billing-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.discount-badge {
  background: var(--gold);
  color: #1a1a2e;
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  font-size: 0.7rem;
  font-weight: 600;
  margin-left: 0.25rem;
}

.info-tooltip {
  position: relative;
  display: inline-flex;
  cursor: pointer;
}

.info-tooltip-icon {
  font-size: 0.85rem;
  opacity: 0.8;
}

.info-tooltip-text {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #2a2a3e;
  color: #e0e0e0;
  font-size: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 100;
  transition: opacity 0.2s, visibility 0.2s;
  max-width: 250px;
  white-space: normal;
  text-align: center;
}

.info-tooltip-text::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #2a2a3e;
}

.info-tooltip:hover .info-tooltip-text,
.info-tooltip:focus .info-tooltip-text,
.info-tooltip:active .info-tooltip-text {
  visibility: visible;
  opacity: 1;
}

.subscription-benefits {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0;
  text-align: left;
}

.subscription-benefits li {
  padding: 0.2rem 0;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.subscription-expires {
  color: var(--text-secondary);
  margin: 0.5rem 0;
}

.subscription-expires strong {
  color: var(--accent);
}

.subscription-info {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0.5rem 0;
}

.subscription-warning {
  color: var(--gold);
  font-size: 0.9rem;
  margin: 0.5rem 0;
  padding: 0.5rem;
  background: rgba(255, 215, 0, 0.1);
  border-radius: var(--radius-sm);
}

.subscription-expired-text {
  color: var(--error);
  margin: 0.5rem 0;
}

.subscription-balance-hint {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0.5rem 0 1rem 0;
}

.btn-subscribe {
  margin-top: 0.75rem;
  background: linear-gradient(135deg, var(--gold), #ffaa00);
  color: #1e1e2f;
}

.btn-subscribe:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.btn-cancel {
  margin-top: 1rem;
  background: transparent;
  border: 1px solid var(--text-muted);
  color: var(--text-muted);
}

.btn-cancel:hover {
  border-color: var(--error);
  color: var(--error);
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--text-muted);
  color: var(--text-muted);
}

.btn-secondary:hover {
  border-color: var(--text-primary);
  color: var(--text-primary);
}

/* Energy section styles */
.energy-section {
  margin-top: 1rem;
}

.energy-section h2 {
  text-align: center;
  margin-bottom: 0.3rem;
  font-size: 1.1rem;
}

.energy-section .description {
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
}

.energy-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.energy-grid .card {
  margin: 0;
  padding: 0.75rem 0.5rem;
}

.energy-grid .card h3 {
  font-size: 0.95rem;
  margin-bottom: 0.2rem;
}

.energy-grid .card .stars {
  font-size: 0.75rem;
  margin-bottom: 0.5rem;
}

.energy-grid .card .btn {
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
}

.custom-card {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.75rem !important;
}

.custom-card h3 {
  margin-bottom: 0.3rem;
  font-size: 0.95rem;
}

.custom-card input {
  text-align: center;
  padding: 0.5rem;
}

.custom-card .btn {
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
}

@media (max-width: 400px) {
  .energy-grid {
    grid-template-columns: 1fr;
  }
}

/* Chart view styles */
.chart-layout {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

.chart-header {
  background: rgba(30, 30, 47, 0.9);
  backdrop-filter: blur(10px);
  padding: 1rem;
  text-align: center;
  border-bottom: 1px solid var(--border-subtle);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.chart-header h1 {
  margin: 0;
  font-size: 1.4rem;
}

.chart-content {
  flex: 1;
  padding: 1rem;
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
}

.chart-image-section {
  margin-bottom: 1rem;
}

.chart-image-container {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 0.5rem;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.chart-image {
  width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  display: block;
}

.chart-placeholder {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  color: var(--text-faded);
  border: 2px dashed var(--border-subtle);
}

.placeholder-icon {
  font-size: 3rem;
  margin-bottom: 0.5rem;
  opacity: 0.5;
}

.chart-actions {
  margin-bottom: 1rem;
}

.chart-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.chart-btn {
  padding: 1rem;
  font-size: 1rem;
}

.chart-btn:disabled {
  background: rgba(42, 171, 55, 0.2);
  color: var(--accent);
  cursor: default;
  transform: none;
  box-shadow: none;
}

.chart-hint {
  text-align: center;
  color: var(--gold);
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

.description-section {
  margin-bottom: 1rem;
}

.description-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.description-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.05);
  transition: background 0.2s ease;
}

.description-header:hover {
  background: rgba(42, 171, 55, 0.1);
}

.description-title {
  font-weight: 600;
  color: var(--text-primary);
}

.description-toggle {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.description-content {
  padding: 1rem;
  border-top: 1px solid var(--border-subtle);
  max-height: 500px;
  overflow-y: auto;
  transition: max-height 0.3s ease, padding 0.3s ease;
}

.description-card.collapsed .description-content {
  max-height: 0;
  padding: 0 1rem;
  overflow: hidden;
}

.description-text {
  color: var(--text-secondary);
  line-height: 1.7;
  font-size: 0.95rem;
}

.description-text h1,
.description-text h2 {
  font-size: 1.2rem;
  color: var(--gold);
  margin: 1.2rem 0 0.5rem 0;
  font-weight: 600;
}

.description-text h3 {
  font-size: 1.1rem;
  color: var(--accent);
  margin: 1rem 0 0.4rem 0;
  font-weight: 600;
}

.description-text h4 {
  font-size: 1rem;
  color: var(--text-primary);
  margin: 0.8rem 0 0.3rem 0;
  font-weight: 600;
}

.description-text h5,
.description-text h6 {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin: 0.6rem 0 0.25rem 0;
  font-weight: 600;
}

.description-text p {
  margin: 0.6rem 0;
}

.description-text ul,
.description-text ol {
  margin: 0.5rem 0;
  padding-left: 1.5rem;
}

.description-text li {
  padding: 0.2rem 0;
  color: var(--text-secondary);
}

.description-text ul li::marker {
  color: var(--accent);
}

.description-text ol li::marker {
  color: var(--accent);
}

.description-text strong {
  color: var(--text-primary);
  font-weight: 600;
}

.description-text em {
  color: var(--cyan);
  font-style: italic;
}

.description-text blockquote {
  border-left: 3px solid var(--accent);
  margin: 0.8rem 0;
  padding: 0.5rem 1rem;
  background: rgba(42, 171, 55, 0.1);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.description-text code {
  background: rgba(255, 255, 255, 0.1);
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  font-size: 0.9em;
}

.description-text hr {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin: 1rem 0;
}

.description-actions {
  margin-top: 0.5rem;
  display: flex;
  justify-content: flex-start;
}

.description-actions .message-actions {
  opacity: 0;
  transition: opacity 0.2s ease;
}

.description-content:hover .description-actions .message-actions {
  opacity: 1;
}

.loading-state {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 3rem;
  color: var(--accent);
}

.no-birth-data-message {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  color: var(--text-secondary);
}

.no-birth-data-message ul {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
}

.no-birth-data-message li {
  padding: 0.3rem 0;
  color: var(--text-muted);
}

.no-birth-data-message li::before {
  content: "• ";
  color: var(--accent);
}

/* Service prices list */
.services-price-list {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1rem;
  margin-bottom: 1rem;
}

.services-price-list h3 {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
  text-align: center;
}

.services-grid {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.service-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-sm);
}

.service-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.service-item-highlight {
  background: rgba(42, 171, 55, 0.1);
  border: 1px solid rgba(42, 171, 55, 0.2);
}

.service-item-highlight:hover {
  background: rgba(42, 171, 55, 0.15);
}

.service-name {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.service-price {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--gold);
}

.service-price small {
  font-size: 0.75rem;
  color: var(--accent);
}

/* Energy section improvements */
.energy-note {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.energy-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 1rem;
  text-align: center;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

.energy-amount {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.2rem;
}

.energy-stars {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.energy-card .btn {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
}

.custom-energy-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 1rem;
  text-align: center;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
  margin-top: 0.75rem;
}

.custom-energy-card h3 {
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.custom-energy-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.custom-energy-row input {
  flex: 2;
  text-align: center;
  min-width: 0;
}

.custom-energy-row .btn {
  flex: 1;
  padding: 0.75rem 1rem;
  white-space: nowrap;
}

/* Pay container */
.pay-container {
  padding-top: 40px;
}

/* Price hint in views */
.price-hint {
  font-size: 0.85rem;
  color: var(--gold);
  margin-top: 0.5rem;
}

/* Subscription autopay note */
.subscription-autopay-note {
  font-size: 0.8rem;
  color: var(--text-faded);
  margin-top: 0.75rem;
}

.subscription-autopay-status {
  color: var(--accent);
  font-size: 0.9rem;
  margin: 0.5rem 0;
}

.subscription-cancel-hint {
  font-size: 0.8rem;
  color: var(--text-faded);
  margin-top: 0.25rem;
}

/* Insufficient balance error */
.insufficient-balance-error {
  background: rgba(255, 107, 107, 0.1);
  border: 1px solid var(--error);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  text-align: center;
  margin: 1rem 0;
}

.insufficient-balance-error .error-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.insufficient-balance-error .error-text {
  color: var(--text-primary);
  margin-bottom: 1rem;
  line-height: 1.5;
  white-space: pre-line;
}

.insufficient-balance-error .top-up-btn {
  display: inline-block;
  text-decoration: none;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
}

/* Error popup */
.error-popup {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.error-popup.visible {
  opacity: 1;
  visibility: visible;
}

.error-popup-content {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 2rem;
  max-width: 90%;
  width: 360px;
  text-align: center;
  position: relative;
  border: 1px solid var(--error);
}

.error-popup-close {
  position: absolute;
  top: 0.5rem;
  right: 0.75rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem;
}

.error-popup-close:hover {
  color: var(--text-primary);
}

.error-popup-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.error-popup-message {
  color: var(--text-primary);
  line-height: 1.6;
  margin-bottom: 1.5rem;
  white-space: pre-line;
}

/* Balance popup (common component) */
.balance-popup {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.balance-popup.visible {
  opacity: 1;
  visibility: visible;
}

.balance-popup-content {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 2rem;
  max-width: 90%;
  width: 360px;
  text-align: center;
  position: relative;
  border: 1px solid var(--error);
}

.balance-popup-close {
  position: absolute;
  top: 0.5rem;
  right: 0.75rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem;
}

.balance-popup-close:hover {
  color: var(--text-primary);
}

.balance-popup-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.balance-popup-message {
  color: var(--text-primary);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

/* Synastry styles */
.zodiac-badge {
  background: var(--bg-tertiary);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
}
.synastry-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 20px;
}

.synastry-profile-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.synastry-profile-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.synastry-profile-card.expanded {
  border-color: var(--cyan);
}

.synastry-profile-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

.synastry-profile-header:hover {
  background: var(--bg-secondary);
}

.synastry-profile-card .profile-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.synastry-profile-card .profile-name {
  font-weight: 600;
  color: var(--text-primary);
}

.synastry-profile-card .profile-alias {
  font-size: 0.85em;
  color: var(--text-muted);
}

.synastry-profile-card .profile-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.synastry-expand-icon {
  color: var(--text-muted);
  font-size: 0.8em;
  transition: transform 0.2s ease;
}

.synastry-profile-content {
  padding: 1rem;
  border-top: 1px solid var(--border-subtle);
  text-align: left;
}

.synastry-profile-content.collapsed {
  display: none;
}

.synastry-container .card .synastry-profile-content,
.synastry-container .card .synastry-result-inline,
.synastry-container .card .synastry-description,
.synastry-container .card .synastry-description p {
  text-align: left;
}

.synastry-payment {
  padding: 1rem 0;
}

.synastry-payment-hint {
  color: var(--text-muted);
  font-size: 0.9em;
  margin-bottom: 1rem;
}

.synastry-container .empty-state {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
}

.synastry-container .empty-state p {
  margin-bottom: 1rem;
}

.synastry-header {
  margin-bottom: 1.5rem;
}

.synastry-names {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.synastry-names .name {
  font-size: 1.1em;
  font-weight: 600;
  color: var(--text-primary);
}

.synastry-names .heart {
  font-size: 1.5rem;
}

.synastry-score {
  display: inline-flex;
  align-items: baseline;
  gap: 0.25rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-lg);
  margin-bottom: 0.5rem;
}

.synastry-score.high {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
}

.synastry-score.medium {
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
}

.synastry-score.low {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.synastry-score .score-value {
  font-size: 2rem;
  font-weight: bold;
}

.synastry-score .score-label {
  font-size: 1rem;
  opacity: 0.7;
}

.score-description {
  color: var(--text-secondary);
  font-size: 0.95em;
}

.destiny-badge {
  display: inline-block;
  margin-top: 0.75rem;
  padding: 0.5rem 1rem;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(236, 72, 153, 0.2));
  border: 1px solid rgba(168, 85, 247, 0.3);
  border-radius: var(--radius-md);
  color: #c084fc;
  font-size: 0.9em;
}

.synastry-chart {
  margin: 1.5rem 0;
  text-align: center;
}

.synastry-chart img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
}

.synastry-description {
  line-height: 1.7;
  color: var(--text-secondary);
  position: relative;
  text-align: left;
}

.synastry-description p {
  margin-bottom: 1rem;
}

.synastry-description .message-actions {
  margin-top: 0.5rem;
  opacity: 1;
}

.synastry-description .copy-btn {
  background: var(--bg-tertiary);
  padding: 0.5rem;
  border-radius: var(--radius-sm);
}


.synastry-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.synastry-actions .btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.synastry-actions .btn svg {
  width: 16px;
  height: 16px;
}

.synastry-actions .btn.copied {
  color: var(--accent);
  border-color: var(--accent);
}

/* App layout with tabs */
.app-layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(18, 18, 33, 0.95);
  backdrop-filter: blur(10px);
  padding: 0.6rem 1rem;
  text-align: right;
  font-weight: bold;
  color: var(--cyan);
  font-size: 0.9em;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.header-balance {
  display: inline-block;
}

.view-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 70px;
}

.tab-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-around;
  background: rgba(18, 18, 33, 0.98);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--border-subtle);
  padding: 0.5rem 0;
  padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
}

.tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.7rem;
  padding: 0.4rem 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 60px;
}

.tab-item:hover {
  color: var(--text-secondary);
}

.tab-item.active {
  color: var(--accent);
}

.tab-item.active .tab-icon {
  transform: scale(1.1);
}

.tab-icon {
  font-size: 1.4rem;
  line-height: 1;
  transition: transform 0.2s ease;
}

.tab-label {
  font-weight: 500;
}

/* Astro Profile Widget */
.astro-profile {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1rem;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.4);
}

.astro-profile-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 1.5rem;
}

.astro-profile-empty .empty-profile-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  opacity: 0.6;
}

.astro-profile-empty p {
  margin: 0;
  font-size: 0.9rem;
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #8b5cf6, #ec4899);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  flex-shrink: 0;
}

.profile-info {
  flex: 1;
  min-width: 0;
}

.profile-name {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.profile-info-row {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.planetary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.planet-card {
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm);
  padding: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid var(--border-subtle);
  transition: border-color 0.2s ease;
  min-width: 0;
}

.planet-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

.planet-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.planet-details {
  flex: 1;
  min-width: 0;
}

.planet-name {
  font-size: 0.6rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-bottom: 0.1rem;
}

.planet-sign {
  font-size: 0.85rem;
  color: var(--text-primary);
  font-weight: 600;
}

.planet-card.has-description {
  cursor: pointer;
  position: relative;
}

.planet-card.has-description:hover {
  background-color: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.25);
}

.planet-expand-icon {
  font-size: 0.55rem;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.planet-description {
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  border-left: 2px solid #8b5cf6;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.3s ease, margin 0.3s ease, padding 0.3s ease;
  max-height: 300px;
  opacity: 1;
}

.planet-description.collapsed {
  max-height: 0;
  opacity: 0;
  padding: 0 1rem;
  margin-top: 0;
}

.planet-description-text {
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.key-insight {
  background: rgba(100, 100, 140, 0.15);
  border-left: 3px solid #8b5cf6;
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1.25rem;
}

.key-insight-content {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.key-insight-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.key-insight-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.key-insight-text strong {
  color: var(--text-primary);
}

.numerology-row {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 1rem;
}

.numerology-item {
  text-align: center;
  flex: 1;
}

.numerology-number {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 3.5rem;
  font-weight: 600;
  color: var(--gold);
  line-height: 1;
  margin-bottom: 0.5rem;
  font-style: italic;
}

.numerology-label {
  font-size: 0.6rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1.3;
}

.numerology-section {
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
}

.numerology-item.empty .numerology-number {
  color: var(--text-muted);
  opacity: 0.5;
}

.numerology-item.empty .numerology-label {
  opacity: 0.5;
}

.numerology-item.has-description {
  cursor: pointer;
  transition: background-color 0.2s ease;
  border-radius: 8px;
  padding: 0.5rem;
  margin: -0.5rem;
  position: relative;
}

.numerology-item.has-description:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

.numerology-expand-icon {
  font-size: 0.6rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  transition: transform 0.2s ease;
}

.numerology-description {
  margin-top: 1rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  border-left: 2px solid var(--gold);
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.3s ease, margin 0.3s ease;
  max-height: 500px;
  opacity: 1;
}

.numerology-description.collapsed {
  max-height: 0;
  opacity: 0;
  padding: 0 1rem;
  margin-top: 0;
}

.numerology-description-text {
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

@media (max-width: 400px) {
  .planetary-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .profile-avatar {
    width: 52px;
    height: 52px;
    font-size: 1.4rem;
  }

  .profile-name {
    font-size: 1.1rem;
  }

  .numerology-number {
    font-size: 2.5rem;
  }

  .numerology-label {
    font-size: 0.55rem;
  }
}

/* Profile sidebar and modal styles */
.profile-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 280px;
  height: 100vh;
  background: rgba(30, 30, 47, 0.98);
  backdrop-filter: blur(10px);
  border-right: 1px solid var(--border-subtle);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
}

.profile-sidebar.open {
  transform: translateX(0);
}

.profile-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
}

.profile-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background-color 0.2s ease;
  margin-bottom: 0.25rem;
  position: relative;
}

.profile-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.profile-item.active {
  background: rgba(42, 171, 55, 0.15);
  border: 1px solid var(--accent);
}

.profile-item-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #8b5cf6, #ec4899);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.profile-item-info {
  flex: 1;
  min-width: 0;
}

.profile-item-name {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-item-zodiac {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.profile-item-actions {
  display: flex;
  gap: 0.25rem;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.profile-item:hover .profile-item-actions {
  opacity: 1;
}

.profile-item-edit,
.profile-item-delete {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  transition: all 0.2s ease;
  opacity: 0;
}

.profile-item:hover .profile-item-edit,
.profile-item:hover .profile-item-delete {
  opacity: 1;
}

.profile-item-edit:hover {
  color: var(--accent);
  background: rgba(42, 171, 55, 0.1);
}

.profile-item-delete {
  font-size: 1.1rem;
}

.profile-item-delete:hover {
  color: var(--error);
  background: rgba(255, 107, 107, 0.2);
}

.add-profile-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  padding-bottom: max(1rem, env(safe-area-inset-bottom));
  background: rgba(30, 30, 47, 1);
  border: none;
  border-top: 1px solid var(--border-subtle);
  color: var(--accent);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.add-profile-btn:hover:not(:disabled) {
  background: rgba(42, 171, 55, 0.15);
}

.add-profile-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  color: var(--text-muted);
}

.chart-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.chart-main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.chart-header {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  gap: 0.5rem;
  background: rgba(18, 18, 33, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 50;
}

.chart-header h1 {
  flex: 1;
  text-align: center;
  margin: 0;
  font-size: 1.1rem;
}

.chart-content {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
}

/* Profile modal */
.profile-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.profile-modal-content {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  max-width: 400px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  border: 1px solid var(--border-subtle);
}

.profile-modal-content h2 {
  margin: 0 0 1.25rem;
  font-size: 1.25rem;
  color: var(--text-primary);
  text-align: center;
}

.profile-modal-content .form-group {
  margin-bottom: 1rem;
}

.profile-modal-content label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.profile-modal-content input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.95rem;
}

.profile-modal-content input:focus {
  outline: none;
  border-color: var(--accent);
}

.profile-modal-content input::placeholder {
  color: var(--text-muted);
}

.form-row {
  display: flex;
  gap: 0.75rem;
}

.form-group.half {
  flex: 1;
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.form-actions .btn {
  flex: 1;
}

.btn-secondary {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.form-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Profile page tabs */
.profile-container {
  padding-bottom: 2rem;
}

.profile-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

.profile-tab {
  padding: 0.5rem 0.75rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.profile-tab:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.profile-tab.active {
  background: rgba(42, 171, 55, 0.15);
  border-color: var(--accent);
  color: var(--accent);
}

.profile-tab.add-tab {
  background: transparent;
  border-style: dashed;
  color: var(--accent);
}

.profile-tab.add-tab:hover {
  background: rgba(42, 171, 55, 0.1);
}

.profile-tab.add-tab.active {
  background: rgba(42, 171, 55, 0.15);
  border-style: solid;
}

.profile-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.profile-actions .btn {
  flex: 1;
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid var(--error);
  color: var(--error);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
}

/* Profile page layout (same as chart) */
.profile-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.profile-main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.profile-header {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  gap: 0.5rem;
  background: rgba(18, 18, 33, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 50;
}

.profile-header h1 {
  flex: 1;
  text-align: center;
  margin: 0;
  font-size: 1.1rem;
}

.profile-content {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
}

/* Profile indicator in chat header */
.profile-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.35rem 0.75rem;
  background: rgba(42, 171, 55, 0.1);
  border: 1px solid var(--accent);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  margin-top: 0.5rem;
}

.profile-indicator:hover {
  background: rgba(42, 171, 55, 0.2);
}

.profile-indicator-label {
  color: var(--text-muted);
}

.profile-indicator-name {
  color: var(--accent);
  font-weight: 500;
}

.chat-header .header-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}

.chat-header .header-title h1 {
  margin: 0;
}

.chat-usage-indicator {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

.chat-usage-indicator .usage-count,
.chat-usage-indicator .usage-unlimited {
  padding: 0.2rem 0.5rem;
  background: rgba(76, 175, 80, 0.2);
  border-radius: var(--radius-sm);
  color: #81c784;
}

.chat-usage-indicator .usage-count.usage-low {
  background: rgba(255, 152, 0, 0.2);
  color: #ffa726;
}

.chat-usage-indicator .usage-unlimited {
  background: rgba(138, 43, 226, 0.2);
  color: var(--accent);
}

.chat-limit-error {
  text-align: center;
  padding: 1rem;
}

.chat-limit-error .error-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.chat-limit-error .error-text {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.chat-limit-error .error-hint {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

/* Google Places Autocomplete dropdown styling */
.pac-container {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  font-family: inherit;
  z-index: 400;
}

.pac-item {
  padding: 0.6rem 0.75rem;
  cursor: pointer;
  color: var(--text-secondary);
  border-top: 1px solid var(--border-subtle);
}

.pac-item:first-child {
  border-top: none;
}

.pac-item:hover {
  background-color: rgba(255, 255, 255, 0.08);
}

.pac-item-selected,
.pac-item-selected:hover {
  background-color: rgba(42, 171, 55, 0.15);
}

.pac-icon {
  display: none;
}

.pac-item-query {
  color: var(--text-primary);
  font-weight: 500;
}

.pac-matched {
  font-weight: 600;
}

@media (max-width: 480px) {
  .profile-sidebar {
    width: 100%;
  }
}
