/* =====================================================
   Зелёный Нефрит — Inner App (Dashboard, Auth, Chat)
   ===================================================== */

/* ============ Base reset & typography ============ */
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: #2C3E2D;
  background: #FAF7F0;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5, h6 {
  font-family: 'Cormorant Garamond', 'Philosopher', Georgia, serif;
  color: #0F4C3A;
  margin: 0 0 12px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* ============ Buttons ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 12px;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  line-height: 1.2;
  white-space: nowrap;
}
.btn:disabled, .btn[disabled] { opacity: 0.55; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, #0F4C3A 0%, #1B6B4F 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(15, 76, 58, 0.25);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(15, 76, 58, 0.35);
}

.btn-gold {
  background: linear-gradient(135deg, #D4AF37 0%, #E5C158 100%);
  color: #2A1F0A;
  box-shadow: 0 4px 14px rgba(212, 175, 55, 0.25);
}
.btn-gold:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(212, 175, 55, 0.35);
}

.btn-ghost {
  background: transparent;
  color: #0F4C3A;
  border-color: rgba(15, 76, 58, 0.25);
}
.btn-ghost:hover {
  background: rgba(15, 76, 58, 0.06);
  border-color: rgba(15, 76, 58, 0.4);
}

.btn-outline {
  background: #fff;
  color: #0F4C3A;
  border-color: rgba(15, 76, 58, 0.2);
}
.btn-outline:hover {
  background: #F8FAF7;
  border-color: #0F4C3A;
}

.btn-block { width: 100%; }
.btn-sm { padding: 8px 16px; font-size: 0.875rem; border-radius: 10px; }
.btn-lg { padding: 16px 32px; font-size: 1.05rem; border-radius: 14px; }

/* ============ Form controls ============ */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  color: #2C3E2D;
}
.form-control {
  display: block;
  width: 100%;
  padding: 12px 16px;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  color: #2C3E2D;
  background: #fff;
  border: 1px solid rgba(15, 76, 58, 0.18);
  border-radius: 12px;
  transition: border-color 0.2s, box-shadow 0.2s;
  line-height: 1.4;
}
.form-control:focus {
  outline: none;
  border-color: #0F4C3A;
  box-shadow: 0 0 0 3px rgba(15, 76, 58, 0.1);
}
.form-control::placeholder { color: #9CA89A; }
.form-control:disabled { background: #F4F0E6; cursor: not-allowed; }

textarea.form-control { min-height: 100px; resize: vertical; font-family: inherit; }
select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%230F4C3A' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  color: #4A5A4B;
  cursor: pointer;
}
.form-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #0F4C3A;
  cursor: pointer;
}

/* ============ Auth pages (login/register) ============ */
.auth-page {
  min-height: 100vh;
  background:
    radial-gradient(ellipse at top, rgba(212, 175, 55, 0.08), transparent 60%),
    linear-gradient(180deg, #FAF7F0 0%, #F0E8D5 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
}
.auth-page::before {
  content: '';
  position: absolute;
  top: -100px; right: -100px;
  width: 400px; height: 400px;
  background: url('/assets/decorations/clouds-set.png') center/contain no-repeat;
  opacity: 0.1;
  pointer-events: none;
}
.auth-page::after {
  content: '';
  position: absolute;
  bottom: -120px; left: -80px;
  width: 360px; height: 360px;
  background: url('/assets/decorations/lotus-watercolor.png') center/contain no-repeat;
  opacity: 0.12;
  pointer-events: none;
}

.auth-card {
  background: #fff;
  border-radius: 28px;
  padding: 48px 40px;
  width: 100%;
  max-width: 460px;
  box-shadow: 0 24px 80px rgba(15, 76, 58, 0.12);
  position: relative;
  z-index: 1;
  border: 1px solid rgba(212, 175, 55, 0.15);
}
.auth-card__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  margin-bottom: 28px;
  text-decoration: none;
  color: inherit;
}
.auth-card__logo .logo-mark {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #0F4C3A, #1A6B52);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #D4AF37;
  font-size: 22px;
}
.auth-card__logo .logo-text {
  font-family: 'Cormorant Garamond', serif;
  font-size: 24px;
  color: #0F4C3A;
  font-weight: 600;
}
.auth-card__title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 32px;
  color: #0F4C3A;
  font-weight: 600;
  text-align: center;
  margin-bottom: 8px;
  line-height: 1.2;
}
.auth-card__subtitle {
  text-align: center;
  color: #6b756f;
  margin-bottom: 32px;
  font-size: 15px;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  color: #a8a89c;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 24px 0;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #efe7d8;
}

.auth-social {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}
.auth-social-btn {
  background: #FBF8F1;
  border: 1.5px solid #efe7d8;
  border-radius: 12px;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  color: #4a5550;
  text-decoration: none;
  transition: all 0.2s;
}
.auth-social-btn:hover {
  border-color: #D4AF37;
  background: #fff;
  transform: translateY(-1px);
}
.auth-social-btn i { font-size: 22px; }
.auth-social-btn--yandex i { color: #FC3F1D; }
.auth-social-btn--vk i { color: #0077FF; }
.auth-social-btn--telegram i { color: #29B6F6; }

.auth-footer-link {
  text-align: center;
  font-size: 14px;
  color: #6b756f;
  margin-top: 20px;
}
.auth-footer-link a {
  color: #0F4C3A;
  font-weight: 600;
  text-decoration: none;
}
.auth-footer-link a:hover { text-decoration: underline; }

.auth-legal {
  font-size: 11px;
  color: #a8a89c;
  text-align: center;
  margin-top: 18px;
  line-height: 1.5;
}
.auth-legal a { color: #6b756f; text-decoration: underline; }

/* ============ Dashboard layout ============ */
.app-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
  background: #FAF7F0;
}
@media (max-width: 1024px) {
  .app-shell { grid-template-columns: 1fr; }
}

.app-sidebar {
  background: linear-gradient(180deg, #0F4C3A 0%, #0a3528 100%);
  color: #fff;
  padding: 24px 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
@media (max-width: 1024px) {
  .app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 260px;
    transform: translateX(-100%);
    transition: transform 0.3s;
    z-index: 100;
    box-shadow: 8px 0 32px rgba(0,0,0,0.2);
  }
  .app-sidebar.is-open { transform: translateX(0); }
}

.app-sidebar__logo {
  padding: 0 24px 24px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.15);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
}
.app-sidebar__logo .logo-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(212, 175, 55, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #D4AF37;
}
.app-sidebar__logo .logo-text {
  font-family: 'Cormorant Garamond', serif;
  font-size: 20px;
  font-weight: 600;
}

.sidebar-nav {
  flex: 1;
  padding: 0 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sidebar-nav__section {
  padding: 14px 12px 6px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.4);
  font-weight: 600;
}
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
}
.sidebar-nav a:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}
.sidebar-nav a.is-active {
  background: rgba(212, 175, 55, 0.15);
  color: #D4AF37;
}
.sidebar-nav a i { width: 18px; text-align: center; }

.app-sidebar__footer {
  padding: 16px 24px;
  border-top: 1px solid rgba(212, 175, 55, 0.15);
  display: flex;
  align-items: center;
  gap: 12px;
}
.user-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #D4AF37, #B8941F);
  color: #0F4C3A;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
}
.user-info { flex: 1; min-width: 0; }
.user-info__name { font-size: 14px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-info__plan { font-size: 12px; color: #D4AF37; }

/* ============ Main content ============ */
.app-main {
  padding: 32px 40px;
  max-width: 1400px;
  width: 100%;
}
@media (max-width: 768px) {
  .app-main { padding: 24px 16px; }
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 16px;
}
.app-header__title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 36px;
  color: #0F4C3A;
  font-weight: 600;
  line-height: 1.1;
}
.app-header__subtitle {
  color: #6b756f;
  font-size: 15px;
  margin-top: 4px;
}
.app-header__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.sidebar-toggle {
  display: none;
  background: #fff;
  border: 1.5px solid #efe7d8;
  border-radius: 10px;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #0F4C3A;
}
@media (max-width: 1024px) {
  .sidebar-toggle { display: flex; }
}

/* ============ Stats cards ============ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.stat-card {
  background: #fff;
  border-radius: 18px;
  padding: 20px;
  border: 1px solid rgba(212, 175, 55, 0.1);
  box-shadow: 0 2px 12px rgba(15, 76, 58, 0.04);
}
.stat-card__icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(15, 76, 58, 0.08), rgba(212, 175, 55, 0.12));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #0F4C3A;
  margin-bottom: 12px;
}
.stat-card__label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #8a948e;
  font-weight: 600;
  margin-bottom: 4px;
}
.stat-card__value {
  font-family: 'Cormorant Garamond', serif;
  font-size: 30px;
  color: #0F4C3A;
  font-weight: 600;
  line-height: 1;
  margin-bottom: 6px;
}
.stat-card__hint {
  font-size: 13px;
  color: #6b756f;
}

/* ============ Charts list ============ */
.section-block {
  background: #fff;
  border-radius: 20px;
  padding: 28px;
  margin-bottom: 24px;
  border: 1px solid rgba(212, 175, 55, 0.1);
  box-shadow: 0 2px 12px rgba(15, 76, 58, 0.04);
}
.section-block__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.section-block__title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 24px;
  color: #0F4C3A;
  font-weight: 600;
}

.charts-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.chart-tile {
  background: #FBF8F1;
  border-radius: 14px;
  padding: 18px;
  border: 1.5px solid transparent;
  transition: all 0.2s;
  cursor: pointer;
  position: relative;
}
.chart-tile:hover {
  border-color: #D4AF37;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(15, 76, 58, 0.08);
}
.chart-tile__type {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #B8941F;
  background: rgba(212, 175, 55, 0.12);
  padding: 3px 8px;
  border-radius: 6px;
  margin-bottom: 10px;
}
.chart-tile__name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 20px;
  color: #0F4C3A;
  font-weight: 600;
  margin-bottom: 6px;
}
.chart-tile__date {
  font-size: 13px;
  color: #8a948e;
  margin-bottom: 12px;
}
.chart-tile__pillars {
  font-family: 'Cormorant Garamond', serif;
  font-size: 18px;
  color: #0F4C3A;
  letter-spacing: 0.1em;
  margin-bottom: 10px;
}
.chart-tile__tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.chart-tile__tag {
  font-size: 11px;
  padding: 2px 8px;
  background: rgba(15, 76, 58, 0.06);
  border-radius: 6px;
  color: #4a5550;
}
.chart-tile__menu {
  position: absolute;
  top: 14px; right: 14px;
  background: none;
  border: none;
  color: #a8a89c;
  cursor: pointer;
  padding: 4px;
  font-size: 16px;
}
.chart-tile__menu:hover { color: #0F4C3A; }

.empty-charts {
  text-align: center;
  padding: 60px 20px;
  color: #6b756f;
}
.empty-charts i {
  font-size: 48px;
  color: #D4AF37;
  opacity: 0.5;
  margin-bottom: 16px;
  display: block;
}

/* ============ AI Chat ============ */
.chat-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  height: calc(100vh - 120px);
  min-height: 600px;
  gap: 20px;
  width: 100%;
}
.chat-layout > * { min-width: 0; }
@media (max-width: 1100px) {
  .chat-layout { grid-template-columns: 1fr; }
  .chat-sidebar { display: none; }
}

.chat-sidebar {
  background: #fff;
  border-radius: 18px;
  padding: 20px;
  border: 1px solid rgba(212, 175, 55, 0.1);
  overflow-y: auto;
}
.chat-sidebar__title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 18px;
  color: #0F4C3A;
  font-weight: 600;
  margin-bottom: 14px;
}
.chat-history-item {
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  color: #4a5550;
  cursor: pointer;
  transition: background 0.2s;
  margin-bottom: 4px;
  border: none;
  background: none;
  text-align: left;
  width: 100%;
  font-family: inherit;
}
.chat-history-item:hover { background: #FBF8F1; }
.chat-history-item.is-active { background: rgba(15, 76, 58, 0.06); color: #0F4C3A; font-weight: 600; }
.chat-history-item__title {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-history-item__date {
  font-size: 11px;
  color: #8a948e;
  margin-top: 2px;
}

.chat-window {
  background: #fff;
  border-radius: 18px;
  border: 1px solid rgba(212, 175, 55, 0.1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  width: 100%;
  min-width: 0;
}
.chat-window__header {
  padding: 18px 24px;
  border-bottom: 1px solid #efe7d8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.chat-window__title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 20px;
  color: #0F4C3A;
  font-weight: 600;
}
.chat-window__select {
  padding: 6px 12px;
  border: 1.5px solid #efe7d8;
  border-radius: 10px;
  background: #FBF8F1;
  font-family: inherit;
  font-size: 13px;
  color: #4a5550;
  cursor: pointer;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: linear-gradient(180deg, #FBF8F1 0%, #fff 50%);
}
.chat-msg {
  max-width: 85%;
  padding: 14px 18px;
  border-radius: 16px;
  font-size: 15px;
  line-height: 1.6;
  word-wrap: break-word;
}
.chat-msg--user {
  align-self: flex-end;
  background: linear-gradient(135deg, #0F4C3A, #1A6B52);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-msg--bot {
  align-self: flex-start;
  background: #fff;
  color: #1a1a1a;
  border: 1px solid #efe7d8;
  border-bottom-left-radius: 4px;
}
.chat-msg--bot p { margin: 0 0 8px; }
.chat-msg--bot p:last-child { margin-bottom: 0; }
.chat-msg--bot ul, .chat-msg--bot ol { margin: 8px 0; padding-left: 22px; }
.chat-msg--bot li { margin-bottom: 4px; }
.chat-msg--bot strong { color: #0F4C3A; }
.chat-msg__meta {
  font-size: 11px;
  opacity: 0.6;
  margin-top: 6px;
}

.chat-typing {
  align-self: flex-start;
  background: #fff;
  border: 1px solid #efe7d8;
  padding: 14px 18px;
  border-radius: 16px;
  display: flex;
  gap: 4px;
}
.chat-typing span {
  width: 8px; height: 8px;
  background: #D4AF37;
  border-radius: 50%;
  animation: typing 1.2s infinite;
}
.chat-typing span:nth-child(2) { animation-delay: 0.15s; }
.chat-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

/* Chat dots (inline typing indicator) */
.chat-dots {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}
.chat-dots span {
  width: 8px; height: 8px;
  background: #D4AF37;
  border-radius: 50%;
  display: inline-block;
  animation: typing 1.2s infinite;
}
.chat-dots span:nth-child(2) { animation-delay: 0.15s; }
.chat-dots span:nth-child(3) { animation-delay: 0.3s; }

/* Chat message bubbles (used by chat.js) */
.chat-message {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  align-items: flex-start;
  max-width: 100%;
}
.chat-message--user { flex-direction: row-reverse; }
.chat-message--ai   { flex-direction: row; }
.chat-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  flex-shrink: 0;
  color: #fff;
}
.chat-message--user .chat-avatar { background: #0F4C3A; }
.chat-message--ai   .chat-avatar { background: linear-gradient(135deg, #D4AF37, #b89525); }
.chat-bubble {
  padding: 12px 16px;
  border-radius: 16px;
  max-width: calc(100% - 60px);
  line-height: 1.55;
  font-size: 14.5px;
  word-wrap: break-word;
}
.chat-bubble p { margin: 0 0 8px; }
.chat-bubble p:last-child { margin-bottom: 0; }
.chat-bubble strong { font-weight: 600; }
.chat-bubble--user {
  background: #0F4C3A;
  color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-bubble--ai {
  background: #fff;
  color: #1a1a1a;
  border: 1px solid #efe7d8;
  border-bottom-left-radius: 4px;
}
.chat-bubble--error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
  border-bottom-left-radius: 4px;
}
.chat-bubble--upgrade {
  background: #fff7ed;
  color: #7c2d12;
  border: 1px solid #fed7aa;
  border-bottom-left-radius: 4px;
}

.user-logout { transition: color .15s; text-decoration: none; }
.user-logout:hover { color: #0F4C3A !important; }

.chat-input-row {
  padding: 16px 20px 20px;
  border-top: 1px solid #efe7d8;
  background: #fff;
}
.chat-input-wrapper {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}
.chat-input {
  flex: 1;
  border: 1.5px solid #efe7d8;
  border-radius: 14px;
  padding: 12px 16px;
  font-family: inherit;
  font-size: 14px;
  resize: none;
  min-height: 46px;
  max-height: 200px;
  background: #FBF8F1;
  transition: border-color 0.2s, background 0.2s;
}
.chat-input:focus {
  outline: none;
  border-color: #0F4C3A;
  background: #fff;
}
.chat-send-btn {
  background: linear-gradient(135deg, #D4AF37, #B8941F);
  color: #fff;
  border: none;
  border-radius: 14px;
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  transition: transform 0.2s;
}
.chat-send-btn:hover { transform: scale(1.05); }
.chat-send-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.chat-suggestions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.chat-suggestion {
  background: #FBF8F1;
  border: 1px solid #efe7d8;
  border-radius: 10px;
  padding: 6px 12px;
  font-size: 12px;
  color: #4a5550;
  cursor: pointer;
  font-family: inherit;
}
.chat-suggestion:hover { border-color: #D4AF37; background: #fff; }

.chat-empty {
  text-align: center;
  padding: 60px 20px;
  color: #6b756f;
}
.chat-empty__icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(15, 76, 58, 0.08), rgba(212, 175, 55, 0.12));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: #D4AF37;
  margin: 0 auto 16px;
}
.chat-empty h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 24px;
  color: #0F4C3A;
  margin-bottom: 8px;
  font-weight: 600;
}

/* === Chat patch: AI bubbles + typing indicator === */
.chat-msg--ai {
  flex-direction: row;
}
.chat-msg--ai .chat-msg__bubble {
  background: #fff;
  border: 1px solid #e8e4d6;
  color: #1a1a1a;
  border-radius: 14px 14px 14px 4px;
  padding: 12px 16px;
  max-width: 78%;
}
.chat-msg--ai .chat-msg__body p { margin: 0 0 8px; }
.chat-msg--ai .chat-msg__body p:last-child { margin-bottom: 0; }
.chat-msg--ai .chat-msg__body strong { color: #0F4C3A; }
.chat-msg--ai .chat-msg__body em { color: #6b7268; font-style: italic; }
.chat-msg--ai .chat-msg__body ul { margin: 8px 0; padding-left: 22px; }
.chat-msg--ai .chat-msg__body li { margin-bottom: 4px; }
.chat-msg__avatar--ai {
  background: linear-gradient(135deg, #0F4C3A, #1a6b52);
  color: #D4AF37;
}
.typing-dots {
  display: inline-flex;
  gap: 4px;
  padding: 4px 2px;
}
.typing-dots span {
  width: 7px; height: 7px;
  background: #0F4C3A;
  border-radius: 50%;
  opacity: 0.4;
  animation: typingBlink 1.2s infinite ease-in-out;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBlink {
  0%, 80%, 100% { opacity: 0.3; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-2px); }
}

/* =====================================================
   Charts page (charts.html)
   ===================================================== */
.charts-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
  padding: 16px 20px;
  background: #fff;
  border: 1px solid rgba(15, 76, 58, 0.08);
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(15, 76, 58, 0.04);
}
.charts-search {
  position: relative;
  flex: 1 1 280px;
  min-width: 240px;
}
.charts-search i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 14px;
}
.charts-search input {
  width: 100%;
  height: 40px;
  padding: 0 14px 0 38px;
  font: inherit;
  font-size: 14px;
  background: #F8FAF7;
  border: 1px solid rgba(15, 76, 58, 0.08);
  border-radius: 10px;
  color: #0F1F1A;
  transition: border-color 0.2s, background 0.2s;
}
.charts-search input:focus {
  outline: none;
  border-color: rgba(15, 76, 58, 0.3);
  background: #fff;
}
.charts-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  background: #F8FAF7;
  border: 1px solid rgba(15, 76, 58, 0.1);
  color: #4a5852;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
}
.filter-chip:hover {
  background: #EFF6EE;
  color: #0F4C3A;
}
.filter-chip.is-active {
  background: #0F4C3A;
  border-color: #0F4C3A;
  color: #fff;
}
.filter-count {
  display: inline-block;
  min-width: 18px;
  padding: 0 5px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 9px;
  text-align: center;
}
.filter-chip:not(.is-active) .filter-count {
  background: rgba(15, 76, 58, 0.08);
  color: #6b756f;
}
.charts-sort {
  margin-left: auto;
}
.form-control-sm {
  height: 34px;
  padding: 0 10px;
  font-size: 13px;
}

.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}
.chart-tile__open {
  display: inline-block;
  margin-top: 12px;
  font-size: 13px;
  font-weight: 600;
  color: #0F4C3A;
  text-decoration: none;
}
.chart-tile__open:hover { color: #D4AF37; }
.chart-tile__menu-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  color: #94a3b8;
  font-size: 16px;
  transition: all 0.2s;
}
.chart-tile__menu-btn:hover {
  background: rgba(15, 76, 58, 0.08);
  color: #0F4C3A;
}
.chart-tile--add {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  border: 2px dashed rgba(212, 175, 55, 0.6);
  background: transparent;
  text-decoration: none;
  min-height: 200px;
  transition: all 0.2s;
}
.chart-tile--add:hover {
  border-color: #D4AF37;
  background: rgba(212, 175, 55, 0.04);
  transform: translateY(-2px);
}
.chart-tile__add-icon {
  width: 44px; height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #D4AF37;
  color: #fff;
  font-size: 18px;
  margin-bottom: 12px;
}
.chart-tile__add-text {
  font-family: 'Cormorant Garamond', serif;
  font-size: 19px;
  font-weight: 600;
  color: #0F4C3A;
  margin-bottom: 4px;
}
.chart-tile__add-hint {
  font-size: 12px;
  color: #94a3b8;
}

.empty-state {
  text-align: center;
  padding: 56px 24px;
  background: #fff;
  border: 1px dashed rgba(15, 76, 58, 0.15);
  border-radius: 14px;
  margin-bottom: 24px;
}
.empty-state__icon {
  font-size: 44px;
  color: #cbd5d0;
  margin-bottom: 16px;
}
.empty-state h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  font-weight: 600;
  color: #0F4C3A;
  margin: 0 0 6px;
}
.empty-state p {
  color: #6b756f;
  font-size: 14px;
}

.plan-limit-alert {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 22px;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.10), rgba(212, 175, 55, 0.04));
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 14px;
  flex-wrap: wrap;
}
.plan-limit-alert__icon {
  width: 44px; height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #D4AF37;
  color: #fff;
  border-radius: 12px;
  font-size: 18px;
  flex-shrink: 0;
}
.plan-limit-alert__body {
  flex: 1 1 320px;
}
.plan-limit-alert__body strong {
  display: block;
  font-family: 'Cormorant Garamond', serif;
  font-size: 17px;
  color: #0F4C3A;
  margin-bottom: 4px;
}
.plan-limit-alert__body p {
  margin: 0;
  font-size: 13px;
  color: #6b756f;
  line-height: 1.5;
}

/* =====================================================
   Settings page (settings.html)
   ===================================================== */
.settings-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  border-bottom: 1px solid rgba(15, 76, 58, 0.1);
  overflow-x: auto;
  scrollbar-width: thin;
}
.settings-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: #6b756f;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.settings-tab:hover { color: #0F4C3A; }
.settings-tab.is-active {
  color: #0F4C3A;
  border-bottom-color: #0F4C3A;
}
.settings-tab i { font-size: 13px; }

.settings-panel { display: none; }
.settings-panel.is-active { display: block; animation: fadeInUp 0.3s ease; }
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.settings-form {
  max-width: 640px;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 640px) {
  .form-row { grid-template-columns: 1fr; }
}
.form-hint {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: #94a3b8;
}

/* OAuth list */
.oauth-list { display: flex; flex-direction: column; gap: 10px; }
.oauth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  background: #F8FAF7;
  border: 1px solid rgba(15, 76, 58, 0.08);
  border-radius: 12px;
}
.oauth-row__info {
  display: flex;
  align-items: center;
  gap: 14px;
}
.oauth-row__icon {
  width: 40px; height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 18px;
}
.oauth-row strong {
  display: block;
  font-size: 14px;
  color: #0F1F1A;
}
.oauth-row__hint {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 2px;
}

/* Sessions */
.session-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  background: #F8FAF7;
  border: 1px solid rgba(15, 76, 58, 0.08);
  border-radius: 12px;
}
.session-row__info {
  display: flex;
  align-items: center;
  gap: 14px;
}
.session-row__icon {
  width: 38px; height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 76, 58, 0.08);
  color: #0F4C3A;
  border-radius: 10px;
  font-size: 15px;
}
.session-row__hint {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 2px;
}

.badge {
  display: inline-block;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-radius: 10px;
  background: rgba(15, 76, 58, 0.08);
  color: #0F4C3A;
}
.badge-success { background: rgba(16, 185, 129, 0.12); color: #047857; }
.badge-gold { background: rgba(212, 175, 55, 0.18); color: #92660E; }

/* Toggle switch */
.form-toggle {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(15, 76, 58, 0.06);
  cursor: pointer;
}
.form-toggle:last-of-type { border-bottom: none; }
.form-toggle input { display: none; }
.form-toggle__slider {
  flex-shrink: 0;
  position: relative;
  width: 44px;
  height: 24px;
  background: #cbd5d0;
  border-radius: 24px;
  transition: background 0.25s;
  margin-top: 2px;
}
.form-toggle__slider::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 20px; height: 20px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  transition: transform 0.25s;
}
.form-toggle input:checked + .form-toggle__slider {
  background: #0F4C3A;
}
.form-toggle input:checked + .form-toggle__slider::after {
  transform: translateX(20px);
}
.form-toggle__label strong {
  display: block;
  font-size: 14px;
  color: #0F1F1A;
  margin-bottom: 2px;
}
.form-toggle__label small {
  display: block;
  font-size: 12px;
  color: #6b756f;
  line-height: 1.45;
}

/* Data section */
.data-info {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.data-info__row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 18px;
  background: rgba(16, 185, 129, 0.05);
  border: 1px solid rgba(16, 185, 129, 0.15);
  border-radius: 12px;
}
.data-info__row i {
  width: 36px; height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(16, 185, 129, 0.15);
  color: #047857;
  border-radius: 10px;
  font-size: 14px;
  flex-shrink: 0;
}
.data-info__row strong {
  display: block;
  font-size: 14px;
  color: #0F1F1A;
  margin-bottom: 2px;
}
.data-info__row small {
  display: block;
  font-size: 12px;
  color: #6b756f;
  line-height: 1.5;
}

.section-block--danger {
  border: 1px solid rgba(220, 38, 38, 0.2);
  background: rgba(220, 38, 38, 0.02);
}
.section-block--danger .section-block__title {
  color: #b91c1c;
}
.btn-danger {
  background: linear-gradient(135deg, #DC2626, #B91C1C);
  color: #fff;
  border: none;
}
.btn-danger:hover {
  background: linear-gradient(135deg, #B91C1C, #991B1B);
  box-shadow: 0 8px 20px rgba(220, 38, 38, 0.25);
}

/* =====================================================
   Billing page (billing.html)
   ===================================================== */
.current-plan {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  padding: 24px;
  background: linear-gradient(135deg, #F8FAF7 0%, #EFF6EE 100%);
  border: 1px solid rgba(15, 76, 58, 0.1);
  border-radius: 14px;
}
@media (max-width: 768px) {
  .current-plan { grid-template-columns: 1fr; gap: 20px; }
}
.current-plan__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: rgba(15, 76, 58, 0.1);
  color: #0F4C3A;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.current-plan__name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 36px;
  font-weight: 700;
  color: #0F4C3A;
  margin: 10px 0 4px;
  line-height: 1.1;
}
.current-plan__price {
  font-size: 16px;
  color: #6b756f;
  margin: 0 0 18px;
}
.current-plan__price strong {
  font-family: 'Cormorant Garamond', serif;
  font-size: 28px;
  color: #0F1F1A;
  font-weight: 700;
}
.current-plan__price small { font-size: 14px; }
.current-plan__features {
  list-style: none;
  margin: 0; padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.current-plan__features li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: #0F1F1A;
}
.current-plan__features li i {
  width: 18px;
  font-size: 13px;
  color: #10B981;
}
.current-plan__features li.is-locked {
  color: #94a3b8;
}
.current-plan__features li.is-locked i { color: #cbd5d0; }

.current-plan__usage h4 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 18px;
  font-weight: 600;
  color: #0F4C3A;
  margin: 0 0 18px;
}
.usage-bar { margin-bottom: 18px; }
.usage-bar:last-child { margin-bottom: 0; }
.usage-bar__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.usage-bar__head span {
  font-size: 13px;
  color: #6b756f;
}
.usage-bar__head strong {
  font-size: 14px;
  font-weight: 700;
  color: #0F1F1A;
}
.usage-bar__track {
  height: 8px;
  background: rgba(15, 76, 58, 0.08);
  border-radius: 4px;
  overflow: hidden;
}
.usage-bar__fill {
  height: 100%;
  background: linear-gradient(90deg, #0F4C3A, #10B981);
  border-radius: 4px;
  transition: width 0.6s ease;
}
.usage-bar__fill.is-over {
  background: linear-gradient(90deg, #DC2626, #F59E0B);
}
.usage-bar__hint {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  color: #94a3b8;
}
.usage-bar__hint.is-over { color: #b91c1c; font-weight: 600; }

.current-plan__cta {
  display: flex;
  gap: 12px;
  margin-top: 22px;
  flex-wrap: wrap;
}

/* Mini tariff grid */
.tariff-mini-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 16px;
}
@media (max-width: 900px) {
  .tariff-mini-grid { grid-template-columns: 1fr; }
}
.tariff-mini {
  position: relative;
  padding: 22px;
  background: #fff;
  border: 1px solid rgba(15, 76, 58, 0.1);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.tariff-mini.is-current {
  background: #F8FAF7;
  border-color: rgba(15, 76, 58, 0.25);
}
.tariff-mini.is-popular {
  border-color: #D4AF37;
  box-shadow: 0 8px 24px rgba(212, 175, 55, 0.15);
}
.tariff-mini__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.tariff-mini__head h4 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  font-weight: 700;
  color: #0F4C3A;
  margin: 0;
}
.tariff-mini__price {
  font-family: 'Cormorant Garamond', serif;
  font-size: 30px;
  font-weight: 700;
  color: #0F1F1A;
}
.tariff-mini__price small {
  font-family: 'Manrope', sans-serif;
  font-size: 13px;
  color: #94a3b8;
  font-weight: 500;
}
.tariff-mini ul {
  list-style: none;
  margin: 0; padding: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex-grow: 1;
}
.tariff-mini ul li {
  position: relative;
  padding-left: 20px;
  font-size: 13px;
  color: #4a5852;
}
.tariff-mini ul li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: #10B981;
  font-weight: 700;
}
.tariff-mini button { margin-top: 4px; }

.tariff-yearly-hint {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(15, 76, 58, 0.04);
  border-radius: 10px;
  font-size: 13px;
  color: #4a5852;
  margin: 16px 0 0;
}
.tariff-yearly-hint i { color: #0F4C3A; }

/* Payment method */
.payment-method__empty {
  text-align: center;
  padding: 32px 24px;
  background: #F8FAF7;
  border: 2px dashed rgba(15, 76, 58, 0.12);
  border-radius: 14px;
}
.payment-method__empty i {
  font-size: 36px;
  color: #cbd5d0;
  margin-bottom: 12px;
}
.payment-method__empty h4 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 20px;
  font-weight: 600;
  color: #0F4C3A;
  margin: 0 0 6px;
}
.payment-method__empty p {
  font-size: 13px;
  color: #6b756f;
  margin: 0;
}
.payment-providers {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
  justify-content: center;
}
.payment-provider {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: #fff;
  border: 1px solid rgba(15, 76, 58, 0.1);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #4a5852;
}
.payment-provider i { font-size: 16px; color: #0F4C3A; }

/* Billing history */
.billing-history__empty {
  text-align: center;
  padding: 40px 24px;
}
.billing-table {
  width: 100%;
  border-collapse: collapse;
}
.billing-table th, .billing-table td {
  padding: 12px 16px;
  text-align: left;
  font-size: 13px;
  border-bottom: 1px solid rgba(15, 76, 58, 0.06);
}
.billing-table th {
  font-weight: 700;
  color: #6b756f;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.04em;
}

.section-block--info {
  background: rgba(15, 76, 58, 0.03);
  border: 1px solid rgba(15, 76, 58, 0.08);
}
.legal-info {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.legal-info > i {
  font-size: 20px;
  color: #0F4C3A;
  flex-shrink: 0;
  margin-top: 2px;
}
.legal-info p {
  font-size: 13px;
  color: #4a5852;
  line-height: 1.6;
  margin: 0 0 8px;
}
.legal-info p:last-child { margin: 0; }
.legal-info a { color: #0F4C3A; font-weight: 600; }

/* Screen reader only */
.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;
}

/* =====================================================
   Legal documents (offer, privacy, consent, disclaimer)
   ===================================================== */
.legal-page {
  min-height: 100vh;
  background:
    radial-gradient(ellipse at top, rgba(212, 175, 55, 0.06), transparent 60%),
    linear-gradient(180deg, #FAF7F0 0%, #F8FAF7 100%);
}
.legal-header {
  background: linear-gradient(135deg, #0F4C3A 0%, #1B6B4F 100%);
  color: #fff;
  padding: 18px 0;
  border-bottom: 3px solid #D4AF37;
}
.legal-header__inner {
  max-width: 920px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.legal-header__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: #fff;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.4rem;
  font-weight: 600;
}
.legal-header__brand .logo-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255,255,255,0.1);
  display: grid;
  place-items: center;
  border: 1px solid rgba(212,175,55,0.4);
}
.legal-header__brand .logo-mark img {
  width: 26px;
  height: 26px;
  object-fit: contain;
}
.legal-header__nav {
  display: flex;
  gap: 20px;
  font-size: 0.9rem;
}
.legal-header__nav a {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  transition: color 0.2s;
}
.legal-header__nav a:hover { color: #D4AF37; }

.legal-doc {
  max-width: 920px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}
.legal-doc__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
  font-size: 0.875rem;
  color: #6B7B6C;
}
.legal-doc__meta .badge {
  background: rgba(212, 175, 55, 0.12);
  color: #8B7113;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 600;
}
.legal-doc h1 {
  font-size: 2.4rem;
  margin-bottom: 16px;
  line-height: 1.15;
}
.legal-doc__lead {
  font-size: 1.1rem;
  color: #4A5A4B;
  line-height: 1.6;
  margin-bottom: 32px;
  padding: 16px 20px;
  background: rgba(15, 76, 58, 0.04);
  border-left: 4px solid #0F4C3A;
  border-radius: 0 12px 12px 0;
}
.legal-doc h2 {
  font-size: 1.6rem;
  margin-top: 36px;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(15, 76, 58, 0.12);
}
.legal-doc h3 {
  font-size: 1.2rem;
  margin-top: 24px;
  margin-bottom: 10px;
  color: #1B6B4F;
}
.legal-doc p {
  font-size: 1rem;
  line-height: 1.75;
  color: #2C3E2D;
  margin: 0 0 14px;
}
.legal-doc ul, .legal-doc ol {
  margin: 0 0 14px;
  padding-left: 24px;
}
.legal-doc li {
  font-size: 1rem;
  line-height: 1.75;
  color: #2C3E2D;
  margin-bottom: 6px;
}
.legal-doc strong { color: #0F4C3A; font-weight: 600; }
.legal-doc a {
  color: #0F4C3A;
  text-decoration: underline;
  text-decoration-color: rgba(212, 175, 55, 0.5);
  text-underline-offset: 3px;
}
.legal-doc a:hover { color: #D4AF37; }

.legal-doc__box {
  background: #fff;
  border: 1px solid rgba(15, 76, 58, 0.1);
  border-radius: 16px;
  padding: 20px 24px;
  margin: 20px 0;
  box-shadow: 0 4px 14px rgba(15, 76, 58, 0.05);
}
.legal-doc__box--warning {
  background: rgba(212, 175, 55, 0.08);
  border-color: rgba(212, 175, 55, 0.3);
}
.legal-doc__box--info {
  background: rgba(15, 76, 58, 0.04);
  border-color: rgba(15, 76, 58, 0.15);
}

.legal-toc {
  background: #fff;
  border: 1px solid rgba(15, 76, 58, 0.1);
  border-radius: 16px;
  padding: 20px 24px;
  margin-bottom: 32px;
}
.legal-toc h3 {
  margin: 0 0 12px;
  font-size: 1rem;
  color: #6B7B6C;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
}
.legal-toc ol {
  margin: 0;
  padding-left: 22px;
  columns: 2;
  column-gap: 24px;
}
.legal-toc li { margin-bottom: 6px; font-size: 0.95rem; }
.legal-toc a { text-decoration: none; }

.legal-footer {
  background: #0F4C3A;
  color: rgba(255,255,255,0.7);
  padding: 28px 24px;
  text-align: center;
  font-size: 0.875rem;
}
.legal-footer a { color: #D4AF37; text-decoration: none; }
.legal-footer a:hover { text-decoration: underline; }

@media (max-width: 640px) {
  .legal-doc h1 { font-size: 1.8rem; }
  .legal-doc h2 { font-size: 1.3rem; }
  .legal-toc ol { columns: 1; }
  .legal-header__nav { display: none; }
}

/* ===== Form alerts (API errors) ===== */
.form-alert {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.5;
  border: 1px solid;
  display: block;
  font-family: 'Manrope', system-ui, sans-serif;
}
.form-alert--error {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}
.form-alert--warning {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}
.form-alert--success {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #166534;
}
.form-alert--info {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1e40af;
}

/* ===== Toast notifications ===== */
.gj-toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  max-width: 380px;
}
.gj-toast {
  padding: 14px 18px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 28px rgba(15, 76, 58, 0.18);
  border-left: 4px solid #0F4C3A;
  font-size: 14px;
  line-height: 1.45;
  color: #1f2937;
  pointer-events: auto;
  animation: gjToastIn 0.25s ease;
  font-family: 'Manrope', system-ui, sans-serif;
}
.gj-toast--error { border-left-color: #dc2626; }
.gj-toast--warning { border-left-color: #d97706; }
.gj-toast--success { border-left-color: #059669; }
@keyframes gjToastIn {
  from { transform: translateX(20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ===== Loading skeleton ===== */
.gj-skeleton {
  background: linear-gradient(90deg, #f3f4f6 0%, #e5e7eb 50%, #f3f4f6 100%);
  background-size: 200% 100%;
  animation: gjSkeleton 1.5s ease-in-out infinite;
  border-radius: 8px;
}
@keyframes gjSkeleton {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ===== Empty state ===== */
.gj-empty {
  text-align: center;
  padding: 48px 24px;
  color: #6b7280;
  font-family: 'Manrope', system-ui, sans-serif;
}
.gj-empty i {
  font-size: 48px;
  color: #d1d5db;
  margin-bottom: 12px;
  display: block;
}
.gj-empty__title {
  font-size: 18px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 6px;
}

/* Period toggle for billing */
.period-toggle {
  display: inline-flex;
  background: #f3f1ea;
  border-radius: 8px;
  padding: 4px;
  gap: 2px;
}
.period-toggle__btn {
  background: transparent;
  border: none;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: #4f4a3f;
  cursor: pointer;
  transition: all .15s;
}
.period-toggle__btn:hover { color: #0F4C3A; }
.period-toggle__btn.is-active {
  background: #fff;
  color: #0F4C3A;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* Billing table */
.billing-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.billing-table th {
  text-align: left;
  padding: 12px 16px;
  background: #FBF8F1;
  font-weight: 600;
  color: #4f4a3f;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid #efe7d8;
}
.billing-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #f4ede1;
}
.billing-table tr:last-child td { border-bottom: none; }
.billing-table a { color: #0F4C3A; text-decoration: none; font-weight: 500; }
.billing-table a:hover { text-decoration: underline; }

/* Modal */
.gj-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.gj-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 27, 22, 0.5);
  backdrop-filter: blur(2px);
}
.gj-modal__dialog {
  position: relative;
  background: #fff;
  border-radius: 16px;
  padding: 28px;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  max-height: 90vh;
  overflow-y: auto;
}
.gj-modal__dialog h3 {
  margin: 0 0 12px;
  font-size: 20px;
  font-weight: 700;
  color: #1a1a1a;
}
.gj-modal__dialog code {
  background: #fef2f2;
  color: #991b1b;
  padding: 2px 8px;
  border-radius: 4px;
  font-family: 'Manrope', monospace;
  font-weight: 700;
  font-size: 13px;
}
