:root{
  --bg: #0b1220;
  --card: rgba(255,255,255,0.06);
  --card2: rgba(255,255,255,0.08);
  --line: rgba(255,255,255,0.12);
  --text: rgba(255,255,255,0.92);
  --muted: rgba(255,255,255,0.68);
  --muted2: rgba(255,255,255,0.52);
  --brand: #f59e0b;
  --brand2: #22c55e;
  --danger: #ef4444;
  --shadow: 0 20px 50px rgba(0,0,0,0.35);
  --radius: 18px;
  --radius2: 14px;
  --font: "Inter", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

*{ box-sizing: border-box; }
html, body{ height: 100%; }
body{
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: radial-gradient(1200px 600px at 20% 10%, rgba(245, 158, 11, 0.14), transparent 60%),
              radial-gradient(900px 500px at 80% 0%, rgba(34, 197, 94, 0.10), transparent 55%),
              radial-gradient(900px 700px at 50% 80%, rgba(59, 130, 246, 0.10), transparent 60%),
              var(--bg);
}

/* Header */
.header{
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(7, 12, 24, 0.72);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-inner{
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo-link{
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}
.header-logo{
  width: 36px;
  height: 36px;
  border-radius: 10px;
}
.site-title{
  font-weight: 800;
  letter-spacing: -0.02em;
}
.nav-links{
  display: flex;
  align-items: center;
  gap: 18px;
}
.nav-links a{
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
}
.nav-links a:hover{ color: var(--text); }

.dropdown{ position: relative; }
.dropdown-toggle{
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  font-weight: 700;
  padding: 8px 10px;
  border-radius: 12px;
  cursor: pointer;
}
.dropdown-content{
  position: absolute;
  right: 0;
  top: 44px;
  width: 230px;
  padding: 10px;
  border-radius: 14px;
  background: rgba(10, 16, 32, 0.96);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  display: none;
}
.dropdown.open .dropdown-content{ display: block; }
.dropdown-content a{
  display: block;
  padding: 10px 10px;
  border-radius: 10px;
  color: var(--muted);
}
.dropdown-content a:hover{
  background: rgba(255,255,255,0.06);
  color: var(--text);
}

/* Mobile menu */
.mobile-menu-btn{
  display: none;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 12px;
  padding: 8px 10px;
  cursor: pointer;
}
.mobile-menu{
  display: none;
  border-top: 1px solid var(--line);
  background: rgba(7, 12, 24, 0.86);
  padding: 12px 18px;
}
.mobile-menu a{
  display: block;
  padding: 10px 8px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 700;
  border-radius: 10px;
}
.mobile-menu a:hover{
  background: rgba(255,255,255,0.06);
  color: var(--text);
}
.mobile-menu.open{ display: block; }

@media (max-width: 900px){
  .nav-links{ display: none; }
  .mobile-menu-btn{ display: inline-flex; }
}

/* Page Header */
.page-header{
  border-bottom: 1px solid var(--line);
}
.page-header-inner{
  max-width: 1200px;
  margin: 0 auto;
  padding: 26px 18px 22px;
}
.page-header h1{
  margin: 0 0 10px;
  font-size: 30px;
  line-height: 1.2;
  font-weight: 900;
  letter-spacing: -0.03em;
}
.page-header p{
  margin: 0;
  color: var(--muted);
  max-width: 900px;
  line-height: 1.6;
}

/* Main container */
.calculator-container{
  max-width: 1200px;
  margin: 0 auto;
  padding: 22px 18px 40px;
}
.calculator-card{
  background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.05));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}
.intro-text{
  margin: 0 0 16px;
  color: var(--muted);
  line-height: 1.65;
}

/* Unit toggle */
.unit-toggle{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 16px 0 16px;
}
.unit-btn{
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 12px 12px;
  border-radius: 14px;
  font-weight: 900;
  cursor: pointer;
}
.unit-btn.active{
  background: rgba(245, 158, 11, 0.18);
  border-color: rgba(245, 158, 11, 0.35);
  color: var(--text);
}

/* Inputs */
.inputs-grid{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 10px;
}
@media (max-width: 1000px){
  .inputs-grid{ grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px){
  .inputs-grid{ grid-template-columns: 1fr; }
}

.input-group{
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: var(--radius2);
  padding: 12px;
}
.input-label{
  display: block;
  font-weight: 900;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}
.input-field{
  width: 100%;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(0,0,0,0.18);
  color: var(--text);
  outline: none;
}
.input-field:focus{
  border-color: rgba(245, 158, 11, 0.45);
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.14);
}
.input-hint{
  margin-top: 8px;
  color: var(--muted2);
  font-size: 12px;
  line-height: 1.4;
}

/* Buttons */
.calculate-btn{
  margin-top: 16px;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(245, 158, 11, 0.40);
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.30), rgba(245, 158, 11, 0.16));
  color: var(--text);
  font-weight: 1000;
  cursor: pointer;
}
.calculate-btn:hover{
  transform: translateY(-1px);
  transition: transform .15s ease;
}

.mini-note{
  margin-top: 14px;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px dashed rgba(255,255,255,0.20);
  color: var(--muted);
  background: rgba(255,255,255,0.03);
  line-height: 1.6;
}

/* Results */
.results-section{
  margin-top: 18px;
  display: none;
}
.results-section.show{ display: block; }
.result-title{
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 1000;
  margin: 12px 0 14px;
}
.hero-result{
  border-radius: var(--radius);
  padding: 16px;
  border: 1px solid rgba(255,255,255,0.14);
  background: linear-gradient(180deg, rgba(34,197,94,0.12), rgba(255,255,255,0.05));
}
.hero-result-label{
  color: var(--muted);
  font-weight: 900;
}
.hero-result-value{
  font-size: 34px;
  font-weight: 1000;
  letter-spacing: -0.03em;
  margin-top: 6px;
}
.hero-result-sub{
  margin-top: 6px;
  color: var(--muted);
  font-weight: 700;
}

.result-box{
  margin-top: 12px;
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  padding: 14px;
}
.result-label{
  font-weight: 1000;
  margin-bottom: 10px;
}
.breakdown-item{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.10);
}
.breakdown-item:last-child{ border-bottom: 0; }
.breakdown-label{ color: var(--muted); font-weight: 800; }
.breakdown-value{ font-weight: 1000; }
.total-line{
  margin-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-top: 12px;
}
.small-muted{
  margin-top: 10px;
  color: var(--muted2);
  font-size: 12px;
  line-height: 1.5;
}
.small-muted a{ color: rgba(245, 158, 11, 0.95); font-weight: 900; text-decoration: none; }
.small-muted a:hover{ text-decoration: underline; }

.formula-result .formula-text{
  color: var(--muted);
  line-height: 1.7;
}
.analysis-text{
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.error-box{
  border-color: rgba(239,68,68,0.35);
  background: rgba(239,68,68,0.08);
}
.error-text{
  color: rgba(255,255,255,0.9);
  line-height: 1.6;
}

/* Schedule */
.schedule-grid{
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
@media (max-width: 900px){
  .schedule-grid{ grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px){
  .schedule-grid{ grid-template-columns: 1fr; }
}
.schedule-item{
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.16);
  border-radius: 16px;
  padding: 12px;
}
.schedule-time{
  font-weight: 1000;
}
.schedule-ml{
  font-size: 20px;
  font-weight: 1000;
  margin-top: 6px;
}
.schedule-sub{
  margin-top: 6px;
  color: var(--muted2);
  font-size: 12px;
  line-height: 1.4;
}

/* Download buttons */
.download-buttons{
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.download-btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 12px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.05);
  color: var(--text);
  font-weight: 1000;
  cursor: pointer;
}
.download-btn:hover{
  background: rgba(255,255,255,0.07);
}

/* Info grid */
.info-grid{
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
@media (max-width: 1000px){
  .info-grid{ grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px){
  .info-grid{ grid-template-columns: 1fr; }
}
.info-card{
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  padding: 14px;
}
.info-card h3{
  margin: 0 0 8px;
  font-weight: 1000;
}
.info-card p{
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

/* Blog section */
.blog-section{
  margin-top: 24px;
  padding: 18px;
}
.blog-content{
  max-width: 1000px;
  margin: 0 auto;
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.03);
  padding: 18px;
}
.blog-content h2{
  margin: 0 0 10px;
  font-size: 22px;
  font-weight: 1000;
  letter-spacing: -0.02em;
}
.blog-content h3{
  margin-top: 18px;
  margin-bottom: 8px;
  font-size: 16px;
  font-weight: 1000;
}
.blog-content p, .blog-content li{
  color: var(--muted);
  line-height: 1.75;
}
.blog-content a{
  color: rgba(245, 158, 11, 0.95);
  font-weight: 900;
  text-decoration: none;
}
.blog-content a:hover{ text-decoration: underline; }

.highlight-box{
  margin: 14px 0;
  border-radius: 16px;
  border: 1px solid rgba(245, 158, 11, 0.25);
  background: rgba(245, 158, 11, 0.10);
  padding: 12px;
}
.formula-box{
  margin: 12px 0;
  border-radius: 16px;
  border: 1px solid rgba(34, 197, 94, 0.22);
  background: rgba(34, 197, 94, 0.08);
  padding: 12px;
}
.faq-item{
  border-top: 1px solid rgba(255,255,255,0.10);
  padding-top: 12px;
  margin-top: 12px;
}
.faq-item h4{
  margin: 0 0 6px;
  font-weight: 1000;
}

/* Footer */
.footer{
  margin-top: 22px;
  border-top: 1px solid var(--line);
  background: rgba(7, 12, 24, 0.72);
}
.footer-column h3{
  margin: 0 0 10px;
  font-weight: 1000;
}
.footer-column ul{
  list-style: none;
  padding: 0;
  margin: 0;
}
.footer-column li{
  margin: 10px 0;
}
.footer-column a{
  color: var(--muted);
  text-decoration: none;
  font-weight: 800;
}
.footer-column a:hover{ color: var(--text); }
.footer-bottom{
  margin-top: 18px;
  padding: 16px 0 22px;
  border-top: 1px solid rgba(255,255,255,0.10);
  color: var(--muted2);
  text-align: center;
  font-weight: 700;
}
