:root{
  --bg:#0d1b2a;
  --bg2:#0a141f;
  --card:#132b3d;
  --cream:#eef4f8;
  --muted:#8fa4b3;
  --accent:#2dd4bf;
  --accent-soft:#5eead4;
  --line:rgba(238,244,248,0.12);
}
@media (prefers-color-scheme: light){
  :root:not([data-theme="dark"]){
    --bg:#f3f7f9;
    --bg2:#e7eef1;
    --card:#ffffff;
    --cream:#0d1b2a;
    --muted:#5a6b76;
    --accent:#0d9488;
    --accent-soft:#0f766e;
    --line:rgba(13,27,42,0.12);
  }
}
:root[data-theme="dark"]{
  --bg:#0d1b2a;
  --bg2:#0a141f;
  --card:#132b3d;
  --cream:#eef4f8;
  --muted:#8fa4b3;
  --accent:#2dd4bf;
  --accent-soft:#5eead4;
  --line:rgba(238,244,248,0.12);
}

*{box-sizing:border-box;}
html{overflow-x:hidden;}
body{
  margin:0;
  background:
    radial-gradient(1200px 600px at 50% -10%, var(--bg2), transparent 60%),
    var(--bg);
  color:var(--cream);
  font-family:'Inter', -apple-system, Segoe UI, sans-serif;
  min-height:100vh;
  padding-block:40px;
  padding-inline:16px;
  display:flex;
  justify-content:center;
}
.page{
  width:100%;
  max-width:560px;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:22px;
}
@keyframes rise{
  from{opacity:0;transform:translateY(14px);}
  to{opacity:1;transform:translateY(0);}
}
.rise{animation:rise 0.5s cubic-bezier(.2,.7,.3,1) both;}
@media (prefers-reduced-motion: reduce){
  .rise{animation:none;}
}

.topbar{
  width:100%;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.brand{
  display:flex;align-items:center;gap:8px;
  font-family:'Poppins', sans-serif;
  font-weight:700;
  font-size:16px;
  text-decoration:none;
  color:var(--cream);
}
.mark{
  width:30px;height:30px;border-radius:9px;
  background:linear-gradient(160deg, var(--accent-soft), var(--accent));
  display:flex;align-items:center;justify-content:center;
  color:var(--bg2);font-weight:700;font-size:12px;
}
.navlinks{display:flex;gap:16px;}
.navlinks a{color:var(--muted);text-decoration:none;font-size:13.5px;font-weight:600;}
.navlinks a:hover{color:var(--accent);}

.hero{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:10px;
  text-align:center;
  margin-top:8px;
}
.badge{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:6px 14px;
  border-radius:999px;
  background:rgba(45,212,191,0.12);
  border:1px solid rgba(45,212,191,0.35);
  color:var(--accent);
  font-size:11px;
  font-weight:700;
  letter-spacing:0.5px;
}
h1{
  font-family:'Poppins', sans-serif;
  font-weight:700;
  font-size:clamp(28px,7vw,36px);
  margin:0;
  text-align:center;
}
h1 em{
  font-style:normal;
  color:var(--accent);
}
.tagline{
  margin:0;
  color:var(--muted);
  font-size:14.5px;
  line-height:1.55;
  max-width:400px;
}

.card{
  width:100%;
  background:var(--card);
  border:1px solid var(--line);
  border-radius:18px;
  padding:24px;
  display:flex;
  flex-direction:column;
  gap:16px;
}
.card-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.card-head h2{
  font-family:'Poppins', sans-serif;
  font-size:19px;
  font-weight:600;
  margin:0;
}
.muted-tag{
  font-size:11px;
  color:var(--muted);
  text-transform:uppercase;
  letter-spacing:0.6px;
}

.conv-row{
  display:flex;
  gap:12px;
}
.swap-row{
  align-items:flex-end;
}
.field{
  flex:1;
  display:flex;
  flex-direction:column;
  gap:6px;
  min-width:0;
}
.field label{
  font-size:11.5px;
  color:var(--muted);
  text-transform:uppercase;
  letter-spacing:0.5px;
  font-weight:600;
}
input, select{
  width:100%;
  padding:12px 14px;
  border-radius:12px;
  border:1px solid var(--line);
  background:var(--bg);
  color:var(--cream);
  font-size:15px;
  font-family:inherit;
  outline:none;
  transition:border-color .15s ease;
}
input:focus, select:focus{
  border-color:var(--accent);
}
select{
  appearance:none;
  -webkit-appearance:none;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238fa4b3' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat:no-repeat;
  background-position:right 12px center;
  padding-right:34px;
  cursor:pointer;
}
.swap-btn{
  flex:none;
  width:42px;height:42px;
  border-radius:12px;
  border:1px solid var(--line);
  background:var(--bg);
  color:var(--accent);
  display:flex;align-items:center;justify-content:center;
  cursor:pointer;
  transition:border-color .15s ease, transform .15s ease;
}
.swap-btn:hover{border-color:var(--accent);transform:rotate(180deg);}
.swap-btn svg{width:18px;height:18px;}

.result-box{
  width:100%;
  padding:18px;
  border-radius:14px;
  background:linear-gradient(135deg, rgba(45,212,191,0.14), transparent 60%);
  border:1px solid rgba(45,212,191,0.3);
  text-align:center;
}
.result-box span{
  font-family:'Poppins', sans-serif;
  font-weight:700;
  font-size:clamp(20px,5.5vw,26px);
  color:var(--accent);
  word-break:break-word;
}
.hint{
  margin:0;
  text-align:center;
  font-size:12px;
  color:var(--muted);
}

.chip-row{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}
.chip{
  padding:8px 14px;
  border-radius:999px;
  background:var(--bg);
  border:1px solid var(--line);
  font-size:12.5px;
  font-weight:600;
  color:var(--muted);
  cursor:pointer;
  transition:border-color .15s ease, color .15s ease, background .15s ease;
}
.chip:hover{color:var(--cream);}
.chip.active{
  background:rgba(45,212,191,0.14);
  border-color:var(--accent);
  color:var(--accent);
}

.about-card{
  width:100%;
  padding:20px;
  border-radius:16px;
  background:var(--card);
  border:1px solid var(--line);
  color:var(--muted);
  font-size:13.5px;
  line-height:1.7;
}
.about-card h2{
  font-family:'Poppins', sans-serif;
  font-size:16px;
  color:var(--cream);
  margin:0 0 8px;
}

footer{
  text-align:center;
  color:var(--muted);
  font-size:12px;
  margin-top:4px;
}

@media (max-width:420px){
  .conv-row.swap-row{
    flex-wrap:wrap;
  }
  .swap-btn{
    order:3;
    margin:4px auto 0;
  }
  .field{
    min-width:calc(50% - 6px);
  }
}
