:root{
  --bg:#f6f8fb;
  --card:#ffffff;
  --text:#0f172a;
  --muted:#64748b;
  --border:#e5e7eb;
  --brand:#2563eb;
  --brand2:#ef4444;
  --shadow: 0 12px 30px rgba(15,23,42,.08);
  --radius: 18px;
  --max: 1120px;
}

*{box-sizing:border-box}
body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: radial-gradient(1200px 600px at 20% 0%, rgba(37,99,235,.08), transparent),
              radial-gradient(900px 500px at 90% 10%, rgba(239,68,68,.06), transparent),
              var(--bg);
  color:var(--text);
}
a{color:inherit}
.container{max-width:var(--max); margin:0 auto; padding:0 18px}
.spacer{height:22px}

/* Header */
.site-header{
  position:sticky; top:0; z-index:50;
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(10px);
  border-bottom:1px solid var(--border);
}
.header-row{
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 0;
}
.brand{
  display:flex; align-items:center; gap:10px; font-weight:800;
}
.brand-badge{
  width:36px;height:36px;border-radius:12px;
  display:grid;place-items:center;
  background: linear-gradient(135deg, #60a5fa, #a78bfa);
  color:white; font-weight:900;
}
.nav a{
  text-decoration:none;
  color:var(--muted);
  font-weight:600;
  margin:0 10px;
}
.nav a:hover{color:var(--text)}
.nav a.active{color:var(--text)}
.header-cta{display:flex; gap:10px}
.btn{
  border:1px solid var(--border);
  background:white;
  padding:10px 14px;
  border-radius:999px;
  font-weight:700;
  text-decoration:none;
  box-shadow: 0 8px 18px rgba(15,23,42,.06);
}
.btn.primary{
  background: linear-gradient(135deg, var(--brand2), #fb7185);
  border:none;
  color:white;
}

/* Banner */
.hero{
  margin:22px 0 18px;
  border-radius: 22px;
  overflow:hidden;
  box-shadow: var(--shadow);
  background:#0b1220;
}
.hero-img{
  height:220px;
  background-image: url('/assets/img/train-banner.png');
  background-size: cover;
  background-position: center;
  position:relative;
}
.hero-img::after{
  content:"";
  position:absolute; inset:0;
  background: linear-gradient(90deg, rgba(15,23,42,.65), rgba(15,23,42,.2));
}
.hero-inner{
  margin-top:-54px;
  background: rgba(255,255,255,.92);
  border:1px solid rgba(229,231,235,.9);
  border-radius: 18px;
  padding:16px;
  box-shadow: 0 14px 28px rgba(15,23,42,.08);
}

/* Home official boxes */
.section-title{
  display:flex; align-items:flex-end; justify-content:space-between;
  gap:12px;
  margin:18px 0 12px;
}
.section-title h2{margin:0; font-size:18px}
.section-title p{margin:0; color:var(--muted); font-size:13px}

.official-grid{
  display:grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap:12px;
}
.official-grid a{
  text-decoration:none;
  padding:14px 14px;
  border-radius: 16px;
  border:1px solid var(--border);
  background: var(--card);
  box-shadow: 0 10px 20px rgba(15,23,42,.06);
  display:flex; align-items:center; justify-content:center;
  font-weight:800;
}
.official-grid a.pnr{ background: rgba(245,158,11,.12); border-color: rgba(245,158,11,.25) }
.official-grid a.seat{ background: rgba(34,197,94,.12); border-color: rgba(34,197,94,.25) }
.official-grid a.ntes{ background: rgba(168,85,247,.12); border-color: rgba(168,85,247,.25) }
.official-grid a.irctc{ background: rgba(59,130,246,.10); border-color: rgba(59,130,246,.25) }

/* Cards (guides/tools) */
.grid-2{
  display:grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap:16px;
}
.card{
  background: var(--card);
  border:1px solid var(--border);
  border-radius: var(--radius);
  padding:18px;
  box-shadow: 0 14px 28px rgba(15,23,42,.06);
}
.card h3{margin:0 0 6px}
.card p{margin:0 0 12px; color:var(--muted)}
.card .btn{display:inline-block}

/* Footer */
.site-footer{
  margin-top:28px;
  border-top:1px solid var(--border);
  background: rgba(255,255,255,.75);
}
.footer-row{
  display:grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap:16px;
  padding:18px 0;
  color:var(--muted);
  font-size:14px;
}
.footer-row a{color:var(--muted); text-decoration:none}
.footer-row a:hover{color:var(--text)}
.footer-mini{
  padding:10px 0 18px;
  color:var(--muted);
  font-size:13px;
}

/* Responsive */
@media (max-width: 980px){
  .official-grid{grid-template-columns: repeat(2, minmax(0,1fr));}
  .grid-2{grid-template-columns: 1fr;}
  .footer-row{grid-template-columns: 1fr;}
  .nav{display:none;}
}

/* ===== Tool pages only: reduce big blue banner ===== */
body.tool-page .tool-hero,
body.tool-page .tools-hero,
body.tool-page .page-hero,
body.tool-page .hero,
body.tool-page .hero-banner,
body.tool-page [class*="hero"]{
  height: 160px !important;
  min-height: 160px !important;
  max-height: 160px !important;
  overflow: hidden;
  background-size: cover;
  background-position: center;
}

/* ===== Tool pages: reduce huge blue banner + ensure title visible ===== */
.tool-hero, .tools-hero, .page-hero, .hero-banner, .hero {
  height: 140px !important;
  min-height: 140px !important;
  max-height: 140px !important;
  overflow: hidden !important;
  border-radius: 18px;
}
.tool-hero *, .tools-hero *, .page-hero *, .hero-banner *, .hero *{
  max-height: 140px !important;
}
.tool-page .page-title-wrap{
  max-width:1100px;
  margin: 14px auto 10px;
  padding: 0 18px;
}
.tool-page .page-title-wrap h1{
  margin: 0 0 6px;
  font-size: 34px;
  line-height: 1.15;
}
.tool-page .page-title-wrap p{
  margin: 0;
  opacity: .72;
  max-width: 75ch;
}

/* ===============================
   BUTTON VISIBILITY FIX (TOOLS)
   =============================== */

button,
input[type="button"],
input[type="submit"]{
  font-weight: 700;
  border-radius: 10px;
  padding: 10px 16px;
  border: 1px solid rgba(0,0,0,.12);
  cursor: pointer;
}

/* Main action */
button.primary,
button.forecast{
  background: #f97316 !important;
  color: #ffffff !important;
  border-color: transparent !important;
}

/* Save / Reset */
button.save,
button.reset{
  background: #e5e7eb !important;
  color: #111827 !important;
}

/* Fix black buttons */
button{
  background: #f8fafc;
  color: #0f172a;
}

/* =====================================
   TOOL PAGES BUTTON COLOR FIX
   ===================================== */

button{
  background: #f97316 !important;
  color: #ffffff !important;
  font-weight: 700;
  border-radius: 10px;
}

/* Save / Reset */
button.save,
button.reset{
  background: #e5e7eb !important;
  color: #111827 !important;
}

/* ===== HOME HERO/BANNER FIX (text visible) ===== */
body{ padding-top: 72px; }

.hero,
.hero-section,
.hero-banner,
.home-hero,
.banner,
.banner-wrap{
  overflow: visible !important;
  min-height: 280px !important;
  height: auto !important;
  padding-top: 28px !important;
  padding-bottom: 22px !important;
  position: relative;
}

.hero .content,
.hero-content,
.banner-content,
.hero-text{
  position: relative;
  z-index: 5 !important;
}


/* =========================================================
   FIX: Home hero banner got affected by tool banner CSS
   Scope tool-banner shrink ONLY to tool pages (body.tool-page)
   Restore home hero height/layout + orange buttons
   ========================================================= */

body.tool-page .tool-hero,
body.tool-page .tools-hero,
body.tool-page .page-hero,
body.tool-page .hero-banner{
  height: 160px !important;
  min-height: 160px !important;
  max-height: 160px !important;
  overflow: hidden !important;
  background-size: cover !important;
  background-position: center !important;
}

body:not(.tool-page) .tool-hero,
body:not(.tool-page) .tools-hero,
body:not(.tool-page) .page-hero,
body:not(.tool-page) .hero-banner{
  height: auto !important;
  min-height: 320px !important;
  max-height: none !important;
  overflow: visible !important;
}

