/* ============ RESET & BASE ============ */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
:root{
  --green:#1a7a4a; --green-light:#22c55e; --green-dark:#14532d;
  --bg:#f8faf9; --sidebar:#fff; --border:#e5e7eb;
  --text:#111827; --muted:#6b7280; --card:#fff;
}
body{font-family:'Segoe UI',system-ui,sans-serif;background:var(--bg);color:var(--text);display:flex;min-height:100vh}
a{color:var(--green);text-decoration:none}
a:hover{opacity:.8}
input,select,textarea{font-family:inherit}

/* ============ SIDEBAR ============ */
.sidebar{width:220px;min-height:100vh;background:var(--sidebar);border-right:1px solid var(--border);display:flex;flex-direction:column;padding:20px 12px;position:fixed;top:0;left:0;z-index:100}
.sidebar-logo{display:flex;align-items:center;gap:10px;padding:0 8px 24px;border-bottom:1px solid var(--border);margin-bottom:16px}
.sidebar-logo strong{font-size:1rem;display:block;line-height:1.2}
.sidebar-logo small{font-size:.7rem;color:var(--muted);letter-spacing:1px}
.logo-box{width:36px;height:36px;background:var(--green);border-radius:8px;display:flex;align-items:center;justify-content:center;font-size:1.1rem}
.nav-link{display:flex;align-items:center;gap:8px;padding:10px 12px;border-radius:8px;color:var(--muted);font-size:.9rem;margin-bottom:2px;transition:all .15s}
.nav-link:hover,.nav-link.active{background:#f0faf4;color:var(--green);font-weight:600}
.nav-section{font-size:.7rem;color:var(--muted);letter-spacing:1px;text-transform:uppercase;padding:16px 12px 4px;font-weight:600}
.sidebar-footer{margin-top:auto;padding-top:16px;border-top:1px solid var(--border)}
.tier-badge{padding:10px 14px;border-radius:10px;font-size:.82rem;font-weight:600;margin-bottom:10px;line-height:1.5}
.tier-badge.pro{background:#f0fdf4;color:var(--green-dark);border:1px solid #bbf7d0}
.tier-badge.free{background:#eff6ff;color:#1d4ed8;border:1px solid #bfdbfe}
.btn-upgrade{display:block;background:var(--green);color:#fff!important;padding:10px;border-radius:8px;text-align:center;font-size:.85rem;font-weight:600;margin-bottom:8px}
.btn-upgrade:hover{background:var(--green-dark);opacity:1}
.logout-link{display:block;text-align:center;font-size:.82rem;color:var(--muted);padding:6px}

/* ============ MAIN CONTENT ============ */
.main-content{margin-left:220px;flex:1;padding:0 32px 40px;min-height:100vh}
.topbar{display:flex;align-items:center;justify-content:space-between;padding:20px 0;margin-bottom:8px}
.search-bar input{background:#f3f4f6;border:1px solid var(--border);border-radius:24px;padding:9px 20px;width:320px;font-size:.9rem;outline:none}
.user-info{display:flex;align-items:center;gap:12px;font-size:.9rem;font-weight:500}
.avatar{width:36px;height:36px;background:var(--green);color:#fff;border-radius:50%;display:flex;align-items:center;justify-content:center;font-weight:700}

/* ============ HERO BANNER ============ */
.hero-banner{background:linear-gradient(135deg,#1a7a4a 0%,#22c55e 100%);border-radius:16px;padding:36px 40px;color:#fff;margin-bottom:32px;position:relative;overflow:hidden}
.hero-banner::after{content:'';position:absolute;right:-40px;top:-40px;width:200px;height:200px;background:rgba(255,255,255,.08);border-radius:50%}
.hero-badge{display:inline-flex;align-items:center;gap:6px;background:rgba(255,255,255,.2);border-radius:20px;padding:5px 14px;font-size:.78rem;font-weight:600;margin-bottom:14px;letter-spacing:.5px}
.hero-banner h2{font-size:1.7rem;margin-bottom:10px;line-height:1.3}
.hero-banner p{color:rgba(255,255,255,.85);margin-bottom:24px;font-size:.95rem;max-width:500px}
.btn-white{background:#fff;color:var(--green);font-weight:700;padding:12px 24px;border-radius:8px;border:none;cursor:pointer;display:inline-block;font-size:.95rem;transition:all .15s}
.btn-white:hover{background:#f0fdf4;color:var(--green);opacity:1}

/* ============ SUBJECTS GRID ============ */
.section-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:16px}
.section-header h3{font-size:1.1rem;font-weight:700}
.subjects-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:16px;margin-bottom:32px}
.subject-card{background:var(--card);border:1px solid var(--border);border-radius:12px;padding:20px;display:flex;flex-direction:column;gap:6px;transition:all .15s;color:var(--text)}
.subject-card:hover{border-color:var(--green);box-shadow:0 4px 12px rgba(26,122,74,.1);transform:translateY(-1px);opacity:1}
.subject-icon{width:44px;height:44px;border-radius:10px;display:flex;align-items:center;justify-content:center;font-size:1.3rem;margin-bottom:4px}
.subject-card strong{font-size:.95rem}
.subject-card small{color:var(--muted);font-size:.8rem}

/* ============ TABLE ============ */
.table-wrap{background:var(--card);border:1px solid var(--border);border-radius:12px;overflow:hidden;margin-bottom:24px}
table{width:100%;border-collapse:collapse;font-size:.88rem}
thead{background:#f9fafb}
th{padding:12px 16px;text-align:left;font-weight:600;color:var(--muted);font-size:.8rem;text-transform:uppercase;letter-spacing:.5px;border-bottom:1px solid var(--border)}
td{padding:12px 16px;border-bottom:1px solid #f3f4f6}
tr:last-child td{border-bottom:none}
.badge{display:inline-block;padding:3px 10px;border-radius:20px;font-size:.75rem;font-weight:600;background:#f3f4f6;color:var(--muted)}
.badge-pro{background:#dcfce7;color:#166534}
.badge-free{background:#eff6ff;color:#1d4ed8}
.badge-used{background:#fee2e2;color:#991b1b}

/* ============ AUTH PAGES ============ */
.auth-page{display:flex;align-items:center;justify-content:center;min-height:100vh;background:linear-gradient(135deg,#f0fdf4,#dcfce7)}
.auth-card{background:#fff;border-radius:16px;padding:40px;width:100%;max-width:420px;box-shadow:0 8px 32px rgba(0,0,0,.08)}
.auth-logo{text-align:center;margin-bottom:28px}
.logo-icon{font-size:2.5rem;margin-bottom:8px}
.auth-logo h1{font-size:1.4rem;margin-bottom:4px}
.auth-logo p{color:var(--muted);font-size:.88rem}
.form-group{margin-bottom:18px}
.form-group label{display:block;font-size:.85rem;font-weight:600;margin-bottom:6px;color:#374151}
.form-group input,.form-group select,.form-group textarea{width:100%;padding:11px 14px;border:1px solid var(--border);border-radius:8px;font-size:.92rem;outline:none;transition:border .15s}
.form-group input:focus,.form-group select:focus,.form-group textarea:focus{border-color:var(--green);box-shadow:0 0 0 3px rgba(26,122,74,.1)}
.btn{display:inline-block;padding:10px 20px;border-radius:8px;font-weight:600;font-size:.9rem;cursor:pointer;border:none;transition:all .15s}
.btn-primary{background:var(--green);color:#fff}
.btn-primary:hover{background:var(--green-dark)}
.btn-full{width:100%;display:block;text-align:center;padding:12px}
.btn-small{padding:5px 12px;font-size:.78rem;background:var(--green);color:#fff;border-radius:6px;display:inline-block}
.alert{padding:12px 16px;border-radius:8px;font-size:.88rem;margin-bottom:18px}
.alert-error{background:#fee2e2;color:#991b1b;border:1px solid #fecaca}
.alert-success{background:#dcfce7;color:#166534;border:1px solid #bbf7d0}
.alert-warning{background:#fffbeb;color:#92400e;border:1px solid #fde68a}
.auth-footer{text-align:center;margin-top:16px;font-size:.85rem;color:var(--muted)}

/* ============ CHAT PAGE ============ */
.chat-page{display:flex;flex-direction:column;height:100vh;padding-right:20px}
.chat-header{display:flex;justify-content:space-between;align-items:center;padding:20px 0;border-bottom:1px solid var(--border);margin-bottom:0}
.chat-header h2{font-size:1.2rem}
.chat-header p{color:var(--muted);font-size:.85rem}
.chat-header select{padding:8px 14px;border:1px solid var(--border);border-radius:8px;font-size:.85rem;outline:none}
.chat-window{flex:1;overflow-y:auto;padding:20px 0;display:flex;flex-direction:column;gap:12px}
.chat-welcome{display:flex;gap:14px;align-items:flex-start;padding:16px;background:#f0fdf4;border-radius:12px;margin-bottom:8px}
.bot-avatar{font-size:1.8rem;flex-shrink:0}
.msg{display:flex}
.msg-user{justify-content:flex-end}
.msg-assistant{justify-content:flex-start;gap:10px}
.msg-bubble{max-width:70%;padding:12px 16px;border-radius:12px;font-size:.9rem;line-height:1.6}
.msg-user .msg-bubble{background:var(--green);color:#fff;border-bottom-right-radius:4px}
.msg-assistant .msg-bubble{background:#f3f4f6;color:var(--text);border-bottom-left-radius:4px}
.typing-dots span{display:inline-block;animation:bounce 1s infinite;margin:0 1px}
.typing-dots span:nth-child(2){animation-delay:.2s}
.typing-dots span:nth-child(3){animation-delay:.4s}
@keyframes bounce{0%,80%,100%{transform:translateY(0)}40%{transform:translateY(-6px)}}
.chat-limit-bar{background:#fef2f2;border:1px solid #fecaca;border-radius:8px;padding:12px 16px;display:flex;align-items:center;justify-content:space-between;margin-top:12px;font-size:.88rem;color:#991b1b}
.chat-input-area{border-top:1px solid var(--border);padding:16px 0}
.quick-prompts{display:flex;gap:8px;margin-bottom:10px;flex-wrap:wrap}
.quick-prompts button{background:#f0fdf4;border:1px solid #bbf7d0;color:var(--green-dark);padding:7px 14px;border-radius:20px;font-size:.8rem;cursor:pointer;transition:all .15s}
.quick-prompts button:hover{background:#dcfce7}
.input-row{display:flex;gap:10px;align-items:flex-end}
.input-row textarea{flex:1;padding:12px 16px;border:1px solid var(--border);border-radius:12px;resize:none;font-size:.92rem;outline:none;max-height:120px;min-height:48px}
.input-row textarea:focus{border-color:var(--green);box-shadow:0 0 0 3px rgba(26,122,74,.1)}
.input-row button{background:var(--green);color:#fff;border:none;padding:12px 20px;border-radius:12px;font-weight:600;cursor:pointer;white-space:nowrap}
.input-row button:disabled{opacity:.5;cursor:not-allowed}
.msg-counter{display:block;margin-top:6px;font-size:.78rem;color:var(--muted);text-align:right}

/* ============ SYLLABUS ============ */
.subject-tabs{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:24px}
.tab{padding:8px 18px;border-radius:20px;border:1px solid var(--border);font-size:.85rem;color:var(--muted);background:#fff}
.tab.active,.tab:hover{background:var(--green);color:#fff;border-color:var(--green);opacity:1}
.syllabus-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:16px}
.syllabus-card{background:#fff;border:1px solid var(--border);border-radius:12px;padding:20px;transition:all .15s}
.syllabus-card.likely{border-color:#22c55e;background:#f0fdf4}
.syllabus-card-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:8px}
.syllabus-card p{color:var(--muted);font-size:.85rem;line-height:1.6;margin-bottom:12px}
.likely-badge{background:#dcfce7;color:#166534;font-size:.72rem;padding:3px 10px;border-radius:20px;font-weight:600;white-space:nowrap}
.ask-ai-btn{font-size:.82rem;color:var(--green);font-weight:600}

/* ============ EXAM ============ */
.exam-setup-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:16px;margin-bottom:20px}
.setup-card label{display:block;font-weight:600;font-size:.85rem;margin-bottom:6px}
.setup-card select{width:100%;padding:10px;border:1px solid var(--border);border-radius:8px;font-size:.9rem;outline:none}
.exam-header{display:flex;justify-content:space-between;align-items:center;padding:16px 20px;background:#fff;border:1px solid var(--border);border-radius:12px;margin-bottom:20px}
.timer{font-weight:700;font-size:1rem;color:var(--green)}
.question-card{background:#fff;border:1px solid var(--border);border-radius:12px;padding:20px;margin-bottom:16px}
.q-num{font-size:.78rem;color:var(--muted);font-weight:600;text-transform:uppercase;letter-spacing:.5px;margin-bottom:8px}
.q-text{font-size:.95rem;font-weight:500;margin-bottom:16px;line-height:1.5}
.options{display:flex;flex-direction:column;gap:8px}
.option-label{display:flex;align-items:center;gap:10px;padding:10px 14px;border:1px solid var(--border);border-radius:8px;cursor:pointer;font-size:.9rem;transition:all .15s}
.option-label:hover{border-color:var(--green);background:#f0fdf4}
.option-label input{accent-color:var(--green)}
.score-banner{background:linear-gradient(135deg,var(--green),#22c55e);color:#fff;border-radius:16px;padding:32px;text-align:center;margin-bottom:24px}
.score-banner h2{font-size:2rem;margin-bottom:8px}
.score-banner p{margin-bottom:20px;opacity:.9}
.result-item{background:#fff;border:1px solid var(--border);border-radius:12px;padding:16px;margin-bottom:12px}
.result-item.correct{border-color:#22c55e;background:#f0fdf4}
.result-item.wrong{border-color:#f87171;background:#fef2f2}
.result-item p{font-size:.88rem;line-height:1.5;margin-bottom:6px}
.explanation{color:var(--muted)!important;font-style:italic}
.spinner{width:40px;height:40px;border:4px solid #e5e7eb;border-top-color:var(--green);border-radius:50%;animation:spin 1s linear infinite;margin:0 auto 16px}
@keyframes spin{to{transform:rotate(360deg)}}
@media(max-width:768px){
  .sidebar{width:60px;padding:12px 6px}
  .sidebar-logo div,.nav-link span,.nav-section,.sidebar-footer{display:none}
  .main-content{margin-left:60px;padding:0 16px 32px}
  .subjects-grid{grid-template-columns:repeat(2,1fr)}
  .syllabus-grid{grid-template-columns:1fr}
  .exam-setup-grid{grid-template-columns:1fr}
  /* ============ MOBILE RESPONSIVE ============ */
@media (max-width: 768px) {

  /* Sidebar becomes bottom nav on mobile */
  .sidebar {
    width: 100%;
    height: 60px;
    min-height: unset;
    flex-direction: row;
    position: fixed;
    bottom: 0;
    top: unset;
    left: 0;
    right: 0;
    border-right: none;
    border-top: 1px solid var(--border);
    padding: 0;
    z-index: 999;
    overflow: hidden;
    align-items: center;
    justify-content: space-around;
  }

  .sidebar-logo,
  .nav-section,
  .sidebar-footer { display: none; }

  .nav-link {
    flex-direction: column;
    gap: 2px;
    font-size: .65rem;
    padding: 8px 10px;
    border-radius: 6px;
    text-align: center;
  }

  /* Main content fills full width, padding for bottom nav */
  .main-content {
    margin-left: 0;
    padding: 16px 16px 80px;
  }

  /* Hero banner */
  .hero-banner {
    padding: 24px 20px;
    border-radius: 12px;
  }
  .hero-banner h2 { font-size: 1.3rem; }

  /* Subjects grid - 2 columns on mobile */
  .subjects-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .subject-card { padding: 14px; }

  /* Syllabus - single column */
  .syllabus-grid { grid-template-columns: 1fr; }

  /* Exam setup - single column */
  .exam-setup-grid { grid-template-columns: 1fr; }

  /* Stats grid - 2 columns */
  .stats-grid { grid-template-columns: repeat(2, 1fr); }

  /* Tables scroll horizontally */
  .table-wrap { overflow-x: auto; }

  /* Chat page */
  .chat-page { height: calc(100vh - 60px); }
  .chat-header { flex-direction: column; align-items: flex-start; gap: 8px; }
  .chat-header select { width: 100%; }
  .msg-bubble { max-width: 88%; }
  .quick-prompts { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .quick-prompts button { white-space: nowrap; flex-shrink: 0; }

  /* Auth cards */
  .auth-card { margin: 16px; padding: 28px 20px; }

  /* Topbar */
  .topbar { padding: 14px 0; }
  .search-bar { display: none; }
  .user-info span { display: none; }
}

@media (max-width: 400px) {
  .subjects-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-banner h2 { font-size: 1.1rem; }
}

/* ============ TOPBAR TIER BADGE (mobile visible) ============ */
.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-tier {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: .82rem;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
}

.topbar-tier.pro {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.topbar-tier.free {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  cursor: pointer;
  transition: all .15s;
}

.topbar-tier.free:hover {
  background: #1d4ed8;
  color: #fff;
  opacity: 1;
}

/* Hide topbar tier on desktop (sidebar already shows it) */
@media (min-width: 769px) {
  .topbar-tier { display: none; }
}

/* On mobile, hide search, show tier */
@media (max-width: 768px) {
  .search-bar { display: none; }
  .topbar { justify-content: space-between; }
  .topbar-tier { display: inline-flex; }
  .user-info span { display: none; }
}
.subject-card.locked {
  opacity: 0.5;
  filter: grayscale(1);
  cursor: pointer;
  border: 1px dashed #d1d5db;
}
.subject-card.locked:hover {
  border-color: var(--green);
  opacity: 0.7;
}
.btn-outline-white {
  background: transparent;
  color: #fff;
  border: 2px solid #fff;
  font-weight: 700;
  padding: 10px 20px;
  border-radius: 8px;
  display: inline-block;
  font-size: .9rem;
  margin-left: 10px;
}
.btn-outline-white:hover { background: rgba(255,255,255,.15); opacity:1; }
.hero-pro { background: linear-gradient(135deg, #0f2419 0%, #1a7a4a 100%); }
.upgrade-compare { margin-bottom: 28px; }
.upgrade-compare h3 { margin-bottom: 14px; color: var(--green); }
.compare-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.compare-table th { background: var(--green); color: #fff; padding: 10px 14px; text-align: left; }
.compare-table td { padding: 10px 14px; border-bottom: 1px solid var(--border); }
.compare-table tr:last-child td { border-bottom: none; }
.compare-table td:nth-child(3) { color: var(--green); font-weight: 600; }
.upgrade-price { margin-top: 16px; font-size: 1.1rem; text-align: center; color: var(--text); }
.upgrade-price strong { color: var(--green); font-size: 1.3rem; }
.pro-gate { background: #f0fdf4; border: 2px solid var(--green); border-radius: 16px; 
            padding: 40px; text-align: center; margin: 20px 0; }
.pro-gate-icon { font-size: 3rem; margin-bottom: 12px; }
.pro-gate h3 { font-size: 1.2rem; margin-bottom: 10px; }
.pro-gate p { color: var(--muted); margin-bottom: 20px; }
.whatsapp-cta { text-align: center; margin-bottom: 24px; padding: 20px; 
                background: #f0fdf4; border-radius: 10px; }
.whatsapp-cta p { margin-bottom: 12px; font-size: .9rem; color: var(--muted); }
.whatsapp-cta small { display: block; margin-top: 8px; font-size: .78rem; color: var(--muted); }
.btn-whatsapp { display: inline-block; background: #25d366; color: #fff; 
                padding: 12px 24px; border-radius: 8px; font-weight: 700; font-size: .95rem; }
.btn-whatsapp:hover { background: #128c7e; opacity: 1; color: #fff; }
.chat-notice {
  text-align: center;
  font-size: .78rem;
  color: #92400e;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 6px;
  padding: 6px 14px;
  margin: 4px 40px;
}
.diagram-notice {
  font-size: .78rem;
  color: #92400e;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 6px;
  padding: 7px 14px;
  margin-bottom: 8px;
  text-align: center;
}
.coming-soon-bar {
  background: #eff6ff;
  border-bottom: 1px solid #bfdbfe;
  padding: 9px 20px;
  font-size: .8rem;
  color: #1e40af;
  text-align: center;
}
.coming-soon-bar a {
  color: #1d4ed8;
  font-weight: 700;
  margin-left: 4px;
}
.coming-soon-bar a:hover {
  text-decoration: underline;
}
.stats-row {
  display: grid;
  grid-template-columns: repeat(4,1fr);
  gap: 16px;
  margin-bottom: 32px;
}
.stat-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
}
.stat-icon { font-size: 1.5rem; margin-bottom: 8px; }
.stat-val  { font-size: 1.6rem; font-weight: 900; color: var(--green); line-height:1; margin-bottom:4px; }
.stat-lbl  { font-size: .75rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }

@media(max-width:600px) {
  .stats-row { grid-template-columns: repeat(2,1fr); }
}


/* TRIGGER BUTTON */
.prompt-pack-btn {
  background: #f0fdf4;
  border: 1px solid #86efac;
  color: #166534;
  font-size: .8rem;
  font-weight: 700;
  padding: 7px 16px;
  border-radius: 20px;
  cursor: pointer;
  margin-bottom: 10px;
  transition: all .15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.prompt-pack-btn:hover {
  background: #dcfce7;
  border-color: #4ade80;
}

/* OVERLAY */
.prompt-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 1000;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}
.prompt-modal-overlay.open {
  display: flex;
}

/* MODAL */
.prompt-modal {
  background: #fff;
  width: 100%;
  max-width: 680px;
  max-height: 85vh;
  border-radius: 20px 20px 0 0;
  padding: 24px 24px 32px;
  overflow-y: auto;
  animation: slideUp .25s ease;
}
@keyframes slideUp {
  from { transform: translateY(40px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* On desktop — center it */
@media(min-width: 768px) {
  .prompt-modal-overlay {
    align-items: center;
  }
  .prompt-modal {
    border-radius: 20px;
    max-height: 80vh;
  }
}

/* HEADER */
.prompt-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 18px;
}
.prompt-modal-header h3 {
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 4px;
}
.prompt-modal-header p {
  font-size: .82rem;
  color: #6b7280;
  line-height: 1.5;
}
.prompt-modal-close {
  background: #f3f4f6;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: .9rem;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #374151;
}
.prompt-modal-close:hover { background: #e5e7eb; }

/* TOPIC INPUT */
.prompt-topic-row {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 18px;
}
.prompt-topic-row label {
  display: block;
  font-size: .78rem;
  font-weight: 700;
  color: #374151;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.prompt-topic-row input {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: .9rem;
  font-family: inherit;
  outline: none;
  transition: border .15s;
}
.prompt-topic-row input:focus {
  border-color: #1a7a4a;
  box-shadow: 0 0 0 3px rgba(26,122,74,.1);
}

/* PROMPT GRID */
.prompt-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}
@media(max-width: 520px) {
  .prompt-grid { grid-template-columns: 1fr; }
}

/* PROMPT CARD */
.prompt-card {
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all .15s;
  background: #fff;
}
.prompt-card:hover {
  border-color: #1a7a4a;
  box-shadow: 0 4px 14px rgba(26,122,74,.1);
  transform: translateY(-1px);
}
.prompt-card-bonus {
  background: #fffbeb;
  border-color: #fde68a;
  grid-column: 1 / -1;
  flex-direction: row;
  align-items: center;
}
.prompt-card-bonus .prompt-card-body { flex: 1; }
.prompt-card-bonus .prompt-use-btn { flex-shrink: 0; }

.prompt-card-icon {
  font-size: 1.4rem;
  line-height: 1;
}
.prompt-card-body h4 {
  font-size: .88rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: #111827;
}
.prompt-preview {
  font-size: .78rem;
  color: #6b7280;
  line-height: 1.5;
}
.prompt-preview strong {
  color: #1a7a4a;
  font-weight: 600;
}
.prompt-use-btn {
  background: #1a7a4a;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 9px 14px;
  font-size: .8rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s;
  align-self: flex-start;
  white-space: nowrap;
}
.prompt-use-btn:hover { background: #14603b; }

/* TIP */
.prompt-modal-tip {
  font-size: .78rem;
  color: #9ca3af;
  text-align: center;
  padding-top: 8px;
  border-top: 1px solid #f3f4f6;
}
/* ============================================================
   PASTE THIS AT THE BOTTOM OF style.css
   Fixes: 1) Language toggle + sign out on mobile topbar
          2) PWA banner close button
   ============================================================ */

/* Language toggle in topbar (mobile only) */
.topbar-lang {
  display: none;
}

@media (max-width: 768px) {
  .topbar-lang {
    display: flex;
    align-items: center;
    gap: 5px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 20px;
    padding: 4px 6px;
  }
  .topbar-lang-btn {
    border: none;
    background: transparent;
    color: #6b7280;
    font-size: .72rem;
    font-weight: 700;
    padding: 4px 9px;
    border-radius: 16px;
    cursor: pointer;
    font-family: inherit;
    transition: all .15s;
    white-space: nowrap;
  }
  .topbar-lang-btn.active {
    background: #1a7a4a;
    color: #fff;
  }

  /* Sign out link in topbar on mobile */
  .topbar-signout {
    display: inline-flex;
    align-items: center;
    font-size: .78rem;
    color: #6b7280;
    padding: 6px 10px;
    border-radius: 20px;
    border: 1px solid #e5e7eb;
    white-space: nowrap;
  }
  .topbar-signout:hover {
    color: #991b1b;
    border-color: #fecaca;
    background: #fef2f2;
    opacity: 1;
  }
}

/* Hide topbar-lang on desktop (sidebar handles it) */
@media (min-width: 769px) {
  .topbar-lang { display: none; }
  .topbar-signout { display: none; }
}

/* PWA banner close button fix */
#pwa-banner-close {
  background: none;
  border: none;
  color: rgba(255,255,255,.5);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  flex-shrink: 0;
}
#pwa-banner-close:hover {
  color: #fff;
}