*{box-sizing:border-box}

:root{
  --bg:#f8fafc;
  --card:rgba(255,255,255,.88);
  --text:#14213d;
  --muted:#667085;
  --primary:#0f766e;
  --secondary:#d4af37;
  --danger:#ef4444;
  --success:#16a34a;
}

body{
  margin:0;
  font-family:Tahoma,Arial,sans-serif;
  background:var(--bg);
  color:var(--text);
}

#splash{
  position:fixed;
  inset:0;
  z-index:9999;
  background:
    radial-gradient(circle at 20% 20%,rgba(212,175,55,.18),transparent 28%),
    linear-gradient(135deg,#0f172a,#164e63,#0f766e);
  color:white;
  display:flex;
  align-items:center;
  justify-content:center;
  flex-direction:column;
  text-align:center;
  transition:.55s ease;
}

#splash.hide{opacity:0;visibility:hidden}

#splash img{
  width:78px;
  height:78px;
  border-radius:20px;
  margin-bottom:12px;
}

#splash h2{
  margin:0;
  font-size:22px;
  font-weight:800;
}

#splash p{
  margin:8px 20px;
  font-size:13px;
  opacity:.9;
}

.loader{
  width:32px;
  height:32px;
  border-radius:50%;
  border:3px solid rgba(255,255,255,.35);
  border-top-color:white;
  animation:spin 1s linear infinite;
  margin-top:14px;
}

@keyframes spin{to{transform:rotate(360deg)}}

.app{
  min-height:100vh;
  padding:22px;
  background:
    radial-gradient(circle at top right,rgba(15,118,110,.18),transparent 35%),
    linear-gradient(135deg,#f8fafc,#ffffff);
}

.hero,.panel,.results{
  max-width:900px;
  margin:0 auto 18px;
}

.hero{
  display:flex;
  align-items:center;
  gap:14px;
  padding:16px 20px;
  border-radius:22px;
  background:var(--card);
  backdrop-filter:blur(18px);
  box-shadow:0 16px 38px rgba(15,23,42,.08);
}

.hero img{
  width:58px;
  height:58px;
  object-fit:contain;
}

.hero h1{
  margin:0;
  font-size:19px;
  font-weight:800;
  line-height:1.3;
  color:var(--primary);
}

.hero p{
  margin:5px 0 0;
  font-size:12.5px;
  color:var(--muted);
}

.top-actions{
  margin-inline-start:auto;
  display:flex;
  gap:7px;
}

button{
  border:0;
  cursor:pointer;
  transition:.25s;
}

button:hover{transform:translateY(-2px)}

.top-actions button,
.icon-btn{
  width:34px;
  height:34px;
  border-radius:11px;
  font-size:14px;
  background:linear-gradient(135deg,var(--primary),var(--secondary));
  color:white;
}

.panel{
  padding:20px;
  border-radius:22px;
  background:var(--card);
  box-shadow:0 16px 38px rgba(15,23,42,.08);
  backdrop-filter:blur(18px);
}

.panel h2{margin-top:0}

.grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:16px;
}

label span{
  display:block;
  margin-bottom:8px;
  font-weight:bold;
}

input,select{
  width:100%;
  padding:11px 13px;
  border-radius:13px;
  border:1px solid rgba(148,163,184,.55);
  outline:0;
  font-size:14px;
  background:white;
}

.section-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.course{
  display:grid;
  grid-template-columns:1fr 1fr 44px;
  gap:12px;
  margin-bottom:12px;
}

.delete{
  border-radius:12px;
  background:var(--danger);
  color:white;
  font-size:14px;
}

.calculate{
  width:100%;
  padding:12px;
  border-radius:15px;
  background:linear-gradient(135deg,#16a34a,#22c55e);
  color:white;
  font-size:14px;
  font-weight:bold;
  margin-top:10px;
}

.results{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:12px;
  max-width:900px;
  margin:18px auto;
}

.result-card{
    padding:14px 12px;
    border-radius:18px;
    text-align:center;
    color:#fff;
    background:#0f766e;
    border:1px solid rgba(212,175,55,.35);
    box-shadow:0 8px 20px rgba(0,0,0,.12);
}

.result-card span{
  display:block;
  font-size:13px;
  font-weight:500;
  opacity:.95;
  margin-bottom:6px;
}

.result-card strong{
  display:block;
  font-size:26px;
  font-weight:800;
  line-height:1.2;
}

.footer{
  margin-top:30px;
  text-align:center;
  padding-bottom:24px;
}

.footer-line{
  width:70px;
  height:3px;
  margin:auto auto 14px;
  border-radius:30px;
  background:linear-gradient(90deg,#0f766e,#d4af37);
}

.footer-content{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:9px 18px;
  border-radius:999px;
  background:rgba(255,255,255,.72);
  backdrop-filter:blur(14px);
  box-shadow:0 10px 28px rgba(15,23,42,.08);
}

.footer small{
  display:block;
  font-size:10px;
  color:#64748b;
  margin-bottom:2px;
}

.footer a{
  display:block;
  color:#0f766e;
  font-size:14px;
  font-weight:800;
  text-decoration:none;
}

.footer a:hover{color:#d4af37}

.app.dark{
  --card:rgba(15,23,42,.88);
  --text:#ffffff;
  --muted:#e2e8f0;
  background:linear-gradient(135deg,#020617,#111827);
  color:#ffffff;
}

.app.dark input,
.app.dark select{
  background:#0f172a;
  color:#ffffff;
  border:1px solid #334155;
}

.app.dark input::placeholder{color:#94a3b8}

.app.dark .hero,
.app.dark .panel{
  background:rgba(15,23,42,.88);
  color:#ffffff;
  border:1px solid rgba(255,255,255,.06);
}

.app.dark h1,
.app.dark h2,
.app.dark p,
.app.dark span,
.app.dark label,
.app.dark strong{
  color:#ffffff;
}

.app.dark .result-card{
  background:linear-gradient(135deg,#0f766e,#d4af37);
}

.app.dark .footer-content{
  background:rgba(255,255,255,.07);
  border:1px solid rgba(255,255,255,.08);
}

.app.dark .footer small{color:#cbd5e1}
.app.dark .footer a{color:#facc15}

@media(max-width:768px){
  .app{padding:14px}

  .hero{
    flex-direction:column;
    text-align:center;
    padding:16px;
  }

  .top-actions{margin-inline-start:0}

  .hero img{
    width:55px;
    height:55px;
  }

  .hero h1{font-size:16px}
  .hero p{font-size:12px}

  .grid,
  .course,
  .results{
    grid-template-columns:1fr;
  }

  .results{gap:10px}

  .result-card{
    padding:14px;
  }

  .result-card span{font-size:12px}
  .result-card strong{font-size:24px}
}